mirror of
https://github.com/wallabag/wallabag.git
synced 2025-10-10 19:32:07 +00:00
Support sorting by reading time and URL in filter view
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
parent
7e8a3c432f
commit
5981cfb8b8
3 changed files with 5 additions and 1 deletions
|
@ -633,7 +633,7 @@ class EntryController extends AbstractController
|
|||
if (null !== $request->get('entry_filter') && null !== $request->get('entry_filter')['sortType'] && '' !== $request->get('entry_filter')['sortType']) {
|
||||
$direction = (null !== $request->get('entry_filter')['sortOrder'] && \in_array($request->get('entry_filter')['sortOrder'], ['asc', 'desc'], true)) ? $request->get('entry_filter')['sortOrder'] : 'desc';
|
||||
|
||||
if (\in_array($request->get('entry_filter')['sortType'], ['id','title','createdAt'], true)) {
|
||||
if (\in_array($request->get('entry_filter')['sortType'], ['id','title','createdAt', 'url', 'readingTime'], true)) {
|
||||
$sortBy = $request->get('entry_filter')['sortType'];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -218,6 +218,8 @@ class EntryFilterType extends AbstractType
|
|||
'choices' => [
|
||||
'entry.sort.by.creation_date' => 'createdAt',
|
||||
'entry.sort.by.title' => 'title',
|
||||
'entry.sort.by.url' => 'url',
|
||||
'entry.sort.by.reading_time' => 'readingTime',
|
||||
],
|
||||
'label' => 'entry.sort.status_label',
|
||||
])
|
||||
|
|
|
@ -243,6 +243,8 @@ entry:
|
|||
by:
|
||||
creation_date: Creation date
|
||||
title: Title
|
||||
url: URL
|
||||
reading_time: Reading time
|
||||
ascending: Ascending
|
||||
descending: Descending
|
||||
list:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue