mirror of
https://github.com/discourse/discourse.git
synced 2025-06-20 07:21:37 +08:00
UX: indicate active tag sorting method
This commit is contained in:
@ -2,6 +2,8 @@ import computed from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
sortProperties: ['count:desc', 'id'],
|
||||
sortedByCount: true,
|
||||
sortedByName: false,
|
||||
|
||||
canAdminTags: Ember.computed.alias("currentUser.staff"),
|
||||
groupedByCategory: Ember.computed.notEmpty('model.extras.categories'),
|
||||
@ -18,11 +20,19 @@ export default Ember.Controller.extend({
|
||||
|
||||
actions: {
|
||||
sortByCount() {
|
||||
this.set('sortProperties', ['count:desc', 'id']);
|
||||
this.setProperties({
|
||||
sortProperties: ['count:desc', 'id'],
|
||||
sortedByCount: true,
|
||||
sortedByName: false
|
||||
});
|
||||
},
|
||||
|
||||
sortById() {
|
||||
this.set('sortProperties', ['id']);
|
||||
this.setProperties({
|
||||
sortProperties: ['id'],
|
||||
sortedByCount: false,
|
||||
sortedByName: true
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -1,14 +1,24 @@
|
||||
export default Ember.Controller.extend({
|
||||
sortProperties: ['count:desc', 'id'],
|
||||
tagsForUser: null,
|
||||
sortedByCount: true,
|
||||
sortedByName: false,
|
||||
|
||||
actions: {
|
||||
sortByCount() {
|
||||
this.set('sortProperties', ['count:desc', 'id']);
|
||||
this.setProperties({
|
||||
sortProperties: ['count:desc', 'id'],
|
||||
sortedByCount: true,
|
||||
sortedByName: false
|
||||
});
|
||||
},
|
||||
|
||||
sortById() {
|
||||
this.set('sortProperties', ['id']);
|
||||
this.setProperties({
|
||||
sortProperties: ['id'],
|
||||
sortedByCount: false,
|
||||
sortedByName: true
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -13,8 +13,8 @@
|
||||
|
||||
<div class='tag-sort-options'>
|
||||
{{i18n "tagging.sort_by"}}
|
||||
<a {{action "sortByCount"}}>{{i18n "tagging.sort_by_count"}}</a>
|
||||
<a {{action "sortById"}}>{{i18n "tagging.sort_by_name"}}</a>
|
||||
<span class="tag-sort-count {{if sortedByCount 'active'}}"><a {{action "sortByCount"}}>{{i18n "tagging.sort_by_count"}}</a></span>
|
||||
<span class="tag-sort-name {{if sortedByName 'active'}}"><a {{action "sortById"}}>{{i18n "tagging.sort_by_name"}}</a></span>
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
|
@ -6,8 +6,8 @@
|
||||
|
||||
<div class='tag-sort-options'>
|
||||
{{i18n "tagging.sort_by"}}
|
||||
<a {{action "sortByCount"}}>{{i18n "tagging.sort_by_count"}}</a>
|
||||
<a {{action "sortById"}}>{{i18n "tagging.sort_by_name"}}</a>
|
||||
<span class="tag-sort-count {{if sortedByCount 'active'}}"><a {{action "sortByCount"}}>{{i18n "tagging.sort_by_count"}}</a></span>
|
||||
<span class="tag-sort-name {{if sortedByName 'active'}}"><a {{action "sortById"}}>{{i18n "tagging.sort_by_name"}}</a></span>
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
|
@ -206,6 +206,9 @@ header .discourse-tag {color: $tag-color }
|
||||
a {
|
||||
text-decoration: underline;
|
||||
}
|
||||
span.active a {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.autocomplete {
|
||||
|
Reference in New Issue
Block a user