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