2015-03-11 03:01:15 +08:00
|
|
|
import showModal from 'discourse/lib/show-modal';
|
2016-04-01 05:33:25 +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;
|
2016-04-01 05:33:25 +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) {
|
|
|
|
showModal('modals/admin-agree-flag', { model });
|
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) {
|
|
|
|
showModal('modals/admin-delete-flag', { model });
|
2014-11-12 04:48:13 +08:00
|
|
|
this.controllerFor('modal').set('modalClass', 'delete-flag-modal');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|