2015-03-10 15:01:15 -04:00
|
|
|
import showModal from 'discourse/lib/show-modal';
|
2015-11-20 20:27:06 -05:00
|
|
|
import FlaggedPost from 'admin/models/flagged-post';
|
2015-03-10 15:01:15 -04:00
|
|
|
|
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;
|
2015-11-20 20:27:06 -05:00
|
|
|
return FlaggedPost.findAll(params.filter);
|
2014-11-11 15:48:13 -05:00
|
|
|
},
|
|
|
|
|
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-04-09 18:33:37 -04:00
|
|
|
showAgreeFlagModal(model) {
|
2016-11-15 17:09:55 -05:00
|
|
|
showModal('admin-agree-flag', { model, admin: true });
|
2014-11-11 15:48:13 -05:00
|
|
|
this.controllerFor('modal').set('modalClass', 'agree-flag-modal');
|
|
|
|
},
|
|
|
|
|
2015-04-09 18:33:37 -04:00
|
|
|
showDeleteFlagModal(model) {
|
2016-11-15 17:09:55 -05:00
|
|
|
showModal('admin-delete-flag', { model, admin: true });
|
2014-11-11 15:48:13 -05:00
|
|
|
this.controllerFor('modal').set('modalClass', 'delete-flag-modal');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|