FEATURE: Dismiss unread / new at top if more than 30.

This commit is contained in:
Sam 2014-07-29 14:12:41 +10:00
parent 1c25f00615
commit 7c83823a95
2 changed files with 20 additions and 0 deletions

View File

@ -108,6 +108,12 @@ export default Discourse.DiscoveryController.extend({
return this.get('filter') === 'new' && this.get('topics.length') > 0;
}.property('filter', 'topics.length'),
showDismissAtTop: function() {
return (this.get('filter') === 'new' ||
this.get('filter') === 'unread') &&
this.get('topics.length') >= 30;
}.property('filter', 'topics.length'),
canBulkSelect: Em.computed.alias('currentUser.staff'),
hasTopics: Em.computed.gt('topics.length', 0),
showTable: Em.computed.or('hasTopics', 'topicTrackingState.hasIncoming'),

View File

@ -1,3 +1,15 @@
{{#if showDismissAtTop}}
<div>
{{#if showDismissRead}}
<button class='btn dismiss-read' {{action dismissRead}}>{{i18n topics.bulk.dismiss_read}}</button>
{{/if}}
{{#if showResetNew}}
<button class='btn dismiss-read' {{action resetNew}}>{{i18n topics.bulk.dismiss_new}}</button>
{{/if}}
</div>
{{/if}}
{{#if selected}}
<div id='bulk-select'>
<button class='btn no-text' {{action showBulkActions}}><i class="fa fa-wrench"></i></button>
@ -24,6 +36,8 @@
{{/if}}
{{#sortable-heading sortBy="default" action="changeSort" order=order ascending=ascending}}
{{i18n topic.title}}
{{/sortable-heading}}
{{#unless controller.hideCategory}}
{{#sortable-heading sortBy="category" action="changeSort" order=order ascending=ascending}}