-
Notifications
You must be signed in to change notification settings - Fork 21
/
base_data_table.html
executable file
·186 lines (179 loc) · 10.4 KB
/
base_data_table.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
{% load i18n staticfiles arctic_tags arctic_pagination_tags %}
<div class="row">
{% block tool_links %}
<div class="col-auto form-group">
{% for link in tool_links %}
{% if forloop.counter0 < tool_links_collapse %}
<a class="btn btn-{{ link.style }}" title="{{ link.label }}" href="{{ link.url }}" id="{{ link.id }}"
{% include 'arctic/partials/modal_attributes.html' with modal=link.modal %}
>{% if link.icon %}<i title="{{ link.label }}" class="fa {{ link.icon }}"></i>{% else %}{{ link.label }}{% endif %}</a>
{% else %}
{% if forloop.counter0 == tool_links_collapse %}
<span class="dropdown">
<button class="btn btn-secondary" type="button" data-toggle="dropdown" id="tool-links-dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa {{ tool_links_icon }}"></i>
</button>
<div class="dropdown-menu" aria-labelledby="tool_links_dropdown">
{% endif %}
<a class="dropdown-item" href="{{ link.url }}"
{% include 'arctic/partials/modal_attributes.html' with modal=link.modal %}
>{{ link.label }}</a>
{% if forloop.last %}
</div>
</span>
{% endif %}
{% endif %}
{% endfor %}
</div>
{% endblock %}
<div class="col">
{% if not sorting_url %}
{% if simple_search_form or advanced_search_form %}
<form action="" method="GET" class="search-form">
{% block search_form %}
<div id="arctic_search_form" class="form-group simple-search {% if simple_search_form.errors or advanced_search_form.errors %} invalid-form-field {% endif %}">
{% for field in simple_search_form %}
{{ field }}
{% endfor %}
{% if advanced_search_form %}
{% block advanced_search_form %}
<a id="arctic_toggle_advanced_search_form_button" data-popover-container=".advanced-form-popover" class="btn btn-secondary arctic_toggle_form_button">
<i class="fa fa-sliders"></i>
</a>
<div class="popover bs-popover-bottom advanced-form-popover hide" x-placement="bottom">
<div class="arrow"></div>
<div class="popover-body">
<div class="artic_toggle_form hidden" id="arctic_advanced_search" >
{% include "arctic/partials/form_fields.html" with form=advanced_search_form %}
<div class="form-block pull-right">
<input type="reset" value="{% trans 'Clear' %}" class="btn btn-secondary" onClick='location.href = location.pathname'>
<input type="submit" value="{% trans 'Search' %}" class="btn btn-primary">
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% endif %}
</div>
{% endblock %}
</form>
{% endif %}
{% endif %}
</div>
</div>
{% block top_pagination %}
{% endblock %}
{% block table %}
<div class="row">
{# data table #}
{% if list_items %}
<div class="col-sm-12 col">
<div class="arctic-card">
{% if list_summary %}
<div class="arctic-card__header">
<h4 class="arctic-card__title">
{{ page_title }}
</h4>
</div>
{% endif %}
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
{% if sorting_url %}
<th class="drag-cell"> </th>
{% endif %}
{% for item in list_header %}
<th>
{% if item.order_url %}
<a href="{{ item.order_url }}">{{ item.label }}
{% if item.order_direction == 'desc' %}
<i class="fa fa-sort-desc"></i>
{% elif item.order_direction == 'asc' %}
<i class="fa fa-sort-asc"></i>
{% else %}
<i class="fa fa-sort show-on-hover"></i>
{% endif %}</a>
{% else %}
{{ item.label }}
{% endif %}
{% block extra_table_header_data %}{% endblock %}
</th>
{% endfor %}
{% if list_items.0.actions %}
<th> </th>
{% endif %}
</tr>
</thead>
<tbody {% if list_items.0.sorting_field %}data-sorting-url="{{ sorting_url }}"{% endif %}>
{% for row in list_items %}
<tr {% if row.id %} data-id="{{ row.id }}" {% endif %}>
{% if row.sorting_field %}
<td class="drag-cell">
<div class="list-actions drag-handle show-on-hover">
<i data-sorting-key="{{ row.sorting_field.id }}" data-sorting-value="{{ column.value }}" class="fa fa-bars"></i>
</div>
</td>
{% endif %}
{% for column in row.fields %}
<td {% if column.class %}class="{{ column.class }}"{%endif%}>
{% if column.url %}
<a href="{{ column.url }}"{% if list_items.0.sorting_field %}style="display:block;"{% endif %}
{% include 'arctic/partials/modal_attributes.html' with modal=column.modal %}
>
{% endif %}
{% if column.value|typename != 'list' %}
{{ column.value|default_if_none:"" }}
{% else %}
{% for item in column.value %}
<span class="list-tag">{{ item }}</span>
{% endfor %}
{% endif %}
{% if column.url %}
</a>
{% endif %}
</td>
{% endfor %}
{% if row.actions %}
<td>
{% block list_actions %}
<div class="list-actions">
{% for action in row.actions %}
<a href="{{ action.url }}" class="{{ action.class }} btn btn-secondary btn-sm show-on-hover" title="{{ action.label|capfirst }}"
{% include 'arctic/partials/modal_attributes.html' with modal=action.modal %}
{% if action.attributes %}
{% for attr_name, attr_value in action.attributes.items %}
{{ attr_name }}="{{ attr_value }}"
{% endfor %}
{% endif %}
>
{% if action.icon %}
<i class="fa {{ action.icon }} fa-lg"></i>
{% else %}
{{ action.label|capfirst }}
{% endif %}
</a>
{% endfor %}
<div class="list-actions-placeholder"></div>
</div>
{% endblock %}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% block pagination %}
{% arctic_paginate page_obj paginator=paginator %}
{% endblock %}
</div>
{% else %}
<h3 class="col text-center">{% trans 'No result...' %}</h3>
{% endif %}
</div>
{% endblock %}
{% block extra_data %}{% endblock %}
{% include 'arctic/partials/modal_dialogs.html' %}