UX: Better organization of category settings

UX: Better organization of category settings

diff --git a/app/assets/javascripts/discourse/templates/components/edit-category-settings.hbs b/app/assets/javascripts/discourse/templates/components/edit-category-settings.hbs
index 1aab620..d2783f1 100644
--- a/app/assets/javascripts/discourse/templates/components/edit-category-settings.hbs
+++ b/app/assets/javascripts/discourse/templates/components/edit-category-settings.hbs
@@ -1,209 +1,225 @@
-{{#if showPositionInput}}
-  <section class='field position-fields'>
-    <label for="category-position">
-      {{i18n 'category.position'}}
+<section>
+  <h3>{{i18n 'category.settings_sections.general'}}</h3>
+
+  {{#if showPositionInput}}
+    <section class='field position-fields'>
+      <label for="category-position">
+        {{i18n 'category.position'}}
+      </label>
+            {{text-field value=category.position id="category-position" class="position-input" type="number"}}
+    </section>
+  {{/if}}
+
+  {{#unless showPositionInput}}
+    <section class='field'>
+      {{i18n 'category.position_disabled'}}
+      <a href="{{get-url '/admin/site_settings/category/basic'}}">{{i18n 'category.position_disabled_click'}}</a>
+    </section>
+  {{/unless}}
+
+  <section class="field">
+    <label for="category-number-featured-topics">
+      {{#if category.parent_category_id}}
+        {{i18n "category.subcategory_num_featured_topics"}}
+      {{else}}
+        {{i18n "category.num_featured_topics"}}
+      {{/if}}
     </label>
-          {{text-field value=category.position id="category-position" class="position-input" type="number"}}
+        {{text-field value=category.num_featured_topics id="category-number-featured-topics" type="number"}}
+  </section>
 
+  <section class="field">
+    <label for="category-search-priority">
+      {{i18n "category.search_priority.label"}}
+    </label>
+    <div class="controls">
+    {{combo-box valueAttribute="value"
+        id="category-search-priority"
+        content=searchPrioritiesOptions
+        value=category.search_priority}}
+    </div>
   </section>
-{{/if}}
 
-{{#unless showPositionInput}}
   <section class='field'>
-    {{i18n 'category.position_disabled'}}
-    <a href="{{get-url '/admin/site_settings/category/basic'}}">{{i18n 'category.position_disabled_click'}}</a>
+    <label>
+      {{input type="checkbox" checked=category.allow_badges}}
+      {{i18n 'category.allow_badges_label'}}
+    </label>
   </section>
-{{/unless}}
 
-<section class='field'>
-  <div class="control-group">
-    <label for="topic-auto-close">
-      {{i18n 'topic.auto_close.label'}}
+  {{#if siteSettings.topic_featured_link_enabled}}
+    <section class='field'>
+      <div class="allowed-topic-featured-link-category">
+        <label class="checkbox-label">
+          {{input type="checkbox" checked=category.topic_featured_link_allowed}}
+          {{i18n 'category.topic_featured_link_allowed'}}
+        </label>
+      </div>
+    </section>
+  {{/if}}
+
+  <section class="field">
+    <label>
+      {{input type="checkbox" checked=category.suppress_from_latest}}
+      {{i18n "category.suppress_from_latest"}}
     </label>
-          {{text-field value=category.auto_close_hours id="topic-auto-close" type="number"}}
+  </section>
 
+  <section class="field">
     <label>
-      {{input type="checkbox" checked=category.auto_close_based_on_last_post}}
-      {{i18n 'topic.auto_close.based_on_last_post'}}
+      {{input type="checkbox" checked=category.navigate_to_first_post_after_read}}
+      {{i18n "category.navigate_to_first_post_after_read"}}
     </label>
-  </div>
-</section>
+  </section>
 
-<section class='field'>
-  <label>
-    {{input type="checkbox" checked=category.allow_badges}}
-    {{i18n 'category.allow_badges_label'}}
-  </label>
-</section>
+  <section class="field">
+    <label>
+      {{input type="checkbox" checked=category.all_topics_wiki}}
+      {{i18n "category.all_topics_wiki"}}
+    </label>
+  </section>
 
-<section class="field">
-  <label>
-    {{input type="checkbox" checked=category.suppress_from_latest}}
-    {{i18n "category.suppress_from_latest"}}
-  </label>
 </section>
 
-<section class="field">
-  <label for="category-search-priority">
-    {{i18n "category.search_priority.label"}}
-  </label>
+<section>
 
-  {{combo-box valueAttribute="value"
-      id="category-search-priority"
-      content=searchPrioritiesOptions
-      value=category.search_priority}}
-</section>
+  <h3>{{i18n 'category.settings_sections.moderation'}}</h3>
 
-{{#if isParentCategory}}
-  <section class="field show-subcategory-list-field">
+  <section class="field">
     <label>
-      {{input type="checkbox" checked=category.show_subcategory_list}}
-      {{i18n "category.show_subcategory_list"}}
+      {{input type="checkbox" checked=category.custom_fields.require_topic_approval}}
+      {{i18n 'category.require_topic_approval'}}
     </label>
   </section>
-{{/if}}
 
-{{#if showSubcategoryListStyle}}
-  <section class="field subcategory-list-style-field">
-    <label for="subcategory-list-style">
-      {{i18n "category.subcategory_list_style"}}
+  <section class="field">
+    <label>
+      {{input type="checkbox" checked=category.custom_fields.require_reply_approval}}
+      {{i18n 'category.require_reply_approval'}}
     </label>
-          {{combo-box valueAttribute="value" id="subcategory-list-style" content=availableSubcategoryListStyles value=category.subcategory_list_style}}
-
   </section>
-{{/if}}
-
-<section class="field default-view-field">
-  <label for="category-default-view">
-    {{i18n "category.default_view"}}
-  </label>
-  <div class="controls">
-    {{combo-box valueAttribute="value" id="category-default-view" content=availableViews value=category.default_view}}
-  </div>
-</section>
-
-<section class="field default-top-period-field">
-  <label for="category-default-period">
-    {{i18n "category.default_top_period"}}
-  </label>
-  <div class="controls">
-    {{combo-box valueAttribute="value" id="category-default-period" content=availableTopPeriods value=category.default_top_period}}
-  </div>
-</section>
 
-<section class="field">
-  <label for="category-sort-order">
-    {{i18n "category.sort_order"}}
-  </label>
-  <div class="controls">
-  {{combo-box valueAttribute="value" content=availableSorts value=category.sort_order none="category.sort_options.default"}}
-  {{#unless isDefaultSortOrder}}
-    {{combo-box castBoolean=true valueAttribute="value" content=sortAscendingOptions value=category.sort_ascending none="category.sort_options.default"}}
-  {{/unless}}
+  <section class='field'>
+    <div class="control-group">
+      <label for="topic-auto-close">
+        {{i18n 'topic.auto_close.label'}}
+      </label>
+            {{text-field value=category.auto_close_hours id="topic-auto-close" type="number"}}
+      <label>
+        {{input type="checkbox" checked=category.auto_close_based_on_last_post}}
+        {{i18n 'topic.auto_close.based_on_last_post'}}
+      </label>
     </div>
-</section>
-
-<section class="field">
-  <label for="category-number-featured-topics">
-    {{#if category.parent_category_id}}
-      {{i18n "category.subcategory_num_featured_topics"}}
-    {{else}}
-      {{i18n "category.num_featured_topics"}}
-    {{/if}}
-  </label>
-      {{text-field value=category.num_featured_topics id="category-number-featured-topics" type="number"}}
+  </section>
 
-</section>
+  {{#if siteSettings.tagging_enabled}}
+    <section class='field minimum-required-tags'>
+      <label for="category-minimum-tags">
+        {{i18n 'category.minimum_required_tags'}}
+      </label>
+            {{text-field value=category.minimum_required_tags id="category-minimum-tags" type="number" min="0"}}
+    </section>
+  {{/if}}
 
-<section class="field">
-  <label for="category-number-daily-bump">
-    {{i18n "category.num_auto_bump_daily"}}
-  </label>
-      {{text-field value=category.custom_fields.num_auto_bump_daily id="category-number-daily-bump" type="number"}}
+  <section class="field">

[... diff too long, it was truncated ...]

GitHub sha: abd34882

2 Likes

:heart_eyes::smiling_face_with_three_hearts::relaxed:

2 Likes