UX: Better organization of category settings

This commit is contained in:
Kris
2019-04-10 23:00:31 -04:00
parent be59c1559d
commit abd34882d5
3 changed files with 239 additions and 210 deletions

View File

@@ -1,209 +1,225 @@
{{#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>
<h3>{{i18n 'category.settings_sections.general'}}</h3>
</section>
{{/if}}
{{#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'>
<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>
{{input type="checkbox" checked=category.allow_badges}}
{{i18n 'category.allow_badges_label'}}
</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>
{{combo-box valueAttribute="value"
id="category-search-priority"
content=searchPrioritiesOptions
value=category.search_priority}}
</section>
{{#if isParentCategory}}
<section class="field show-subcategory-list-field">
<label>
{{input type="checkbox" checked=category.show_subcategory_list}}
{{i18n "category.show_subcategory_list"}}
</label>
</section>
{{/if}}
{{#if showSubcategoryListStyle}}
<section class="field subcategory-list-style-field">
<label for="subcategory-list-style">
{{i18n "category.subcategory_list_style"}}
</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 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}}
</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 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>
<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.navigate_to_first_post_after_read}}
{{i18n "category.navigate_to_first_post_after_read"}}
</label>
</section>
{{#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}}
{{#if emailInEnabled}}
<section class='field'>
<label>
{{input type="checkbox" checked=category.email_in_allow_strangers}}
{{i18n 'category.email_in_allow_strangers'}}
</label>
</section>
<section class='field'>
<label for="category-email-in">
{{d-icon "far-envelope"}}
{{i18n 'category.email_in'}}
</label>
{{text-field id="category-email-in" class="email-in" value=category.email_in}}
</section>
<section class='field'>
<label>
{{input type="checkbox" checked=category.mailinglist_mirror}}
{{i18n 'category.mailinglist_mirror'}}
</label>
</section>
{{plugin-outlet name="category-email-in" args=(hash category=category)}}
{{/if}}
{{#if siteSettings.tagging_enabled}}
<section class='field minimum-required-tags'>
<label for="category-minimum-tags">
{{i18n 'category.minimum_required_tags'}}
<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.minimum_required_tags id="category-minimum-tags" type="number" min="0"}}
{{text-field value=category.num_featured_topics id="category-number-featured-topics" type="number"}}
</section>
{{/if}}
<section class="field">
<label>
{{input type="checkbox" checked=category.custom_fields.require_topic_approval}}
{{i18n 'category.require_topic_approval'}}
</label>
</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>
<section class="field">
<label>
{{input type="checkbox" checked=category.custom_fields.require_reply_approval}}
{{i18n 'category.require_reply_approval'}}
</label>
</section>
{{plugin-outlet name="category-custom-settings" args=(hash category=category)}}
{{#unless emailInEnabled}}
<section class='field'>
{{i18n 'category.email_in_disabled'}}
<a href="{{get-url '/admin/site_settings/category/email'}}">{{i18n 'category.email_in_disabled_click'}}</a>
<label>
{{input type="checkbox" checked=category.allow_badges}}
{{i18n 'category.allow_badges_label'}}
</label>
</section>
{{/unless}}
{{#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>
</section>
<section class="field">
<label>
{{input type="checkbox" checked=category.navigate_to_first_post_after_read}}
{{i18n "category.navigate_to_first_post_after_read"}}
</label>
</section>
<section class="field">
<label>
{{input type="checkbox" checked=category.all_topics_wiki}}
{{i18n "category.all_topics_wiki"}}
</label>
</section>
</section>
<section>
<h3>{{i18n 'category.settings_sections.moderation'}}</h3>
<section class="field">
<label>
{{input type="checkbox" checked=category.custom_fields.require_topic_approval}}
{{i18n 'category.require_topic_approval'}}
</label>
</section>
<section class="field">
<label>
{{input type="checkbox" checked=category.custom_fields.require_reply_approval}}
{{i18n 'category.require_reply_approval'}}
</label>
</section>
<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>
{{#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>
</section>
<section>
<h3> {{i18n "category.settings_sections.appearance"}}</h3>
<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}}
</div>
</section>
{{#if isParentCategory}}
<section class="field show-subcategory-list-field">
<label>
{{input type="checkbox" checked=category.show_subcategory_list}}
{{i18n "category.show_subcategory_list"}}
</label>
</section>
{{/if}}
{{#if showSubcategoryListStyle}}
<section class="field subcategory-list-style-field">
<label for="subcategory-list-style">
{{i18n "category.subcategory_list_style"}}
</label>
{{combo-box valueAttribute="value" id="subcategory-list-style" content=availableSubcategoryListStyles value=category.subcategory_list_style}}
</section>
{{/if}}
</section>
<section>
<h3> {{i18n "category.settings_sections.email"}}</h3>
{{#if emailInEnabled}}
<section class='field'>
<label for="category-email-in">
{{d-icon "far-envelope"}}
{{i18n 'category.email_in'}}
</label>
{{text-field id="category-email-in" class="email-in" value=category.email_in}}
</section>
<section class='field'>
<label>
{{input type="checkbox" checked=category.email_in_allow_strangers}}
{{i18n 'category.email_in_allow_strangers'}}
</label>
</section>
<section class='field'>
<label>
{{input type="checkbox" checked=category.mailinglist_mirror}}
{{i18n 'category.mailinglist_mirror'}}
</label>
</section>
{{plugin-outlet name="category-email-in" args=(hash category=category)}}
{{/if}}
{{#unless emailInEnabled}}
<section class='field'>
{{i18n 'category.email_in_disabled'}}
<a href="{{get-url '/admin/site_settings/category/email'}}">{{i18n 'category.email_in_disabled_click'}}</a>
</section>
{{/unless}}
</section>
{{plugin-outlet name="category-custom-settings" args=(hash category=category) connectorTagName="" tagName="section"}}