splitted services

This commit is contained in:
joachim lusiardi 2015-03-20 21:18:49 +01:00
parent d6807857cb
commit 895736eaf1
1 changed files with 84 additions and 47 deletions

View File

@ -1,18 +1,11 @@
{% extends "layout.html" %} {% extends "layout.html" %}
{% block body %} {% macro print_service_header() -%}
{{ service_warning() }}
<div class="table-responsive">
<table class="table table-striped table-bordered table-condensed">
<tr> <tr>
<th> <th>
Odometer<br /> Odometer<br />
(planned) (planned<br />
</th> done)
<th>
Odometer<br />
(done)
</th> </th>
<th> <th>
Date<br /> Date<br />
@ -22,12 +15,12 @@
Tasks Tasks
</th> </th>
</tr> </tr>
{% for service in data['services'] %} {%- endmacro %}
{% macro print_service(service) -%}
<tr class='pitstop'> <tr class='pitstop'>
<td> <td>
{{service.odometer_planned}} km {{service.odometer_planned}} km<br />
</td>
<td>
{% if service.odometer_done %} {% if service.odometer_done %}
{{service.odometer_done}} km {{service.odometer_done}} km
{% else %} {% else %}
@ -48,7 +41,51 @@
{% endfor %} {% endfor %}
</td> </td>
</tr> </tr>
{%- endmacro %}
{% block body %}
{{ service_warning() }}
<div class="tabbable tabs-left">
<ul class="nav nav-tabs" id="tabs">
<li>
<a href="#tab1" data-toggle="tab">Inspektionen</a>
</li>
<li>
<a href="#tab2" data-toggle="tab">Inspektionen (erledigt)</a>
</li>
</ul>
<div class="tab-content">
<div id="tab1" class="tab-pane active">
<div class="table-responsive">
<table class="table table-striped table-bordered table-condensed">
{{ print_service_header() }}
{% for service in data['services'] | reverse() %}
{% if not service.odometer_done %}
{{ print_service(service) }}
{% endif %}
{% endfor %} {% endfor %}
</table> </table>
</div> </div>
</div>
<div id="tab2" class="tab-pane">
<div class="table-responsive">
<table class="table table-striped table-bordered table-condensed">
{{ print_service_header() }}
{% for service in data['services'] %}
{% if service.odometer_done %}
{{ print_service(service) }}
{% endif %}
{% endfor %}
</table>
</div>
</div>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function ($) {
console.log('ready')
$('.nav-tabs').tab();
});
</script>
{% endblock %} {% endblock %}