added some more filters, and appending event to history on flag creation

issue #5232
v1.18.x
Julian Lam 8 years ago
parent 8e1d441e20
commit 88958049eb

@ -16,6 +16,8 @@
"filter-type": "Flag Type",
"filter-type-all": "All Content",
"filter-type-post": "Post",
"filter-state": "State",
"filter-assignee": "Assignee UID",
"filter-quick-mine": "Assigned to me",
"apply-filters": "Apply Filters",

@ -13,7 +13,7 @@ define('forum/flags/list', ['components'], function (components) {
var filtersEl = components.get('flags/filters');
// Parse ajaxify data to set form values to reflect current filters
for(var filter in ajaxify.data.filters) {
for (var filter in ajaxify.data.filters) {
filtersEl.find('[name="' + filter + '"]').val(ajaxify.data.filters[filter]);
}
@ -26,7 +26,7 @@ define('forum/flags/list', ['components'], function (components) {
}).filter(Boolean).join('&');
ajaxify.go('flags?' + qs);
})
});
};
return Flags;

@ -26,7 +26,7 @@ modsController.flags.list = function (req, res, next) {
}
// Parse query string params for filters
var valid = ['reporterId', 'type', 'quick'];
var valid = ['assignee', 'state', 'reporterId', 'type', 'quick'];
var filters = valid.reduce(function (memo, cur) {
if (req.query.hasOwnProperty(cur)) {
memo[cur] = req.query[cur];

@ -60,11 +60,19 @@ Flags.list = function (filters, uid, callback) {
case 'type':
sets.push('flags:byType:' + filters[type]);
break;
case 'state':
sets.push('flags:byState:' + filters[type]);
break;
case 'reporterId':
sets.push('flags:byReporter:' + filters[type]);
break;
case 'assignee':
sets.push('flags:byAssignee:' + filters[type]);
break;
case 'quick':
switch (filters.quick) {
case 'mine':
@ -236,6 +244,7 @@ Flags.create = function (type, id, uid, reason, callback) {
return next(err);
}
Flags.appendHistory(flagId, uid, ['created']);
next(null, flagId);
});
},

Loading…
Cancel
Save