1 {% extends 'qcg/base.html' %}
2 {% load staticfiles bootstrap3 %}
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'],
58 $('#toggle-advanced').click(function() {
59 if($('#advanced-filters').attr('aria-expanded') == "false")
60 $(this).text('« mniej');
62 $(this).text('więcej »');
69 <h1 class="page-header">
70 {% block title %}Lista zadań{% endblock %}
75 <div class="col-lg-10 col-lg-offset-1">
76 <div class="pull-right">
77 <a id="toggle-advanced" href="#advanced-filters" data-toggle="collapse">
85 <a href="." class="btn btn-default{% if not filters.data %} disabled{% endif %}">Wyczyść</a>
86 <button type="submit" class="btn btn-default">Filtruj</button>
88 <div class="btn-toolbar">
89 <div class="btn-group" data-toggle="buttons">
90 {% for choice in filters.status %}
91 <label class="btn btn-default{% if choice.is_checked %} active{% endif %}">
92 <input type="checkbox" name="{{ choice.name }}" value="{{ choice.choice_value }}"
93 {% if choice.is_checked %}checked{% endif %}> {{ choice.choice_label }}
97 <div class="btn-group" data-toggle="buttons">
98 {% for choice in filters.host %}
99 <label class="btn btn-default{% if choice.is_checked %} active{% endif %}">
100 <input type="checkbox" name="{{ choice.name }}" value="{{ choice.choice_value }}"
101 {% if choice.is_checked %}checked{% endif %}> {{ choice.choice_label }}
108 {# <div id="advanced-filters" class="form-horizontal collapse in" aria-expanded="true" style="margin-top: 10px">#}
109 {# <div class="row">#}
110 {# {% bootstrap_field filters.keywords layout='horizontal' horizontal_label_class='col-md-5' horizontal_field_class='col-md-4' bound_css_class=' ' %}#}
112 {# <div class="row">#}
113 {# {% bootstrap_field filters.status_exact layout='horizontal' horizontal_label_class='col-md-5' horizontal_field_class='col-md-4' bound_css_class=' ' %}#}
115 {# <div class="row">#}
116 {# {% bootstrap_field filters.submission layout='horizontal' horizontal_label_class='col-md-5' horizontal_field_class='col-md-4' bound_css_class=' ' %}#}
118 {# <div class="row">#}
119 {# {% bootstrap_field filters.finish layout='horizontal' horizontal_label_class='col-md-5' horizontal_field_class='col-md-4' bound_css_class=' ' %}#}
122 <div id="advanced-filters" class="form-horizontal collapse{% if advanced %} in" aria-expanded="true"{% else %}" aria-expanded="false"{% endif %} style="margin-top: 10px">
124 <div class="col-ld-1"></div>
125 {% bootstrap_field filters.keywords layout='horizontal' form_group_class='form-group row col-lg-5 col-md-6' horizontal_label_class='col-md-4' horizontal_field_class='col-md-8' bound_css_class=' ' %}
126 {% bootstrap_field filters.status_exact layout='horizontal' form_group_class='form-group row col-lg-5 col-md-6' horizontal_label_class='col-md-4' horizontal_field_class='col-md-8' bound_css_class=' ' %}
129 <div class="col-ld-1"></div>
130 {% bootstrap_field filters.submission layout='horizontal' form_group_class='form-group row col-lg-5 col-md-6' horizontal_label_class='col-md-4' horizontal_field_class='col-md-8' bound_css_class=' ' %}
131 {% bootstrap_field filters.finish layout='horizontal' form_group_class='form-group row col-lg-5 col-md-6' horizontal_label_class='col-md-4' horizontal_field_class='col-md-8' bound_css_class=' ' %}
139 <nav class="text-center" style="margin-bottom: 15px">
140 <form action="{{ request.path }}" method="get" class="form-inline" role="form" style="display: inline-block">
141 <div class="input-group input-group-sm">
142 <span class="input-group-btn">
143 {% if page.has_previous %}
144 <a href="{{ request.path }}?page={{ page.previous_page_number }}" class="btn btn-default">
146 <a href="#" class="btn btn-default disabled">
148 <span class="glyphicon glyphicon-chevron-left"></span>
151 <label class="sr-only" for="page">Strona</label>
152 <input type="text" class="form-control text-center" id="page" name="page" value="{{ page.number }}" style="width: 50px">
153 <span class="input-group-btn">
154 {% if page.has_next %}
155 <a href="{{ request.path }}?page={{ page.next_page_number }}" class="btn btn-default">
157 <a href="#" class="btn btn-default disabled">
159 <span class="glyphicon glyphicon-chevron-right"></span>
165 <a href="{{ request.path }}?page={{ num_pages }}">{{ num_pages }}</a>
168 <table class="table table-hover tree">
171 <th style="width: 80px"></th>
182 {% regroup page by job as jobs %}
184 {% for job in jobs %}
185 {% ifequal job.list|length 1 %}
186 {% with job.list.0 as task %}
187 <tr class="treegrid-{{ forloop.counter }}">
189 <a href="{{ task.get_absolute_url }}">
190 <span class="glyphicon glyphicon-file" aria-hidden="true"></span>
194 <td>{{ task.note }}</td>
195 <td>{{ task.submission_time|timesince }} temu</td>
196 <td>{{ task.start_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>
197 <td>{{ task.finish_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>
198 <td>{{ task.get_status_display }}</td>
199 <td>{{ task.short_host_names|join:', ' }}</td>
203 <tr class="treegrid-{{ forloop.counter }}">
205 <a href="{{ job.grouper.get_absolute_url }}">
206 <span class="glyphicon glyphicon-folder-close" aria-hidden="true"></span>
207 {# {{ job.grouper }}#}
210 <td>{{ job.grouper.note }}</td>
211 <td>{{ job.grouper.submission_time|timesince }} temu</td>
213 <td>{{ job.grouper.finish_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>
214 <td>{{ job.grouper.get_status_display }}</td>
218 {% for task in job.list %}
219 <tr class="treegrid-{{ forloop.parentloop.counter }}-{{ forloop.counter }} treegrid-parent-{{ forloop.parentloop.counter }}">
221 <a href="{{ task.get_absolute_url }}">
222 <span class="glyphicon glyphicon-file" aria-hidden="true"></span>
226 <td>{{ task.note }}</td>
227 <td>{{ task.submission_time|timesince }} temu</td>
228 <td>{{ task.start_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>
229 <td>{{ task.finish_time|date:"CUSTOM_DATETIME_FORMAT" }}</td>
230 <td>{{ task.get_status_display }}</td>
231 <td>{{ task.short_host_names|join:', ' }}</td>
240 <div class="alert alert-info">Brak elementów</div>
243 <nav class="text-center">
244 <ul class="pagination">
245 {% if page.has_previous %}
247 <a href="{{ request.path }}?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="{{ request.path }}?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="{{ request.path }}?page={{ num }}">{{ num }}</a>
267 <li class="disabled"><span aria-hidden="true"><strong>z</strong></span></li>
268 <li><a href="{{ request.path }}?page={{ num_pages }}">{{ num_pages }}</a></li>
270 {% if page.has_next %}
272 <a href="{{ request.path }}?page={{ page.next_page_number }}" aria-label="Next">
273 <span aria-hidden="true">następna <span class="glyphicon glyphicon-chevron-right"></span></span>
280 {% endblock container %}