datasette/datasette/templates/_rows_and_columns.html
Simon Willison 68302b6ca2
Refactored everything to use new qs instead of request
I don't like this, I think I will go back to the request object but with my
own custom request object that has a request.qs property.
2018-06-16 21:45:30 -07:00

28 lines
1.2 KiB
HTML

<table class="rows-and-columns">
<thead>
<tr>
{% for column in display_columns %}
<th class="col-{{ column.name|to_css_class }}" scope="col">
{% if not column.sortable %}
{{ column.name }}
{% else %}
{% if column.name == sort %}
<a href="{{ path_with_replaced_args(qs, {'_sort_desc': column.name, '_sort': None, '_next': None}) }}" rel="nofollow">{{ column.name }}&nbsp;</a>
{% else %}
<a href="{{ path_with_replaced_args(qs, {'_sort': column.name, '_sort_desc': None, '_next': None}) }}" rel="nofollow">{{ column.name }}{% if column.name == sort_desc %}&nbsp;▲{% endif %}</a>
{% endif %}
{% endif %}
</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for row in display_rows %}
<tr>
{% for cell in row %}
<td class="col-{{ cell.column|to_css_class }}">{{ cell.value }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>