2018-12-07 13:33:32 -05:00
|
|
|
<?php
|
|
|
|
$selectedSort = (isset($sort) && array_key_exists($sort, $options)) ? $sort : array_keys($options)[0];
|
|
|
|
$order = (isset($order) && in_array($order, ['asc', 'desc'])) ? $order : 'asc';
|
|
|
|
?>
|
|
|
|
<div class="list-sort-container" list-sort-control>
|
|
|
|
<div class="list-sort-label">{{ trans('common.sort') }}</div>
|
2019-08-04 09:26:39 -04:00
|
|
|
<form action="{{ url("/settings/users/{$currentUser->id}/change-sort/{$type}") }}" method="post">
|
2018-12-07 13:33:32 -05:00
|
|
|
|
|
|
|
{!! csrf_field() !!}
|
|
|
|
{!! method_field('PATCH') !!}
|
|
|
|
<input type="hidden" value="{{ $selectedSort }}" name="sort">
|
|
|
|
<input type="hidden" value="{{ $order }}" name="order">
|
|
|
|
|
|
|
|
<div class="list-sort">
|
|
|
|
<div class="list-sort-type dropdown-container" dropdown>
|
2019-08-24 13:26:28 -04:00
|
|
|
<div dropdown-toggle aria-haspopup="true" aria-expanded="false" aria-label="{{ trans('common.sort_options') }}" tabindex="0">{{ $options[$selectedSort] }}</div>
|
2019-05-05 09:43:26 -04:00
|
|
|
<ul class="dropdown-menu">
|
2018-12-07 13:33:32 -05:00
|
|
|
@foreach($options as $key => $label)
|
|
|
|
<li @if($key === $selectedSort) class="active" @endif><a href="#" data-sort-value="{{$key}}">{{ $label }}</a></li>
|
|
|
|
@endforeach
|
|
|
|
</ul>
|
|
|
|
</div>
|
2019-08-24 13:26:28 -04:00
|
|
|
<button href="#" class="list-sort-dir" type="button" data-sort-dir
|
|
|
|
aria-label="{{ trans('common.sort_direction_toggle') }} - {{ $order === 'asc' ? trans('common.sort_ascending') : trans('common.sort_descending') }}" tabindex="0">
|
2019-05-05 09:43:26 -04:00
|
|
|
@icon($order === 'desc' ? 'sort-up' : 'sort-down')
|
2019-08-24 13:26:28 -04:00
|
|
|
</button>
|
2018-12-07 13:33:32 -05:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|