FEATURE: add setting to display tags by tag groups
This commit is contained in:
@@ -1,7 +1,20 @@
|
||||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
sortProperties: ['count:desc', 'id'],
|
||||
|
||||
canAdminTags: Ember.computed.alias("currentUser.staff"),
|
||||
groupedByCategory: Ember.computed.notEmpty('model.extras.categories'),
|
||||
groupedByTagGroup: Ember.computed.notEmpty('model.extras.tag_groups'),
|
||||
|
||||
@computed('groupedByCategory', 'groupedByTagGroup')
|
||||
otherTagsTitleKey(groupedByCategory, groupedByTagGroup) {
|
||||
if (!groupedByCategory && !groupedByTagGroup) {
|
||||
return 'tagging.all_tags';
|
||||
} else {
|
||||
return 'tagging.other_tags';
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
sortByCount() {
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
{{#if category}}
|
||||
{{category-title-link category=category}}
|
||||
{{/if}}
|
||||
{{#if tagGroupName}}
|
||||
<h3>{{tagGroupName}}</h3>
|
||||
{{/if}}
|
||||
{{#each sortedTags as |tag|}}
|
||||
<div class='tag-box'>
|
||||
{{#if tag.count}}
|
||||
|
||||
@@ -23,4 +23,8 @@
|
||||
{{tag-list tags=category.tags sortProperties=sortProperties categoryId=category.id}}
|
||||
{{/each}}
|
||||
|
||||
{{tag-list tags=model sortProperties=sortProperties titleKey="tagging.all_tags"}}
|
||||
{{#each model.extras.tag_groups as |tagGroup|}}
|
||||
{{tag-list tags=tagGroup.tags sortProperties=sortProperties tagGroupName=tagGroup.name}}
|
||||
{{/each}}
|
||||
|
||||
{{tag-list tags=model sortProperties=sortProperties titleKey=otherTagsTitleKey}}
|
||||
|
||||
Reference in New Issue
Block a user