2015-03-10 15:01:15 -04:00
|
|
|
import showModal from 'discourse/lib/show-modal';
|
|
|
|
|
2014-11-11 15:48:13 -05:00
|
|
|
export default Discourse.Route.extend({
|
2015-03-10 15:01:15 -04:00
|
|
|
model(params) {
|
2014-11-11 15:48:13 -05:00
|
|
|
this.filter = params.filter;
|
|
|
|
return Discourse.FlaggedPost.findAll(params.filter);
|
|
|
|
},
|
|
|
|
|
2015-03-10 15:01:15 -04:00
|
|
|
setupController(controller, model) {
|
2014-11-11 15:48:13 -05:00
|
|
|
controller.set('model', model);
|
|
|
|
controller.set('query', this.filter);
|
|
|
|
},
|
|
|
|
|
|
|
|
actions: {
|
2015-03-10 15:01:15 -04:00
|
|
|
showAgreeFlagModal(flaggedPost) {
|
2015-03-13 20:18:05 -04:00
|
|
|
showModal('modals/admin-agree-flag', flaggedPost);
|
2014-11-11 15:48:13 -05:00
|
|
|
this.controllerFor('modal').set('modalClass', 'agree-flag-modal');
|
|
|
|
},
|
|
|
|
|
2015-03-10 15:01:15 -04:00
|
|
|
showDeleteFlagModal(flaggedPost) {
|
2015-03-13 20:18:05 -04:00
|
|
|
showModal('modals/admin-delete-flag', flaggedPost);
|
2014-11-11 15:48:13 -05:00
|
|
|
this.controllerFor('modal').set('modalClass', 'delete-flag-modal');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|