fix column sorter
This commit is contained in:
parent
c818ac6935
commit
1182dcfb52
1 changed files with 15 additions and 14 deletions
|
|
@ -1,71 +1,72 @@
|
|||
<th scope="col">
|
||||
@php $colname = 'customers.email' @endphp
|
||||
@php function _genUrl($q) { return url()->current().(!empty(request()->all())?"?":"").http_build_query(array_merge(request()->query(), $q)); } @endphp
|
||||
{{ __('Email')}}
|
||||
@if(!session("crud.$modelTable.sort_way") or session("crud.$modelTable.sort_col") !== $colname or (session("crud.$modelTable.sort_way") === 'desc' and session("crud.$modelTable.sort_col") === $colname))
|
||||
<a class="col_sort text-secondary lead asc" href="{{ request()->fullUrlWithQuery(['sort_col' => $colname, 'sort_way' => 'asc', 'rst' => null]) }}"> ↓ </a>
|
||||
<a class="col_sort text-secondary lead asc" href="{{ _genUrl(['sort_col' => $colname, 'sort_way' => 'asc', 'rst' => null]) }}"> ↓ </a>
|
||||
@endif
|
||||
@if(!session("crud.$modelTable.sort_way") or session("crud.$modelTable.sort_col") !== $colname or (session("crud.$modelTable.sort_way") === 'asc' and session("crud.$modelTable.sort_col") === $colname))
|
||||
<a class="col_sort text-secondary lead desc" href="{{ request()->fullUrlWithQuery(['sort_col' => $colname, 'sort_way' => 'desc', 'rst' => null]) }}"> ↑ </a>
|
||||
<a class="col_sort text-secondary lead desc" href="{{ _genUrl(['sort_col' => $colname, 'sort_way' => 'desc', 'rst' => null]) }}"> ↑ </a>
|
||||
@endif
|
||||
</th>
|
||||
<th scope="col">
|
||||
@php $colname = 'customer_infos.lastname' @endphp
|
||||
{{ __('Nom')}}
|
||||
@if(!session("crud.$modelTable.sort_way") or session("crud.$modelTable.sort_col") !== $colname or (session("crud.$modelTable.sort_way") === 'desc' and session("crud.$modelTable.sort_col") === $colname))
|
||||
<a class="col_sort text-secondary lead asc" href="{{ request()->fullUrlWithQuery(['sort_col' => $colname, 'sort_way' => 'asc', 'rst' => null]) }}"> ↓ </a>
|
||||
<a class="col_sort text-secondary lead asc" href="{{ _genUrl(['sort_col' => $colname, 'sort_way' => 'asc', 'rst' => null]) }}"> ↓ </a>
|
||||
@endif
|
||||
@if(!session("crud.$modelTable.sort_way") or session("crud.$modelTable.sort_col") !== $colname or (session("crud.$modelTable.sort_way") === 'asc' and session("crud.$modelTable.sort_col") === $colname))
|
||||
<a class="col_sort text-secondary lead desc" href="{{ request()->fullUrlWithQuery(['sort_col' => $colname, 'sort_way' => 'desc', 'rst' => null]) }}"> ↑ </a>
|
||||
<a class="col_sort text-secondary lead desc" href="{{ _genUrl(['sort_col' => $colname, 'sort_way' => 'desc', 'rst' => null]) }}"> ↑ </a>
|
||||
@endif
|
||||
</th>
|
||||
<th scope="col">
|
||||
@php $colname = 'customer_infos.firstname' @endphp
|
||||
{{ __('Prénom')}}
|
||||
@if(!session("crud.$modelTable.sort_way") or session("crud.$modelTable.sort_col") !== $colname or (session("crud.$modelTable.sort_way") === 'desc' and session("crud.$modelTable.sort_col") === $colname))
|
||||
<a class="col_sort text-secondary lead asc" href="{{ request()->fullUrlWithQuery(['sort_col' => $colname, 'sort_way' => 'asc', 'rst' => null]) }}"> ↓ </a>
|
||||
<a class="col_sort text-secondary lead asc" href="{{ _genUrl(['sort_col' => $colname, 'sort_way' => 'asc', 'rst' => null]) }}"> ↓ </a>
|
||||
@endif
|
||||
@if(!session("crud.$modelTable.sort_way") or session("crud.$modelTable.sort_col") !== $colname or (session("crud.$modelTable.sort_way") === 'asc' and session("crud.$modelTable.sort_col") === $colname))
|
||||
<a class="col_sort text-secondary lead desc" href="{{ request()->fullUrlWithQuery(['sort_col' => $colname, 'sort_way' => 'desc', 'rst' => null]) }}"> ↑ </a>
|
||||
<a class="col_sort text-secondary lead desc" href="{{ _genUrl(['sort_col' => $colname, 'sort_way' => 'desc', 'rst' => null]) }}"> ↑ </a>
|
||||
@endif
|
||||
</th>
|
||||
<th scope="col">
|
||||
@php $colname = 'customer_infos.opt_in' @endphp
|
||||
{{ __('Opt-In')}}
|
||||
@if(!session("crud.$modelTable.sort_way") or session("crud.$modelTable.sort_col") !== $colname or (session("crud.$modelTable.sort_way") === 'desc' and session("crud.$modelTable.sort_col") === $colname))
|
||||
<a class="col_sort text-secondary lead asc" href="{{ request()->fullUrlWithQuery(['sort_col' => $colname, 'sort_way' => 'asc', 'rst' => null]) }}"> ↓ </a>
|
||||
<a class="col_sort text-secondary lead asc" href="{{ _genUrl(['sort_col' => $colname, 'sort_way' => 'asc', 'rst' => null]) }}"> ↓ </a>
|
||||
@endif
|
||||
@if(!session("crud.$modelTable.sort_way") or session("crud.$modelTable.sort_col") !== $colname or (session("crud.$modelTable.sort_way") === 'asc' and session("crud.$modelTable.sort_col") === $colname))
|
||||
<a class="col_sort text-secondary lead desc" href="{{ request()->fullUrlWithQuery(['sort_col' => $colname, 'sort_way' => 'desc', 'rst' => null]) }}"> ↑ </a>
|
||||
<a class="col_sort text-secondary lead desc" href="{{ _genUrl(['sort_col' => $colname, 'sort_way' => 'desc', 'rst' => null]) }}"> ↑ </a>
|
||||
@endif
|
||||
</th>
|
||||
<th scope="col">
|
||||
@php $colname = 'brands.name' @endphp
|
||||
{{ __('Marque')}}
|
||||
@if(!session("crud.$modelTable.sort_way") or session("crud.$modelTable.sort_col") !== $colname or (session("crud.$modelTable.sort_way") === 'desc' and session("crud.$modelTable.sort_col") === $colname))
|
||||
<a class="col_sort text-secondary lead asc" href="{{ request()->fullUrlWithQuery(['sort_col' => $colname, 'sort_way' => 'asc', 'rst' => null]) }}"> ↓ </a>
|
||||
<a class="col_sort text-secondary lead asc" href="{{ _genUrl(['sort_col' => $colname, 'sort_way' => 'asc', 'rst' => null]) }}"> ↓ </a>
|
||||
@endif
|
||||
@if(!session("crud.$modelTable.sort_way") or session("crud.$modelTable.sort_col") !== $colname or (session("crud.$modelTable.sort_way") === 'asc' and session("crud.$modelTable.sort_col") === $colname))
|
||||
<a class="col_sort text-secondary lead desc" href="{{ request()->fullUrlWithQuery(['sort_col' => $colname, 'sort_way' => 'desc', 'rst' => null]) }}"> ↑ </a>
|
||||
<a class="col_sort text-secondary lead desc" href="{{ _genUrl(['sort_col' => $colname, 'sort_way' => 'desc', 'rst' => null]) }}"> ↑ </a>
|
||||
@endif
|
||||
</th>
|
||||
<th scope="col">
|
||||
@php $colname = 'customer_logins.status' @endphp
|
||||
{{ __('Activé ?')}}
|
||||
@if(!session("crud.$modelTable.sort_way") or session("crud.$modelTable.sort_col") !== $colname or (session("crud.$modelTable.sort_way") === 'desc' and session("crud.$modelTable.sort_col") === $colname))
|
||||
<a class="col_sort text-secondary lead asc" href="{{ request()->fullUrlWithQuery(['sort_col' => $colname, 'sort_way' => 'asc', 'rst' => null]) }}"> ↓ </a>
|
||||
<a class="col_sort text-secondary lead asc" href="{{ _genUrl(['sort_col' => $colname, 'sort_way' => 'asc', 'rst' => null]) }}"> ↓ </a>
|
||||
@endif
|
||||
@if(!session("crud.$modelTable.sort_way") or session("crud.$modelTable.sort_col") !== $colname or (session("crud.$modelTable.sort_way") === 'asc' and session("crud.$modelTable.sort_col") === $colname))
|
||||
<a class="col_sort text-secondary lead desc" href="{{ request()->fullUrlWithQuery(['sort_col' => $colname, 'sort_way' => 'desc', 'rst' => null]) }}"> ↑ </a>
|
||||
<a class="col_sort text-secondary lead desc" href="{{ _genUrl(['sort_col' => $colname, 'sort_way' => 'desc', 'rst' => null]) }}"> ↑ </a>
|
||||
@endif
|
||||
</th>
|
||||
<th scope="col">
|
||||
@php $colname = 'customer_logins.last_connection' @endphp
|
||||
{{ __('Dernière connexion')}}
|
||||
@if(!session("crud.$modelTable.sort_way") or session("crud.$modelTable.sort_col") !== $colname or (session("crud.$modelTable.sort_way") === 'desc' and session("crud.$modelTable.sort_col") === $colname))
|
||||
<a class="col_sort text-secondary lead asc" href="{{ request()->fullUrlWithQuery(['sort_col' => $colname, 'sort_way' => 'asc', 'rst' => null]) }}"> ↓ </a>
|
||||
<a class="col_sort text-secondary lead asc" href="{{ _genUrl(['sort_col' => $colname, 'sort_way' => 'asc', 'rst' => null]) }}"> ↓ </a>
|
||||
@endif
|
||||
@if(!session("crud.$modelTable.sort_way") or session("crud.$modelTable.sort_col") !== $colname or (session("crud.$modelTable.sort_way") === 'asc' and session("crud.$modelTable.sort_col") === $colname))
|
||||
<a class="col_sort text-secondary lead desc" href="{{ request()->fullUrlWithQuery(['sort_col' => $colname, 'sort_way' => 'desc', 'rst' => null]) }}"> ↑ </a>
|
||||
<a class="col_sort text-secondary lead desc" href="{{ _genUrl(['sort_col' => $colname, 'sort_way' => 'desc', 'rst' => null]) }}"> ↑ </a>
|
||||
@endif
|
||||
</th>
|
||||
<th scope="col">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue