discourse/app/assets/javascripts/admin/routes/admin-flags-list.js.es6

28 lines
730 B
Plaintext
Raw Normal View History

import showModal from 'discourse/lib/show-modal';
2016-04-01 05:33:25 +08:00
import FlaggedPost from 'admin/models/flagged-post';
export default Discourse.Route.extend({
model(params) {
this.filter = params.filter;
2016-04-01 05:33:25 +08:00
return FlaggedPost.findAll(params.filter);
},
setupController(controller, model) {
controller.set('model', model);
controller.set('query', this.filter);
},
actions: {
showAgreeFlagModal(model) {
showModal('modals/admin-agree-flag', { model });
this.controllerFor('modal').set('modalClass', 'agree-flag-modal');
},
showDeleteFlagModal(model) {
showModal('modals/admin-delete-flag', { model });
this.controllerFor('modal').set('modalClass', 'delete-flag-modal');
}
}
});