blob: 4434df4394b4076a7835318b6df695bdce89c074 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001{% comment %}
2 Adds sorted columns to a detail table.
3 Must be preceded by <table class="table table-bordered table-hover tablesorter" id="otable">
4 Must be followed by <tbody>...</tbody></table>.
5 Requires tablecols setup column fields dclass, clclass, qhelp, orderfield.
6{% endcomment %}
7{% load projecttags %}
8{# <table class="table table-bordered table-hover tablesorter" id="otable"> #}
9 <thead>
10 <!-- Table header row; generated from "tablecols" entry in the context dict -->
11 <tr>
12 {% for tc in tablecols %}<th class="{%if tc.dclass%}{{tc.dclass}}{% endif %} {%if tc.class %}{{tc.clclass}}{% endif %}">
Patrick Williamsc0f7c042017-02-23 20:41:17 -060013 {%if tc.qhelp%}<span class="glyphicon glyphicon-question-sign get-help" title="{{tc.qhelp}}"></span>{%endif%}
14 {%if tc.orderfield%}<a {%if tc.ordericon%} class="sorted" {%endif%}href="javascript:reload_params({'page': 1, 'orderby' : '{{tc.orderfield}}' })">{{tc.name}}</a>{%else%}<span class="text-muted">{{tc.name}}</span>{%endif%}
15 {%if tc.ordericon%} <span class="icon-caret-{{tc.ordericon}}"></span>{%endif%}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050016 {% if request.GET.search and forloop.first %}
17 <span class="badge badge-info">{{objects.paginator.count}}</span>
18 {% endif %}
19 {%if tc.filter%}<div class="btn-group pull-right">
Patrick Williamsc0f7c042017-02-23 20:41:17 -060020 <a href="#filter_{{tc.filter.class}}" role="button" class="btn btn-mini {%if request.GET.filter%}{{tc.filter.options|filtered_icon:request.GET.filter}} {%endif%}" {%if request.GET.filter and tc.filter.options|filtered_tooltip:request.GET.filter %} title="<p>{{tc.filter.options|filtered_tooltip:request.GET.filter}}</p><p><a class='btn btn-sm btn-primary' href=javascript:reload_params({'filter':''})>Show all {% if filter_search_display %}{{filter_search_display}}{% else %}{{objectname}}{% endif %}</a></p>" {%endif%} data-toggle="modal"> <i class="glyphicon glyphicon-filter filtered"></i> </a>
Patrick Williamsc124f4f2015-09-15 14:41:29 -050021 </div>{%endif%}
22 </th>{% endfor %}
23 </tr>
24 </thead>
25