<commit_before><template>
  <div>
    <e-text-field
      v-model="localCategory.short"
      :name="$tc('entity.category.fields.short')"
      vee-rules="required" />

    <e-text-field
      v-model="localCategory.name"
      :name="$tc('entity.category.fields.name')"
      vee-rules="required" />

    <e-color-picker
      v-model="localCategory.color"
      :name="$tc('entity.category.fields.color')"
      vee-rules="required" />

    <e-select
      v-model="localCategory.numberingStyle"
      :items="numberingStyles"
      :name="$tc('entity.category.fields.numberingStyle')"
      vee-rules="required" />

    <e-select
      v-model="localCategory.preferredContentTypes"
      :items="contentTypes"
      :name="$tc('entity.contentType.name', 2)"
      multiple />
  </div>
</template>

<script>
import { camelCase } from 'lodash'
import ESelect from '../form/base/ESelect.vue'
export default {
  name: 'DialogCategoryForm',
  components: { ESelect },
  props: {
    camp: { type: Object, required: true },
    isNew: { type: Boolean, required: true },
    category: { type: Object, required: true }
  },
  data () {
    return {
      updateColorAndNumberingStyle: true,
      localCategory: this.category
    }
  },
  computed: {
    numberingStyles () {
      return ['1', 'a', 'A', 'i', 'I'].map(i => ({
        value: i,
        text: this.$tc('entity.category.numberingStyles.' + i)
      }))
    },
    contentTypes () {
      return this.api.get().contentTypes().items.map(ct => ({
        value: ct,
        text: this.$tc('contentNode.' + camelCase(ct.name) + '.name')
      }))<commit_msg>DialogCategoryForm.vue: use contentType iri instead of objects<commit_after><template>
  <div>
    <e-text-field
      v-model="localCategory.short"
      :name="$tc('entity.category.fields.short')"
      vee-rules="required" />

    <e-text-field
      v-model="localCategory.name"
      :name="$tc('entity.category.fields.name')"
      vee-rules="required" />

    <e-color-picker
      v-model="localCategory.color"
      :name="$tc('entity.category.fields.color')"
      vee-rules="required" />

    <e-select
      v-model="localCategory.numberingStyle"
      :items="numberingStyles"
      :name="$tc('entity.category.fields.numberingStyle')"
      vee-rules="required" />

    <e-select
      v-model="localCategory.preferredContentTypes"
      :items="contentTypes"
      :name="$tc('entity.contentType.name', 2)"
      multiple />
  </div>
</template>

<script>
import { camelCase } from 'lodash'
import ESelect from '../form/base/ESelect.vue'
export default {
  name: 'DialogCategoryForm',
  components: { ESelect },
  props: {
    camp: { type: Object, required: true },
    isNew: { type: Boolean, required: true },
    category: { type: Object, required: true }
  },
  data () {
    return {
      updateColorAndNumberingStyle: true,
      localCategory: this.category
    }
  },
  computed: {
    numberingStyles () {
      return ['1', 'a', 'A', 'i', 'I'].map(i => ({
        value: i,
        text: this.$tc('entity.category.numberingStyles.' + i)
      }))
    },
    contentTypes () {
      return this.api.get().contentTypes().items.map(ct => ({
        value: ct._meta.self,
        text: this.$tc('contentNode.' + camelCase(ct.name) + '.name')
      }))
{'fraction_non_alphanumeric': 0.17518248175182483, 'fraction_numerical': 0.0012165450121654502, 'mean_word_length': 2.763157894736842, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 27, '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': '3222185', 'n_tokens_mistral': 1080, 'n_tokens_neox': 1057, 'n_words': 178}