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-02-03 08:45:45 -05:00
|
|
|
<form action="{{ baseUrl("/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>
|
|
|
|
<div dropdown-toggle>{{ $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>
|
|
|
|
<div class="list-sort-dir" data-sort-dir>
|
2019-05-05 09:43:26 -04:00
|
|
|
@icon($order === 'desc' ? 'sort-up' : 'sort-down')
|
2018-12-07 13:33:32 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|