blob: 74e4fb8eb01bfdabedebbc336f518c8f265cfee1 [file] [log] [blame]
{% load i18n admin_static suit_list %}
{% if result_hidden_fields %}
<div class="hiddenfields">{# DIV for HTML validation #}
{% for item in result_hidden_fields %}{{ item }}{% endfor %}
</div>
{% endif %}
{% if results %}
<div class="results">
<table id="result_list" class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
{% for header in result_headers|headers_handler:cl %}
<th scope="col" {{ header.class_attrib }}>
<div class="row">
<div class="col-xs-6">
{% if header.sortable %}
<a href="{{ header.url_primary }}">{{ header.text|capfirst }}</a>
{% else %}
<span>{{ header.text|capfirst }}</span>
{% endif %}
</div>
<div class="col-xs-6 text-right">
{% if header.sortable %}
{% if header.sort_priority > 0 %}
<span class="sortoptions">
<a href="{{ header.url_toggle }}" class="toggle {% if header.ascending %}ascending{% else %}descending{% endif %}" title="{% trans "Toggle sorting" %}">
{% if header.ascending %}
<i class="glyphicon glyphicon-chevron-up"></i>
{% else %}
<i class="glyphicon glyphicon-chevron-down"></i>
{% endif %}
</a>
<a class="sortremove" href="{{ header.url_remove }}"
title="{% trans "Remove from sorting" %}">
<i class="glyphicon glyphicon-remove"></i>
</a>
</span>
{% endif %}
{% if num_sorted_fields > 1 and header.sort_priority %}
<small>
<span class="label label-default" title="{% blocktrans with priority_number=header.sort_priority %}Sorting priority: {{ priority_number }}{% endblocktrans %}">
{{ header.sort_priority }}
</span>
</small>
{% endif %}
{% endif %}
</div>
</div>
</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for result in results|cells_handler:cl %}
{% if result.form.non_field_errors %}
<tr>
<td colspan="{{ result|length }}">{{ result.form.non_field_errors }}</td>
</tr>
{% endif %}
<tr{% result_row_attrs cl forloop.counter %}>
{% for item in result %}{{ item }}{% endfor %}</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}