Support for custom reasons for things being queued for approval

This commit is contained in:
Robin Ward
2015-04-28 15:06:27 -04:00
parent cf0c2d09d4
commit c2f7676370
7 changed files with 24 additions and 6 deletions

View File

@@ -228,7 +228,7 @@ export default DiscourseController.extend({
}).then(function(result) {
if (result.responseJson.action === "enqueued") {
self.send('postWasEnqueued', {pending_count: result.responseJson.pending_count });
self.send('postWasEnqueued', result.responseJson);
self.destroyDraft();
self.close();
return result;

View File

@@ -1 +1,6 @@
export default Ember.Controller.extend();
export default Ember.Controller.extend({
description: Ember.computed('model.reason', function() {
const reason = this.get('model.reason');
return reason ? I18n.t('queue_reason.' + reason + '.description') : I18n.t('queue.approval.description');
})
});

View File

@@ -38,7 +38,8 @@ const ApplicationRoute = Discourse.Route.extend({
},
postWasEnqueued(details) {
showModal('post-enqueued', {model: details, title: 'queue.approval.title' });
const title = details.reason ? 'queue_reason.' + details.reason + '.title' : 'queue.approval.title';
showModal('post-enqueued', {model: details, title });
},
composePrivateMessage(user, post) {

View File

@@ -1,5 +1,5 @@
<div class="modal-body">
<p>{{i18n "queue.approval.description"}}</p>
<p>{{{description}}}</p>
<p>{{{i18n "queue.approval.pending_posts" count=model.pending_count}}}
</div>