<section class="field minimum-required-tags">
  <label for="category-minimum-tags">
    {{i18n "category.minimum_required_tags"}}
  </label>
  <TextField
    @value={{this.category.minimum_required_tags}}
    @id="category-minimum-tags"
    @type="number"
    @min="0"
  />
</section>
<section class="field allowed-tags">
  <label>{{i18n "category.tags_allowed_tags"}}</label>
  <TagChooser
    @id="category-allowed-tags"
    @tags={{this.category.allowed_tags}}
    @everyTag={{true}}
    @excludeSynonyms={{true}}
    @unlimitedTagCount={{true}}
    @onChange={{action (mut this.category.allowed_tags)}}
    @options={{hash filterPlaceholder="category.tags_placeholder"}}
  />
</section>

<section class="field allowed-tag-groups">
  <label>{{i18n "category.tags_allowed_tag_groups"}}</label>
  <TagGroupChooser
    @id="category-allowed-tag-groups"
    @tagGroups={{this.category.allowed_tag_groups}}
    @onChange={{action (mut this.category.allowed_tag_groups)}}
  />
  <LinkTo @route="tagGroups" class="manage-tag-groups">{{i18n
      "category.manage_tag_groups_link"
    }}</LinkTo>
</section>

<section class="field allow-global-tags">
  <label>
    <Input
      @type="checkbox"
      @checked={{this.category.allow_global_tags}}
      id="allow_global_tags"
      disabled={{this.disableAllowGlobalTags}}
    />
    {{i18n "category.allow_global_tags_label"}}
  </label>
</section>

<section class="field tags-tab-description">
  {{i18n "category.tags_tab_description"}}
</section>

<section class="field required-tag-group-description">
  {{i18n "category.required_tag_group.description"}}
</section>

<section class="field with-items">
  <section class="field-item required-tag-groups">
    {{#each this.category.required_tag_groups as |rtg|}}
      <div class="required-tag-group-row">
        <TextField @value={{rtg.min_count}} @type="number" @min="1" />
        <TagGroupChooser
          @tagGroups={{if rtg.name (array rtg.name) (array)}}
          @onChange={{action "onTagGroupChange" rtg}}
          @options={{hash
            maximum=1
            filterPlaceholder="category.required_tag_group.placeholder"
          }}
        />
        <DButton
          @label="category.required_tag_group.delete"
          @action={{action "deleteRequiredTagGroup" rtg}}
          @icon="trash-alt"
          @class="delete-required-tag-group"
        />
      </div>
    {{/each}}
    <DButton
      @label="category.required_tag_group.add"
      @action={{action "addRequiredTagGroup"}}
      @icon="plus"
      @class="add-required-tag-group"
    />
  </section>
</section>