mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Column headers now link to sort/desc sort - refs #189
This commit is contained in:
parent
9f2ec39fbc
commit
747a801b50
3 changed files with 50 additions and 14 deletions
|
|
@ -1,7 +1,19 @@
|
|||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
{% for column in display_columns %}<th scope="col">{{ column }}</th>{% endfor %}
|
||||
{% for i, column in enumerate(display_columns) %}
|
||||
<th scope="col">
|
||||
{% if i == 0 or disable_sort %}
|
||||
{{ column }}
|
||||
{% else %}
|
||||
{% if column == sort %}
|
||||
<a href="{{ path_with_added_args(request, {'_sort_desc': column, '_sort': None, '_next': None}) }}" rel="nofollow">{{ column }} ▼</a>
|
||||
{% else %}
|
||||
<a href="{{ path_with_added_args(request, {'_sort': column, '_sort_desc': None, '_next': None}) }}" rel="nofollow">{{ column }}{% if column == sort_desc %} ▲{% endif %}</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue