mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
f50280a889
This makes it easier to share bulk topic operations, for example from a plugin's custom topic list.
33 lines
790 B
JavaScript
33 lines
790 B
JavaScript
import showModal from 'discourse/lib/show-modal';
|
|
|
|
export default Discourse.Route.extend({
|
|
model() {
|
|
return this.modelFor('adminUser');
|
|
},
|
|
|
|
afterModel(model) {
|
|
if (this.currentUser.get('admin')) {
|
|
const self = this;
|
|
return Discourse.Group.findAll().then(function(groups){
|
|
self._availableGroups = groups.filterBy('automatic', false);
|
|
return model;
|
|
});
|
|
}
|
|
},
|
|
|
|
setupController(controller, model) {
|
|
controller.setProperties({
|
|
originalPrimaryGroupId: model.get('primary_group_id'),
|
|
availableGroups: this._availableGroups,
|
|
model
|
|
});
|
|
},
|
|
|
|
actions: {
|
|
showSuspendModal(user) {
|
|
showModal('admin_suspend_user', user);
|
|
this.controllerFor('modal').set('modalClass', 'suspend-user-modal');
|
|
}
|
|
}
|
|
});
|