{{#if category.isUncategorizedCategory}}
  <p class="warning">
    {{d-icon "exclamation-triangle"}}
    {{html-safe (i18n "category.uncategorized_general_warning" settingLink=uncategorizedSiteSettingLink customizeLink=customizeTextContentLink)}}
  </p>
{{/if}}

<form>
  {{category-name-fields category=category tagName=""}}

  {{#if canSelectParentCategory}}
    <section class="field parent-category">
      <label>{{i18n "category.parent"}}</label>
      {{category-chooser
        value=category.parent_category_id
        categories=parentCategories
        allowSubCategories=true
        allowUncategorized=false
        allowRestrictedCategories=true
        onChange=(action (mut category.parent_category_id))
        options=(hash
          excludeCategoryId=category.id
          none=true
        )
      }}
    </section>
  {{/if}}

  {{#if subCategories}}
    <section class="field subcategories">
      <label>{{i18n "categories.subcategories"}}</label>
      {{#each subCategories as |s|}}
        {{category-badge s hideParent="true"}}
      {{/each}}
    </section>
  {{/if}}

  {{#if showDescription}}
    <section class="field description">
      <label>{{i18n "category.description"}}</label>
      {{#if category.description}}
        {{html-safe category.description}}
      {{else}}
        {{i18n "category.no_description"}}
      {{/if}}
      {{#if category.topic_url}}
        <br>
        {{d-button class="btn-default edit-category-description" action=(action "showCategoryTopic") icon="pencil-alt" label="category.change_in_category_topic"}}
      {{/if}}
    </section>
  {{/if}}

  <section class="field category-colors">
    {{#if noCategoryStyle}}
      <label>
        {{d-icon "exclamation-triangle"}}
        {{i18n "category.colors_disabled"}}
      </label>
    {{else}}
      <label>{{i18n "category.badge_colors"}}</label>
      <div class="category-color-editor">
        {{html-safe categoryBadgePreview}}

        <div style="margin-top: 10px;" class="input-prepend input-append">
          <span class="color-title">{{i18n "category.background_color"}}:</span>
          <div class="colorpicker-wrapper">
            <span class="add-on">#</span>{{text-field value=category.color placeholderKey="category.color_placeholder" maxlength="6"}}
            {{color-picker colors=backgroundColors usedColors=usedBackgroundColors value=category.color}}
          </div>
        </div>

        <div class="input-prepend input-append">
          <span class="color-title">{{i18n "category.foreground_color"}}:</span>
          <div class="colorpicker-wrapper edit-text-color">
            <span class="add-on">#</span>{{text-field value=category.text_color placeholderKey="category.color_placeholder" maxlength="6"}}
            {{color-picker colors=foregroundColors value=category.text_color id="edit-text-color"}}
          </div>
        </div>
      </div>
    {{/if}}
  </section>
</form>
