discourse/app/assets/javascripts/admin/routes/admin-flags-list.js.es6
Régis Hanol 424a3b042a FEATURE: unified UI for pinning/banner topics
REFACTOR: ES6ified all the modals
2015-03-14 01:18:05 +01:00

27 lines
703 B
JavaScript

import showModal from 'discourse/lib/show-modal';
export default Discourse.Route.extend({
model(params) {
this.filter = params.filter;
return Discourse.FlaggedPost.findAll(params.filter);
},
setupController(controller, model) {
controller.set('model', model);
controller.set('query', this.filter);
},
actions: {
showAgreeFlagModal(flaggedPost) {
showModal('modals/admin-agree-flag', flaggedPost);
this.controllerFor('modal').set('modalClass', 'agree-flag-modal');
},
showDeleteFlagModal(flaggedPost) {
showModal('modals/admin-delete-flag', flaggedPost);
this.controllerFor('modal').set('modalClass', 'delete-flag-modal');
}
}
});