diff --git a/public/language/en-GB/flags.json b/public/language/en-GB/flags.json index fbe32a812e..5d9799de50 100644 --- a/public/language/en-GB/flags.json +++ b/public/language/en-GB/flags.json @@ -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", diff --git a/public/src/client/flags/list.js b/public/src/client/flags/list.js index 2994e7fcf9..a5277f98df 100644 --- a/public/src/client/flags/list.js +++ b/public/src/client/flags/list.js @@ -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; diff --git a/src/controllers/mods.js b/src/controllers/mods.js index f15b1a6b1a..512ad32222 100644 --- a/src/controllers/mods.js +++ b/src/controllers/mods.js @@ -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]; diff --git a/src/flags.js b/src/flags.js index 492e1faa43..a8bca052d1 100644 --- a/src/flags.js +++ b/src/flags.js @@ -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); }); },