1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

Revised revision list to responsive layout

This commit is contained in:
Dan Brown
2022-10-31 21:26:31 +00:00
parent de807f8538
commit d4e71e431b
7 changed files with 85 additions and 50 deletions

View File

@ -28,11 +28,11 @@ class SimpleListOptions
* Create a new instance from the given request.
* Takes the item type (plural) that's used as a key for storing sort preferences.
*/
public static function fromRequest(Request $request, string $typeKey): self
public static function fromRequest(Request $request, string $typeKey, bool $sortDescDefault = false): self
{
$search = $request->get('search', '');
$sort = setting()->getForCurrentUser($typeKey . '_sort', '');
$order = setting()->getForCurrentUser($typeKey . '_sort_order', 'asc');
$order = setting()->getForCurrentUser($typeKey . '_sort_order', $sortDescDefault ? 'desc' : 'asc');
return new static($typeKey, $sort, $order, $search);
}