<commit_before><template>
    
    <div>
        <span v-if="!editmode" v-on:click="editmode = !editmode">
            {{ text }}
            <button class="btn btn-default">{{button}}</button>
        </span>
        <form v-if="editmode" v-bind:action="action" method="POST">
            <textarea name="text" v-bind:rows="rows" v-bind:cols="cols">{{ text }}</textarea> 
            <input type="hidden" name="type" v-bind:value="type" />
            <input type="hidden" name="parent_type" v-bind:value="parent_type" />
            <input type="text" name="language" v-bind:value="language" size="2"/>
            <input type="submit" name="submit" value="Add" class="btn btn-success"/>
            <input type="reset" value="Cancel" v-on:click="editmode = !editmode" class="btn btn-default"/>
            <input type="hidden" name="_token" v-bind:value="csrf_token">
            <input type="hidden" name="_method" v-bind:value="method">
            <input type="hidden" name="parent_id" v-bind:value="parent_id">
        </form>
    </div>
</template>

<script>
    export default {
        data: function() {
            return {
                editmode: false
            }
        },
        mounted() {
        },
        props: {
            button: {
                type: String,
                default: 'Add text'
            },
            text: {
                type: String,
                default: ''
            },
            type: {
                type: String,
                default: 'title'
            },
            language: {
                type: String,
                default: 'en'
            },
            rows: {
                type: String,
                default: '1'
            },
            cols: {
                type: String,
                default: '50'
            },
            parent_id: String,
            parent_type: {
                type: String,
                default: 'section'
            },
            action: String,
            method: String,
            csrf_token: String
        }<commit_msg>fix default language to sv<commit_after><template>
    
    <div>
        <span v-if="!editmode" v-on:click="editmode = !editmode">
            {{ text }}
            <button class="btn btn-default">{{button}}</button>
        </span>
        <form v-if="editmode" v-bind:action="action" method="POST">
            <textarea name="text" v-bind:rows="rows" v-bind:cols="cols">{{ text }}</textarea> 
            <input type="hidden" name="type" v-bind:value="type" />
            <input type="hidden" name="parent_type" v-bind:value="parent_type" />
            <input type="text" name="language" v-bind:value="language" size="2"/>
            <input type="submit" name="submit" value="Add" class="btn btn-success"/>
            <input type="reset" value="Cancel" v-on:click="editmode = !editmode" class="btn btn-default"/>
            <input type="hidden" name="_token" v-bind:value="csrf_token">
            <input type="hidden" name="_method" v-bind:value="method">
            <input type="hidden" name="parent_id" v-bind:value="parent_id">
        </form>
    </div>
</template>

<script>
    export default {
        data: function() {
            return {
                editmode: false
            }
        },
        mounted() {
        },
        props: {
            button: {
                type: String,
                default: 'Add text'
            },
            text: {
                type: String,
                default: ''
            },
            type: {
                type: String,
                default: 'title'
            },
            language: {
                type: String,
                default: 'sv'
            },
            rows: {
                type: String,
                default: '1'
            },
            cols: {
                type: String,
                default: '50'
            },
            parent_id: String,
            parent_type: {
                type: String,
                default: 'section'
            },
            action: String,
            method: String,
            csrf_token: String
        }
{'fraction_non_alphanumeric': 0.14261623705131293, 'fraction_numerical': 0.001927246446639364, 'mean_word_length': 1.3470887507066138, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '364277', 'n_tokens_mistral': 1151, 'n_tokens_neox': 1107, 'n_words': 234}