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/daterangepicker/moment.min.js' %}"></script>
22 <script src="{% static 'qcg/daterangepicker/daterangepicker.js' %}"></script>
27 initialState: 'collapsed',
28 expanderExpandedClass: 'glyphicon glyphicon-chevron-down small',
29 expanderCollapsedClass: 'glyphicon glyphicon-chevron-right small',
30 onChange: function() {
31 $(this).find('.glyphicon-folder-open,.glyphicon-folder-close')
32 .toggleClass('glyphicon-folder-open').toggleClass('glyphicon-folder-close');
36 $('input[name="submission"],input[name="finish"]').daterangepicker({
40 'Dzisiaj': [moment(), moment()],
41 'Wczoraj': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
42 'Ostatnie 7 dni': [moment().subtract(6, 'days'), moment()],
43 'Ostatnie 30 dni': [moment().subtract(29, 'days'), moment()]
47 cancelLabel: 'Anuluj',
51 customRangeLabel: 'Zakres',
52 daysOfWeek: moment.weekdaysMin(),
53 monthNames: ['Sty', 'Lut', 'Mar', 'Kwi', 'Maj', 'Cze', 'Lip', 'Sie', 'Wrz', 'Paź', 'Lis', 'Gru'],
62 <form id="simple-form" action="." role="search" class="pull-right">
63 {% get_params_as_hidden 'host' 'submission' 'finish' %}
64 <div style="display: inline-block; vertical-align: middle;">
65 <div class="input-group">
66 <input type="text" name="keywords" value="{{ filters.keywords.value|default:'' }}"
67 maxlength="500" class="form-control" placeholder="Wyszukaj frazę">
68 <span class="input-group-btn">
69 <button class="btn btn-default" type="submit" title="Szukaj">
70 <span class="glyphicon glyphicon-search"></span>
75 <div class="btn-group" data-toggle="buttons">
76 <label class="btn btn-default{% if checked_status.0 %} active{% endif %}" title="Aktywne">
77 <input name="status" value="0" type="checkbox" {% if checked_status.0 %}checked{% endif %} onchange="this.form.submit()">
78 <span class="glyphicon glyphicon-hourglass" aria-hidden="true"></span>
80 <label class="btn btn-default{% if checked_status.1 %} active{% endif %}" title="Zakończone">
81 <input name="status" value="1" type="checkbox" {% if checked_status.1 %}checked{% endif %} onchange="this.form.submit()">
82 <span class="glyphicon glyphicon-saved" aria-hidden="true"></span>
84 <label class="btn btn-default{% if checked_status.2 %} active{% endif %}" title="Niepowodzenia">
85 <input name="status" value="2" type="checkbox" {% if checked_status.2 %}checked{% endif %} onchange="this.form.submit()">
86 <span class="glyphicon glyphicon-alert" aria-hidden="true"></span>
89 <a href="#advanced" data-toggle="modal" class="btn btn-default" title="Filtry zaawansowane" style="margin-left: 4px">
90 <span class="glyphicon glyphicon-option-horizontal"></span>
94 <h1 class="page-header">
95 {% block title %}Lista zadań{% endblock %}
98 {% if selected_filters %}
100 <div class="col-md-offset-1 col-md-10">
101 <a href="." class="pull-right"><span class="text-muted small">Wyczyść wszystkie filtry</span></a>
102 <strong>Wybrane filtry:</strong>
103 {% for label, param, val in selected_filters %}
104 <span class="label label-primary">{{ label }} <a href="{% query_string param-=val %}" style="color: white"><span class="glyphicon glyphicon-remove"></span></a></span>
112 <nav class="text-center" style="margin-bottom: 15px">
113 <form action="." method="get" class="form-inline" role="form" style="display: inline-block">
114 <div class="input-group input-group-sm">
115 <span class="input-group-btn">
116 {% if page.has_previous %}
117 <a href="{% query_string "page"=page.previous_page_number %}" class="btn btn-default">
119 <a href="#" class="btn btn-default disabled">
121 <span class="glyphicon glyphicon-chevron-left"></span>
124 <label class="sr-only" for="page">Strona</label>
125 <input type="text" class="form-control text-center" id="page" name="page" value="{{ page.number }}" style="width: 50px">
126 <span class="input-group-btn">
127 {% if page.has_next %}
128 <a href="{% query_string "page"=page.next_page_number %}" class="btn btn-default">
130 <a href="#" class="btn btn-default disabled">
132 <span class="glyphicon glyphicon-chevron-right"></span>
138 <a href="{% query_string "page"=num_pages %}">{{ num_pages }}</a>
141 <table class="table table-hover tree">
144 <th style="width: 80px"></th>
156 {% regroup page by job as jobs %}
158 {% for job in jobs %}
159 {% ifequal job.list|length 1 %}
160 {% with job.list.0 as task %}
161 <tr class="treegrid-{{ forloop.counter }}">
163 <a href="{{ task.get_absolute_url }}">
164 <span class="glyphicon glyphicon-file" aria-hidden="true"></span>
168 <td>{{ task.note }}</td>
169 <td>{{ task.submission_time|timesince }} temu</td>
170 <td>{{ task.start_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>
171 <td>{{ task.finish_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>
172 <td>{{ task.get_status_display }}</td>
173 <td>{{ task.short_host_names|join:', ' }}</td>
174 <td><a href="{{ task.get_absolute_url }}">szczegóły ›</a></td>
178 <tr class="treegrid-{{ forloop.counter }}">
180 <a href="{{ job.grouper.get_absolute_url }}">
181 <span class="glyphicon glyphicon-folder-close" aria-hidden="true"></span>
182 {# {{ job.grouper }}#}
185 <td>{{ job.grouper.note }}</td>
186 <td>{{ job.grouper.submission_time|timesince }} temu</td>
188 <td>{{ job.grouper.finish_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>
189 <td>{{ job.grouper.get_status_display }}</td>
191 <td><a href="{{ job.grouper.get_absolute_url }}">szczegóły ›</a></td>
194 {% for task in job.list %}
195 <tr class="treegrid-{{ forloop.parentloop.counter }}-{{ forloop.counter }} treegrid-parent-{{ forloop.parentloop.counter }}">
197 <a href="{{ task.get_absolute_url }}">
198 <span class="glyphicon glyphicon-file" aria-hidden="true"></span>
202 <td>{{ task.note }}</td>
203 <td>{{ task.submission_time|timesince }} temu</td>
204 <td>{{ task.start_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>
205 <td>{{ task.finish_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>
206 <td>{{ task.get_status_display }}</td>
207 <td>{{ task.short_host_names|join:', ' }}</td>
208 <td><a href="{{ task.get_absolute_url }}">szczegóły ›</a></td>
217 <div class="alert alert-info">
218 <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
219 Brak zadań spełniających wybrane kryteria
223 <nav class="text-center">
224 <ul class="pagination">
225 {% if page.has_previous %}
227 <a href="{% query_string "page"=page.previous_page_number %}" aria-label="Previous">
228 <span aria-hidden="true"><span class="glyphicon glyphicon-chevron-left"></span> poprzednia</span>
233 <li{% ifequal page.number 1 %} class="active"{% endifequal %}>
234 <a href="{% query_string "page"=1 %}">1</a>
237 {% if pages_range.0 > 2 %}
238 <li class="disabled"><span aria-hidden="true"><strong>…</strong></span></li>
241 {% for num in pages_range %}
242 <li{% ifequal page.number num %} class="active"{% endifequal %}>
243 <a href="{% query_string "page"=num %}">{{ num }}</a>
247 <li class="disabled"><span aria-hidden="true"><strong>z</strong></span></li>
248 <li><a href="{% query_string "page"=num_pages %}">{{ num_pages }}</a></li>
250 {% if page.has_next %}
252 <a href="{% query_string "page"=page.next_page_number %}" aria-label="Next">
253 <span aria-hidden="true">następna <span class="glyphicon glyphicon-chevron-right"></span></span>
261 <div class="modal fade" id="advanced" tabindex="-1" role="dialog" aria-labelledby="modal-label" aria-hidden="true">
262 <div class="modal-dialog modal-lg">
263 <div class="modal-content">
264 <div class="modal-header">
265 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
266 <h4 class="modal-title" id="modal-label">Filtry zaawansowane</h4>
268 <div class="modal-body">
269 <form id="advanced-form" action="." class="form-horizontal">
270 {% bootstrap_field filters.keywords layout='horizontal' bound_css_class=' ' %}
271 <div class="form-group">
272 <label class="col-md-4 control-label">Status</label>
273 <div class="col-md-8">
274 <div class="btn-group" data-toggle="buttons">
275 {% for choice in filters.status %}
276 <label class="btn btn-default{% if choice.is_checked %} active{% endif %}">
277 <input type="checkbox" name="{{ choice.name }}" value="{{ choice.choice_value }}"
278 {% if choice.is_checked %}checked{% endif %}> {{ choice.choice_label }}
285 <div class="form-group">
286 <label class="col-md-4 control-label">Host</label>
287 <div class="col-md-8">
288 <div class="btn-group" data-toggle="buttons">
289 {% for choice in filters.host %}
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 }}
298 {% bootstrap_field filters.submission layout='horizontal' bound_css_class=' ' %}
299 {% bootstrap_field filters.finish layout='horizontal' bound_css_class=' ' %}
302 <div class="modal-footer">
303 <button type="button" class="btn btn-default" data-dismiss="modal">Anuluj</button>
304 <a href="." class="btn btn-warning">Wyczyść filtry</a>
305 <button type="submit" class="btn btn-primary" form="advanced-form">Filtruj</button>
311 {% endblock container %}