Added ability to sort posts by feature count

This commit is contained in:
rr- 2015-11-24 15:43:20 +01:00
parent 645573a272
commit d49f76c9f1
3 changed files with 15 additions and 12 deletions

View file

@ -176,6 +176,7 @@
{search: 'order:fav_date', description: 'recently added to favorites'},
{search: 'order:comment_date', description: 'recently commented'},
{search: 'order:feature_date', description: 'recently featured'},
{search: 'order:feature_count', description: 'most often featured'},
];
_.each(table, function(row) { %>
<tr>

View file

@ -14,6 +14,7 @@ class PostFilter extends BasicFilter implements IFilter
const ORDER_LAST_COMMENT_TIME = 'lastCommentCreationTime';
const ORDER_LAST_FAV_TIME = 'lastFavTime';
const ORDER_LAST_FEATURE_TIME = 'lastFeatureTime';
const ORDER_FEATURE_COUNT = 'featureCount';
const REQUIREMENT_TAG = 'tag';
const REQUIREMENT_ID = 'id';

View file

@ -128,7 +128,8 @@ class PostSearchParser extends AbstractSearchParser
[['note_count', 'notes', 'note'], PostFilter::ORDER_NOTE_COUNT],
[['fav_time', 'fav_date'], PostFilter::ORDER_LAST_FAV_TIME],
[['comment_time', 'comment_date'], PostFilter::ORDER_LAST_COMMENT_TIME],
[['feature_time', 'feature_date', 'featured', 'feature'], PostFilter::ORDER_LAST_FEATURE_TIME],
[['feature_time', 'feature_date'], PostFilter::ORDER_LAST_FEATURE_TIME],
[['feature_count', 'features', 'featured'], PostFilter::ORDER_FEATURE_COUNT],
];
}