mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Aligned user preference endpoints in style and behaviour
Changes their endpoints and remove the user id from the URLs. Simplifies list changes to share a single endpoint, which aligns it to the behaviour of the existing sort preference endpoint. Also added test to ensure user preferences are deleted on user delete.
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
<div>
|
||||
<form action="{{ url("/settings/users/". user()->id ."/switch-${type}-view") }}" method="POST" class="inline">
|
||||
<form action="{{ url("/preferences/change-view/" . $type) }}" method="POST" class="inline">
|
||||
{!! csrf_field() !!}
|
||||
{!! method_field('PATCH') !!}
|
||||
<input type="hidden" value="{{ $view === 'list'? 'grid' : 'list' }}" name="view_type">
|
||||
|
||||
@if ($view === 'list')
|
||||
<button type="submit" class="icon-list-item text-primary">
|
||||
<button type="submit" name="view" value="grid" class="icon-list-item text-primary">
|
||||
<span class="icon">@icon('grid')</span>
|
||||
<span>{{ trans('common.grid_view') }}</span>
|
||||
</button>
|
||||
@else
|
||||
<button type="submit" class="icon-list-item text-primary">
|
||||
<button type="submit" name="view" value="list" class="icon-list-item text-primary">
|
||||
<span>@icon('list')</span>
|
||||
<span>{{ trans('common.list_view') }}</span>
|
||||
</button>
|
||||
|
Reference in New Issue
Block a user