mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Support for custom reasons for things being queued for approval
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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');
|
||||
})
|
||||
});
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user