add category list label and state

This commit is contained in:
Arpit Jalan 2015-12-21 22:50:09 +05:30
parent 3e923c7a41
commit c87fff670d
3 changed files with 6 additions and 4 deletions

View File

@ -2,8 +2,9 @@ import { setting } from 'discourse/lib/computed';
var get = Ember.get;
export default Ember.Component.extend({
classNameBindings: ['category::no-category', 'categories:has-drop','categoryStyle'],
classNameBindings: ['category::no-category', 'categories:has-drop', 'categoryStyle'],
categoryStyle: setting('category_style'),
expanded: false,
tagName: 'li',

View File

@ -1,5 +1,5 @@
{{#if category}}
<a href {{action "expand"}} class="badge-category" style={{badgeStyle}}>
<a href {{action "expand"}} class="badge-category" style={{badgeStyle}} aria-label={{i18n 'categories.category_list'}} aria-expanded={{expanded}}>
<span class="badge-category-bg" style={{categoryColor}}></span>
{{#if category.read_restricted}}
{{fa-icon "lock"}}
@ -8,9 +8,9 @@
</a>
{{else}}
{{#if noSubcategories}}
<a href {{action "expand"}} class='badge-category home' style={{badgeStyle}}>{{i18n 'categories.no_subcategory'}}</a>
<a href {{action "expand"}} class='badge-category home' style={{badgeStyle}} aria-label={{i18n 'categories.category_list'}} aria-expanded={{expanded}}>{{i18n 'categories.no_subcategory'}}</a>
{{else}}
<a href {{action "expand"}} class='badge-category home' style={{badgeStyle}}>{{allCategoriesLabel}}</a>
<a href {{action "expand"}} class='badge-category home' style={{badgeStyle}} aria-label={{i18n 'categories.category_list'}} aria-expanded={{expanded}}>{{allCategoriesLabel}}</a>
{{/if}}
{{/if}}

View File

@ -388,6 +388,7 @@ en:
all_subcategories: "all"
no_subcategory: "none"
category: "Category"
category_list: "Display category list"
reorder:
title: "Reorder Categories"
title_long: "Reorganize the category list"