UX: simplify Dismiss menu

This commit is contained in:
Sam Saffron 2015-10-31 15:31:05 +11:00
parent 5c0fb34eee
commit 54da461024
4 changed files with 10 additions and 7 deletions

View file

@ -73,7 +73,7 @@ const controllerOpts = {
}, },
dismissReadPosts() { dismissReadPosts() {
showModal('dismiss-read', { title: 'topics.bulk.dismiss' }); showModal('dismiss-read', { title: 'topics.bulk.dismiss_read' });
} }
}, },

View file

@ -48,6 +48,11 @@ export default Discourse.Route.extend(OpenComposer, {
this.openComposer(this.controllerFor("discovery/topics")); this.openComposer(this.controllerFor("discovery/topics"));
}, },
dismissReadTopics(dismissTopics) {
var operationType = dismissTopics ? "topics" : "posts";
this.controllerFor("discovery/topics").send('dismissRead', operationType);
},
dismissRead(operationType) { dismissRead(operationType) {
this.controllerFor("discovery/topics").send('dismissRead', operationType); this.controllerFor("discovery/topics").send('dismissRead', operationType);
} }

View file

@ -1,10 +1,9 @@
<div class="modal-body"> <div class="modal-body">
<p> <p>
{{i18n 'topics.bulk.dismiss_body'}} {{preference-checkbox labelKey="topics.bulk.also_dismiss_topics" checked=dismissTopics}}
</p> </p>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button class='btn btn-primary' {{action "dismissRead" "posts"}}>{{i18n 'topics.bulk.dismiss_posts'}}</button> <button class='btn btn-primary' {{action "dismissReadTopics" dismissTopics}}>{{i18n 'topics.bulk.dismiss'}}</button>
<button class='btn btn-primary' {{action "dismissRead" "topics"}}>{{i18n 'topics.bulk.dismiss_topics'}}</button>
</div> </div>

View file

@ -1004,11 +1004,10 @@ en:
reset_read: "Reset Read" reset_read: "Reset Read"
delete: "Delete Topics" delete: "Delete Topics"
dismiss: "Dismiss" dismiss: "Dismiss"
dismiss_read: "Dismiss all unread"
dismiss_button: "Dismiss…" dismiss_button: "Dismiss…"
dismiss_tooltip: "Dismiss just new posts or stop tracking topics" dismiss_tooltip: "Dismiss just new posts or stop tracking topics"
dismiss_body: "Would you like to dismiss just the new posts in these topics, or dismiss the topics entirely?" also_dismiss_topics: "Stop tracking these topics? (Topics will no longer appear in the unread tab)"
dismiss_posts: "Dismiss Just New Posts"
dismiss_topics: "Dismiss Topics"
dismiss_new: "Dismiss New" dismiss_new: "Dismiss New"
toggle: "toggle bulk selection of topics" toggle: "toggle bulk selection of topics"
actions: "Bulk Actions" actions: "Bulk Actions"