1
0
Fork 0

Make user table in admin sortable via table headers

new GET param for /admin/user: 'o'
value is db table to order by. values are limited by script.
invalid values are discarded.
preped with '-' to order descending.
show unicode arrows in table headers to visually indicate sorting.
This commit is contained in:
Fabrixxm 2016-05-16 14:38:00 +02:00
commit 6734aa5c28
3 changed files with 72 additions and 5 deletions

View file

@ -54,7 +54,21 @@
<thead>
<tr>
<th></th>
{{foreach $th_users as $th}}<th>{{$th}}</th>{{/foreach}}
{{foreach $th_users as $th}}
<th>
<a href="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}">
{{if $order_users == $th.1}}
{{if $order_direction_users == "+"}}
&#8595;
{{else}}
&#8593;
{{/if}}
{{else}}
&#8597;
{{/if}}
{{$th.0}}</a>
</th>
{{/foreach}}
<th></th>
<th></th>
</tr>