BookStack/resources/views/entities/view-toggle.blade.php
Dan Brown 45ce7a7126
URL Handling: Removed referrer-based redirect handling
Swapped back handling to instead be pre-determined instead of being
based upon session/referrer which would cause inconsistent results when
referrer data was not available (redirect to app-loaded images/files).

To support, this adds a mechansism to provide a URL through request
data.

Also cleaned up some imports in code while making changes.
Closes #4656.
2023-12-10 12:37:21 +00:00

19 lines
784 B
PHP

<div>
<form action="{{ url("/preferences/change-view/" . $type) }}" method="POST" class="inline">
{{ csrf_field() }}
{{ method_field('patch') }}
<input type="hidden" name="_return" value="{{ url()->current() }}">
@if ($view === 'list')
<button type="submit" name="view" value="grid" class="icon-list-item text-link">
<span class="icon">@icon('grid')</span>
<span>{{ trans('common.grid_view') }}</span>
</button>
@else
<button type="submit" name="view" value="list" class="icon-list-item text-link">
<span class="icon">@icon('list')</span>
<span>{{ trans('common.list_view') }}</span>
</button>
@endif
</form>
</div>