1 {% extends 'qcg/base.html' %}
2 {% load staticfiles bootstrap3 query_string qcg_utils %}
5 <link href="{% static 'qcg/treegrid/css/jquery.treegrid.css' %}" rel="stylesheet">
6 <link href="{% static 'qcg/daterangepicker/daterangepicker-bs3.css' %}" rel="stylesheet" />
10 <script src="{% static 'qcg/treegrid/js/jquery.treegrid.js' %}"></script>
11 <script src="{% static 'qcg/moment/moment.min.js' %}"></script>
12 <script src="{% static 'qcg/daterangepicker/daterangepicker.js' %}"></script>
13 <script src="{% static 'qcg/cookie/jquery.cookie.min.js' %}"></script>
18 initialState: 'collapsed',
19 expanderExpandedClass: 'glyphicon glyphicon-chevron-down small',
20 expanderCollapsedClass: 'glyphicon glyphicon-chevron-right small',
21 onChange: function() {
22 $(this).find('.glyphicon-folder-open,.glyphicon-folder-close')
23 .toggleClass('glyphicon-folder-open').toggleClass('glyphicon-folder-close');
27 $('input[name="submission"],input[name="finish"]').daterangepicker({
31 'Dzisiaj': [moment(), moment()],
32 'Wczoraj': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
33 'Ostatnie 7 dni': [moment().subtract(6, 'days'), moment()],
34 'Ostatnie 30 dni': [moment().subtract(29, 'days'), moment()]
38 cancelLabel: 'Anuluj',
42 customRangeLabel: 'Zakres',
43 daysOfWeek: moment.weekdaysMin(),
44 monthNames: ['Sty', 'Lut', 'Mar', 'Kwi', 'Maj', 'Cze', 'Lip', 'Sie', 'Wrz', 'Paź', 'Lis', 'Gru'],
49 $('#select-all-columns').click(function() {
50 $('#id_columns').find('.checkbox input').prop('checked', true);
53 $('#default-columns').click(function() {
54 $('#select-all-columns').click();
55 $('#id_columns_0').prop('checked', false);
58 $('#columns-form').submit(function(e) {
61 $.cookie('columns', $(this).serialize(), {path: location.pathname});
69 {% for message in messages %}
70 <div class="{{ message.tags }}">{{ message }}</div>
73 <form id="simple-form" action="." role="search" class="pull-right">
74 {% get_params_as_hidden 'host' 'submission' 'finish' %}
75 <div style="display: inline-block; vertical-align: middle;">
76 <div class="input-group">
77 <input type="search" name="keywords" value="{{ filters.keywords.value|default:'' }}"
78 maxlength="500" class="form-control" placeholder="Wyszukaj frazę">
79 <span class="input-group-btn">
80 <button class="btn btn-default" type="submit" title="Szukaj">
81 <span class="glyphicon glyphicon-search"></span>
86 <div class="btn-group" data-toggle="buttons">
87 <label class="btn btn-default{% if checked_status.0 %} active{% endif %}" title="Aktywne">
88 <input name="status" value="0" type="checkbox" {% if checked_status.0 %}checked{% endif %} onchange="this.form.submit()">
89 <span class="glyphicon glyphicon-hourglass" aria-hidden="true"></span>
91 <label class="btn btn-default{% if checked_status.1 %} active{% endif %}" title="Zakończone">
92 <input name="status" value="1" type="checkbox" {% if checked_status.1 %}checked{% endif %} onchange="this.form.submit()">
93 <span class="glyphicon glyphicon-saved" aria-hidden="true"></span>
95 <label class="btn btn-default{% if checked_status.2 %} active{% endif %}" title="Niepowodzenia">
96 <input name="status" value="2" type="checkbox" {% if checked_status.2 %}checked{% endif %} onchange="this.form.submit()">
97 <span class="glyphicon glyphicon-alert" aria-hidden="true"></span>
100 <a href="#advanced" data-toggle="modal" class="btn btn-default" title="Filtry zaawansowane" style="margin-left: 4px">
101 <span class="glyphicon glyphicon-option-horizontal"></span>
103 <a href="#columns" data-toggle="modal" class="btn btn-default" title="Kolumny" style="margin-left: 4px">
104 <span class="glyphicon glyphicon-list"></span>
108 <h1 class="page-header">
109 {% block title %}Lista zadań{% endblock %}
112 {% if selected_filters %}
114 <div class="col-md-offset-1 col-md-10">
115 <a href="." class="pull-right"><span class="text-muted small">Wyczyść wszystkie filtry</span></a>
116 <strong>Wybrane filtry:</strong>
117 {% for label, param, val in selected_filters %}
118 <span class="label label-primary">{{ label }} <a href="{% query_string param-=val %}" style="color: white"><span class="glyphicon glyphicon-remove"></span></a></span>
126 <nav class="text-center" style="margin-bottom: 15px">
127 <form action="." method="get" class="form-inline" role="form" style="display: inline-block">
128 <div class="input-group input-group-sm">
129 <span class="input-group-btn">
130 {% if page.has_previous %}
131 <a href="{% query_string "page"=page.previous_page_number %}" class="btn btn-default">
133 <a href="#" class="btn btn-default disabled">
135 <span class="glyphicon glyphicon-chevron-left"></span>
138 <label class="sr-only" for="page">Strona</label>
139 <input type="text" class="form-control text-center" id="page" name="page" value="{{ page.number }}" style="width: 50px">
140 <span class="input-group-btn">
141 {% if page.has_next %}
142 <a href="{% query_string "page"=page.next_page_number %}" class="btn btn-default">
144 <a href="#" class="btn btn-default disabled">
146 <span class="glyphicon glyphicon-chevron-right"></span>
152 <a href="{% query_string "page"=num_pages %}">{{ num_pages }}</a>
155 <table class="table table-hover tree">
158 <th{% if columns.JOB_ID not in displayed %} style="width: 80px"{% endif %}></th>
159 {% if columns.DESCRIPTION in displayed %}<th>Opis</th>{% endif %}
160 {% if columns.SUBMISSION in displayed %}<th>Wysłane</th>{% endif %}
161 {% if columns.START in displayed %}<th>Start</th>{% endif %}
162 {% if columns.END in displayed %}<th>Koniec</th>{% endif %}
163 {% if columns.STATUS in displayed %}<th>Status</th>{% endif %}
164 {% if columns.HOST in displayed %}<th>Host</th>{% endif %}
170 {% regroup page by job as jobs %}
172 {% for job in jobs %}
173 {% ifequal job.list|length 1 %}
174 {% with job.list.0 as task %}
175 <tr class="treegrid-{{ forloop.counter }}">
177 <a href="{{ task.get_absolute_url }}">
178 <span class="glyphicon glyphicon-file" aria-hidden="true"></span>
179 {% if columns.JOB_ID in displayed %}{{ task }}{% endif %}
182 {% if columns.DESCRIPTION in displayed %}<td>{{ task.note }}</td>{% endif %}
183 {% if columns.SUBMISSION in displayed %}<td>{{ task.submission_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>{% endif %}
184 {% if columns.START in displayed %}<td>{{ task.start_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>{% endif %}
185 {% if columns.END in displayed %}<td>{{ task.finish_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>{% endif %}
186 {% if columns.STATUS in displayed %}<td>{{ task.get_status_display }}</td>{% endif %}
187 {% if columns.HOST in displayed %}<td>{{ task.short_host_names|join:', ' }}</td>{% endif %}
188 <td><a href="{{ task.get_absolute_url }}">szczegóły ›</a></td>
192 <tr class="treegrid-{{ forloop.counter }}">
194 <a href="{{ job.grouper.get_absolute_url }}">
195 <span class="glyphicon glyphicon-folder-close" aria-hidden="true"></span>
196 {% if columns.JOB_ID in displayed %}{{ job.grouper }}{% endif %}
199 {% if columns.DESCRIPTION in displayed %}<td>{{ job.grouper.note }}</td>{% endif %}
200 {% if columns.SUBMISSION in displayed %}<td>{{ job.grouper.submission_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>{% endif %}
201 {% if columns.START in displayed %}<td>-</td>{% endif %}
202 {% if columns.END in displayed %}<td>{{ job.grouper.finish_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>{% endif %}
203 {% if columns.STATUS in displayed %}<td>{{ job.grouper.get_status_display }}</td>{% endif %}
204 {% if columns.HOST in displayed %}<td>-</td>{% endif %}
205 <td><a href="{{ job.grouper.get_absolute_url }}">szczegóły ›</a></td>
208 {% for task in job.list %}
209 <tr class="treegrid-{{ forloop.parentloop.counter }}-{{ forloop.counter }} treegrid-parent-{{ forloop.parentloop.counter }}">
211 <a href="{{ task.get_absolute_url }}">
212 <span class="glyphicon glyphicon-file" aria-hidden="true"></span>
213 {% if columns.JOB_ID in displayed %}{{ task }}{% endif %}
216 {% if columns.DESCRIPTION in displayed %}<td>{{ task.note }}</td>{% endif %}
217 {% if columns.SUBMISSION in displayed %}<td>{{ task.submission_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>{% endif %}
218 {% if columns.START in displayed %}<td>{{ task.start_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>{% endif %}
219 {% if columns.END in displayed %}<td>{{ task.finish_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>{% endif %}
220 {% if columns.STATUS in displayed %}<td>{{ task.get_status_display }}</td>{% endif %}
221 {% if columns.HOST in displayed %}<td>{{ task.short_host_names|join:', ' }}</td>{% endif %}
222 <td><a href="{{ task.get_absolute_url }}">szczegóły ›</a></td>
231 <div class="alert alert-info">
232 <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
233 Brak zadań spełniających wybrane kryteria
237 <nav class="text-center">
238 <ul class="pagination">
239 {% if page.has_previous %}
241 <a href="{% query_string "page"=page.previous_page_number %}" aria-label="Previous">
242 <span aria-hidden="true"><span class="glyphicon glyphicon-chevron-left"></span> poprzednia</span>
247 <li{% ifequal page.number 1 %} class="active"{% endifequal %}>
248 <a href="{% query_string "page"=1 %}">1</a>
251 {% if pages_range.0 > 2 %}
252 <li class="disabled"><span aria-hidden="true"><strong>…</strong></span></li>
255 {% for num in pages_range %}
256 <li{% ifequal page.number num %} class="active"{% endifequal %}>
257 <a href="{% query_string "page"=num %}">{{ num }}</a>
261 <li class="disabled"><span aria-hidden="true"><strong>z</strong></span></li>
262 <li><a href="{% query_string "page"=num_pages %}">{{ num_pages }}</a></li>
264 {% if page.has_next %}
266 <a href="{% query_string "page"=page.next_page_number %}" aria-label="Next">
267 <span aria-hidden="true">następna <span class="glyphicon glyphicon-chevron-right"></span></span>
275 <div class="modal fade" id="advanced" tabindex="-1" role="dialog" aria-labelledby="modal-label" aria-hidden="true">
276 <div class="modal-dialog modal-lg">
277 <div class="modal-content">
278 <div class="modal-header">
279 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
280 <h4 class="modal-title" id="modal-label">Filtry zaawansowane</h4>
282 <div class="modal-body">
283 <form id="advanced-form" action="." class="form-horizontal">
284 {% bootstrap_field filters.keywords layout='horizontal' bound_css_class=' ' %}
285 <div class="form-group">
286 <label class="col-sm-3 col-md-4 control-label">Status</label>
287 <div class="col-sm-9 col-md-6">
288 <div class="btn-group" data-toggle="buttons">
289 {% for choice in filters.status %}
290 <label class="btn btn-default{% if choice.is_checked %} active{% endif %}">
291 <input type="checkbox" name="{{ choice.name }}" value="{{ choice.choice_value }}"
292 {% if choice.is_checked %}checked{% endif %}> {{ choice.choice_label }}
299 <div class="form-group">
300 <label class="col-sm-3 col-md-4 control-label">Host</label>
301 <div class="col-sm-9 col-md-6">
302 <div class="btn-group" data-toggle="buttons">
303 {% for choice in filters.host %}
304 <label class="btn btn-default{% if choice.is_checked %} active{% endif %}">
305 <input type="checkbox" name="{{ choice.name }}" value="{{ choice.choice_value }}"
306 {% if choice.is_checked %}checked{% endif %}> {{ choice.choice_label }}
312 {% bootstrap_field filters.submission layout='horizontal' bound_css_class=' ' %}
313 {% bootstrap_field filters.finish layout='horizontal' bound_css_class=' ' %}
316 <div class="modal-footer">
317 <button type="button" class="btn btn-default" data-dismiss="modal">Anuluj</button>
318 <a href="." class="btn btn-warning">Wyczyść filtry</a>
319 <button type="submit" class="btn btn-primary" form="advanced-form">Filtruj</button>
325 {# Column selection modal #}
326 <div class="modal fade" id="columns" tabindex="-1" role="dialog" aria-labelledby="modal-label" aria-hidden="true">
327 <div class="modal-dialog">
328 <div class="modal-content">
329 <div class="modal-header">
330 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
331 <h4 class="modal-title" id="modal-label">Wybór kolumn</h4>
333 <div class="modal-body">
334 <form id="columns-form" action=".">
335 {% bootstrap_field columns.columns %}
338 <div class="modal-footer">
339 <button type="button" class="btn btn-default" data-dismiss="modal">Anuluj</button>
340 <a id="select-all-columns" class="btn btn-success">Wybierz wszystkie</a>
341 <a id="default-columns" class="btn btn-warning">Domyślne</a>
342 <button type="submit" class="btn btn-primary" form="columns-form">Zapisz</button>
348 {% endblock container %}