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" />
13 .treegrid-expander:hover {
20 <script src="{% static 'qcg/treegrid/js/jquery.treegrid.js' %}"></script>
21 <script src="{% static 'qcg/moment/moment.min.js' %}"></script>
22 <script src="{% static 'qcg/daterangepicker/daterangepicker.js' %}"></script>
23 <script src="{% static 'qcg/cookie/jquery.cookie.min.js' %}"></script>
28 initialState: 'collapsed',
29 expanderExpandedClass: 'glyphicon glyphicon-chevron-down small',
30 expanderCollapsedClass: 'glyphicon glyphicon-chevron-right small',
31 onChange: function() {
32 $(this).find('.glyphicon-folder-open,.glyphicon-folder-close')
33 .toggleClass('glyphicon-folder-open').toggleClass('glyphicon-folder-close');
37 $('input[name="submission"],input[name="finish"]').daterangepicker({
41 'Dzisiaj': [moment(), moment()],
42 'Wczoraj': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
43 'Ostatnie 7 dni': [moment().subtract(6, 'days'), moment()],
44 'Ostatnie 30 dni': [moment().subtract(29, 'days'), moment()]
48 cancelLabel: 'Anuluj',
52 customRangeLabel: 'Zakres',
53 daysOfWeek: moment.weekdaysMin(),
54 monthNames: ['Sty', 'Lut', 'Mar', 'Kwi', 'Maj', 'Cze', 'Lip', 'Sie', 'Wrz', 'Paź', 'Lis', 'Gru'],
59 $('#select-all-columns').click(function() {
60 $('#id_columns').find('.checkbox input').prop('checked', true);
63 $('#default-columns').click(function() {
64 $('#select-all-columns').click();
65 $('#id_columns_0').prop('checked', false);
68 $('#columns-form').submit(function(e) {
71 $.cookie('columns', $(this).serialize(), {path: location.pathname});
79 <form id="simple-form" action="." role="search" class="pull-right">
80 {% get_params_as_hidden 'host' 'submission' 'finish' %}
81 <div style="display: inline-block; vertical-align: middle;">
82 <div class="input-group">
83 <input type="search" name="keywords" value="{{ filters.keywords.value|default:'' }}"
84 maxlength="500" class="form-control" placeholder="Wyszukaj frazę">
85 <span class="input-group-btn">
86 <button class="btn btn-default" type="submit" title="Szukaj">
87 <span class="glyphicon glyphicon-search"></span>
92 <div class="btn-group" data-toggle="buttons">
93 <label class="btn btn-default{% if checked_status.0 %} active{% endif %}" title="Aktywne">
94 <input name="status" value="0" type="checkbox" {% if checked_status.0 %}checked{% endif %} onchange="this.form.submit()">
95 <span class="glyphicon glyphicon-hourglass" aria-hidden="true"></span>
97 <label class="btn btn-default{% if checked_status.1 %} active{% endif %}" title="Zakończone">
98 <input name="status" value="1" type="checkbox" {% if checked_status.1 %}checked{% endif %} onchange="this.form.submit()">
99 <span class="glyphicon glyphicon-saved" aria-hidden="true"></span>
101 <label class="btn btn-default{% if checked_status.2 %} active{% endif %}" title="Niepowodzenia">
102 <input name="status" value="2" type="checkbox" {% if checked_status.2 %}checked{% endif %} onchange="this.form.submit()">
103 <span class="glyphicon glyphicon-alert" aria-hidden="true"></span>
106 <a href="#advanced" data-toggle="modal" class="btn btn-default" title="Filtry zaawansowane" style="margin-left: 4px">
107 <span class="glyphicon glyphicon-option-horizontal"></span>
109 <a href="#columns" data-toggle="modal" class="btn btn-default" title="Kolumny" style="margin-left: 4px">
110 <span class="glyphicon glyphicon-list"></span>
114 <h1 class="page-header">
115 {% block title %}Lista zadań{% endblock %}
118 {% if selected_filters %}
120 <div class="col-md-offset-1 col-md-10">
121 <a href="." class="pull-right"><span class="text-muted small">Wyczyść wszystkie filtry</span></a>
122 <strong>Wybrane filtry:</strong>
123 {% for label, param, val in selected_filters %}
124 <span class="label label-primary">{{ label }} <a href="{% query_string param-=val %}" style="color: white"><span class="glyphicon glyphicon-remove"></span></a></span>
132 <nav class="text-center" style="margin-bottom: 15px">
133 <form action="." method="get" class="form-inline" role="form" style="display: inline-block">
134 <div class="input-group input-group-sm">
135 <span class="input-group-btn">
136 {% if page.has_previous %}
137 <a href="{% query_string "page"=page.previous_page_number %}" class="btn btn-default">
139 <a href="#" class="btn btn-default disabled">
141 <span class="glyphicon glyphicon-chevron-left"></span>
144 <label class="sr-only" for="page">Strona</label>
145 <input type="text" class="form-control text-center" id="page" name="page" value="{{ page.number }}" style="width: 50px">
146 <span class="input-group-btn">
147 {% if page.has_next %}
148 <a href="{% query_string "page"=page.next_page_number %}" class="btn btn-default">
150 <a href="#" class="btn btn-default disabled">
152 <span class="glyphicon glyphicon-chevron-right"></span>
158 <a href="{% query_string "page"=num_pages %}">{{ num_pages }}</a>
161 <table class="table table-hover tree">
164 <th{% if columns.JOB_ID not in displayed %} style="width: 80px"{% endif %}></th>
165 {% if columns.DESCRIPTION in displayed %}<th>Opis</th>{% endif %}
166 {% if columns.SUBMISSION in displayed %}<th>Wysłane</th>{% endif %}
167 {% if columns.START in displayed %}<th>Start</th>{% endif %}
168 {% if columns.END in displayed %}<th>Koniec</th>{% endif %}
169 {% if columns.STATUS in displayed %}<th>Status</th>{% endif %}
170 {% if columns.HOST in displayed %}<th>Host</th>{% endif %}
176 {% regroup page by job as jobs %}
178 {% for job in jobs %}
179 {% ifequal job.list|length 1 %}
180 {% with job.list.0 as task %}
181 <tr class="treegrid-{{ forloop.counter }}">
183 <a href="{{ task.get_absolute_url }}">
184 <span class="glyphicon glyphicon-file" aria-hidden="true"></span>
185 {% if columns.JOB_ID in displayed %}{{ task }}{% endif %}
188 {% if columns.DESCRIPTION in displayed %}<td>{{ task.note }}</td>{% endif %}
189 {% if columns.SUBMISSION in displayed %}<td>{{ task.submission_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>{% endif %}
190 {% if columns.START in displayed %}<td>{{ task.start_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>{% endif %}
191 {% if columns.END in displayed %}<td>{{ task.finish_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>{% endif %}
192 {% if columns.STATUS in displayed %}<td>{{ task.get_status_display }}</td>{% endif %}
193 {% if columns.HOST in displayed %}<td>{{ task.short_host_names|join:', ' }}</td>{% endif %}
194 <td><a href="{{ task.get_absolute_url }}">szczegóły ›</a></td>
198 <tr class="treegrid-{{ forloop.counter }}">
200 <a href="{{ job.grouper.get_absolute_url }}">
201 <span class="glyphicon glyphicon-folder-close" aria-hidden="true"></span>
202 {% if columns.JOB_ID in displayed %}{{ job.grouper }}{% endif %}
205 {% if columns.DESCRIPTION in displayed %}<td>{{ job.grouper.note }}</td>{% endif %}
206 {% if columns.SUBMISSION in displayed %}<td>{{ job.grouper.submission_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>{% endif %}
207 {% if columns.START in displayed %}<td>-</td>{% endif %}
208 {% if columns.END in displayed %}<td>{{ job.grouper.finish_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>{% endif %}
209 {% if columns.STATUS in displayed %}<td>{{ job.grouper.get_status_display }}</td>{% endif %}
210 {% if columns.HOST in displayed %}<td>-</td>{% endif %}
211 <td><a href="{{ job.grouper.get_absolute_url }}">szczegóły ›</a></td>
214 {% for task in job.list %}
215 <tr class="treegrid-{{ forloop.parentloop.counter }}-{{ forloop.counter }} treegrid-parent-{{ forloop.parentloop.counter }}">
217 <a href="{{ task.get_absolute_url }}">
218 <span class="glyphicon glyphicon-file" aria-hidden="true"></span>
219 {% if columns.JOB_ID in displayed %}{{ task }}{% endif %}
222 {% if columns.DESCRIPTION in displayed %}<td>{{ task.note }}</td>{% endif %}
223 {% if columns.SUBMISSION in displayed %}<td>{{ task.submission_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>{% endif %}
224 {% if columns.START in displayed %}<td>{{ task.start_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>{% endif %}
225 {% if columns.END in displayed %}<td>{{ task.finish_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>{% endif %}
226 {% if columns.STATUS in displayed %}<td>{{ task.get_status_display }}</td>{% endif %}
227 {% if columns.HOST in displayed %}<td>{{ task.short_host_names|join:', ' }}</td>{% endif %}
228 <td><a href="{{ task.get_absolute_url }}">szczegóły ›</a></td>
237 <div class="alert alert-info">
238 <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
239 Brak zadań spełniających wybrane kryteria
243 <nav class="text-center">
244 <ul class="pagination">
245 {% if page.has_previous %}
247 <a href="{% query_string "page"=page.previous_page_number %}" aria-label="Previous">
248 <span aria-hidden="true"><span class="glyphicon glyphicon-chevron-left"></span> poprzednia</span>
253 <li{% ifequal page.number 1 %} class="active"{% endifequal %}>
254 <a href="{% query_string "page"=1 %}">1</a>
257 {% if pages_range.0 > 2 %}
258 <li class="disabled"><span aria-hidden="true"><strong>…</strong></span></li>
261 {% for num in pages_range %}
262 <li{% ifequal page.number num %} class="active"{% endifequal %}>
263 <a href="{% query_string "page"=num %}">{{ num }}</a>
267 <li class="disabled"><span aria-hidden="true"><strong>z</strong></span></li>
268 <li><a href="{% query_string "page"=num_pages %}">{{ num_pages }}</a></li>
270 {% if page.has_next %}
272 <a href="{% query_string "page"=page.next_page_number %}" aria-label="Next">
273 <span aria-hidden="true">następna <span class="glyphicon glyphicon-chevron-right"></span></span>
281 <div class="modal fade" id="advanced" tabindex="-1" role="dialog" aria-labelledby="modal-label" aria-hidden="true">
282 <div class="modal-dialog modal-lg">
283 <div class="modal-content">
284 <div class="modal-header">
285 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
286 <h4 class="modal-title" id="modal-label">Filtry zaawansowane</h4>
288 <div class="modal-body">
289 <form id="advanced-form" action="." class="form-horizontal">
290 {% bootstrap_field filters.keywords layout='horizontal' bound_css_class=' ' %}
291 <div class="form-group">
292 <label class="col-sm-3 col-md-4 control-label">Status</label>
293 <div class="col-sm-9 col-md-6">
294 <div class="btn-group" data-toggle="buttons">
295 {% for choice in filters.status %}
296 <label class="btn btn-default{% if choice.is_checked %} active{% endif %}">
297 <input type="checkbox" name="{{ choice.name }}" value="{{ choice.choice_value }}"
298 {% if choice.is_checked %}checked{% endif %}> {{ choice.choice_label }}
305 <div class="form-group">
306 <label class="col-sm-3 col-md-4 control-label">Host</label>
307 <div class="col-sm-9 col-md-6">
308 <div class="btn-group" data-toggle="buttons">
309 {% for choice in filters.host %}
310 <label class="btn btn-default{% if choice.is_checked %} active{% endif %}">
311 <input type="checkbox" name="{{ choice.name }}" value="{{ choice.choice_value }}"
312 {% if choice.is_checked %}checked{% endif %}> {{ choice.choice_label }}
318 {% bootstrap_field filters.submission layout='horizontal' bound_css_class=' ' %}
319 {% bootstrap_field filters.finish layout='horizontal' bound_css_class=' ' %}
322 <div class="modal-footer">
323 <button type="button" class="btn btn-default" data-dismiss="modal">Anuluj</button>
324 <a href="." class="btn btn-warning">Wyczyść filtry</a>
325 <button type="submit" class="btn btn-primary" form="advanced-form">Filtruj</button>
331 {# Column selection modal #}
332 <div class="modal fade" id="columns" tabindex="-1" role="dialog" aria-labelledby="modal-label" aria-hidden="true">
333 <div class="modal-dialog">
334 <div class="modal-content">
335 <div class="modal-header">
336 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
337 <h4 class="modal-title" id="modal-label">Wybór kolumn</h4>
339 <div class="modal-body">
340 <form id="columns-form" action=".">
341 {% bootstrap_field columns.columns %}
344 <div class="modal-footer">
345 <button type="button" class="btn btn-default" data-dismiss="modal">Anuluj</button>
346 <a id="select-all-columns" class="btn btn-success">Wybierz wszystkie</a>
347 <a id="default-columns" class="btn btn-warning">Domyślne</a>
348 <button type="submit" class="btn btn-primary" form="columns-form">Zapisz</button>
354 {% endblock container %}