discourse/app/assets/javascripts/admin/routes/admin-flags-list.js.es6
Sam c0b277d273 REFACTOR: support booting discourse with DISCOURSE_NO_CONSTANTS
This change is discussed here: https://meta.discourse.org/t/deprecating-es6-compatibility-layer/35821

Prior to this change we were not booting correctly with DISCOURSE_NO_CONSTANTS
2015-11-21 00:14:50 +11:00

28 lines
730 B
JavaScript

import showModal from 'discourse/lib/show-modal';
import FlaggedPost from 'admin/models/flagged-post';
export default Discourse.Route.extend({
model(params) {
this.filter = params.filter;
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');
}
}
});