mirror of
https://github.com/discourse/discourse.git
synced 2026-08-26 21:27:16 -05:00
Bulk close operation
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
**/
|
||||
Discourse.TopicBulkActionsController = Ember.ArrayController.extend(Discourse.ModalFunctionality, {
|
||||
onShow: function() {
|
||||
this.set('controllers.modal.modalClass', 'topic-bulk-actions-modal');
|
||||
this.set('controllers.modal.modalClass', 'topic-bulk-actions-modal small');
|
||||
},
|
||||
|
||||
perform: function(operation) {
|
||||
@@ -30,9 +30,26 @@ Discourse.TopicBulkActionsController = Ember.ArrayController.extend(Discourse.Mo
|
||||
});
|
||||
},
|
||||
|
||||
forEachPerformed: function(operation, cb) {
|
||||
var self = this;
|
||||
this.perform(operation).then(function (topics) {
|
||||
if (topics) {
|
||||
topics.forEach(cb);
|
||||
self.send('closeModal');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
actions: {
|
||||
showChangeCategory: function() {
|
||||
this.send('changeBulkTemplate', 'modal/bulk_change_category');
|
||||
this.set('controllers.modal.modalClass', 'topic-bulk-actions-modal full');
|
||||
},
|
||||
|
||||
closeTopics: function() {
|
||||
this.forEachPerformed({type: 'close'}, function(t) {
|
||||
t.set('closed', true);
|
||||
});
|
||||
},
|
||||
|
||||
changeCategory: function() {
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
<button class='btn' {{action showChangeCategory}}>{{i18n topics.bulk.change_category}}</button>
|
||||
<button class='btn' {{action closeTopics}}>{{i18n topics.bulk.close_topics}}</button>
|
||||
|
||||
@@ -251,9 +251,9 @@
|
||||
p {
|
||||
margin-top: 0;
|
||||
}
|
||||
.modal-body {
|
||||
height: 420px;
|
||||
max-height: 420px;
|
||||
&.full .modal-body {
|
||||
height: 400px;
|
||||
max-height: 400px;
|
||||
}
|
||||
}
|
||||
.tabbed-modal {
|
||||
|
||||
Reference in New Issue
Block a user