2015-03-11 03:01:15 +08:00
|
|
|
import showModal from 'discourse/lib/show-modal';
|
2015-11-21 09:27:06 +08:00
|
|
|
import FlaggedPost from 'admin/models/flagged-post';
|
2015-03-11 03:01:15 +08:00
|
|
|
|
2014-11-12 04:48:13 +08:00
|
|
|
export default Discourse.Route.extend({
|
2015-03-11 03:01:15 +08:00
|
|
|
model(params) {
|
2014-11-12 04:48:13 +08:00
|
|
|
this.filter = params.filter;
|
2015-11-21 09:27:06 +08:00
|
|
|
return FlaggedPost.findAll(params.filter);
|
2014-11-12 04:48:13 +08:00
|
|
|
},
|
|
|
|
|
2015-03-11 03:01:15 +08:00
|
|
|
setupController(controller, model) {
|
2014-11-12 04:48:13 +08:00
|
|
|
controller.set('model', model);
|
|
|
|
controller.set('query', this.filter);
|
|
|
|
},
|
|
|
|
|
|
|
|
actions: {
|
2015-04-10 06:33:37 +08:00
|
|
|
showAgreeFlagModal(model) {
|
2016-11-16 06:09:55 +08:00
|
|
|
showModal('admin-agree-flag', { model, admin: true });
|
2014-11-12 04:48:13 +08:00
|
|
|
this.controllerFor('modal').set('modalClass', 'agree-flag-modal');
|
|
|
|
},
|
|
|
|
|
2015-04-10 06:33:37 +08:00
|
|
|
showDeleteFlagModal(model) {
|
2016-11-16 06:09:55 +08:00
|
|
|
showModal('admin-delete-flag', { model, admin: true });
|
2014-11-12 04:48:13 +08:00
|
|
|
this.controllerFor('modal').set('modalClass', 'delete-flag-modal');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|