From 895736eaf14a4133172c4e62de75191f1a324dfb Mon Sep 17 00:00:00 2001 From: joachim lusiardi Date: Fri, 20 Mar 2015 21:18:49 +0100 Subject: [PATCH] splitted services --- app/templates/services.html | 131 +++++++++++++++++++++++------------- 1 file changed, 84 insertions(+), 47 deletions(-) diff --git a/app/templates/services.html b/app/templates/services.html index 6a15cdf..0b882f9 100644 --- a/app/templates/services.html +++ b/app/templates/services.html @@ -1,54 +1,91 @@ {% extends "layout.html" %} +{% macro print_service_header() -%} + + + Odometer
+ (planned
+ done) + + + Date
+ (done) + + + Tasks + + +{%- endmacro %} + +{% macro print_service(service) -%} + + + {{service.odometer_planned}} km
+ {% if service.odometer_done %} + {{service.odometer_done}} km + {% else %} + -- km + {% endif %} + + + {% if service.date %} + {{service.date}} + {% else %} + -- + {% endif %} + + + + {% for task in service.tasks.split(',') %} + {{task}}
+ {% endfor %} + + +{%- endmacro %} + {% block body %} {{ service_warning() }} - -
- - - - - - - - {% for service in data['services'] %} - - - - -
- Odometer
- (planned) -
- Odometer
- (done) -
- Date
- (done) -
- Tasks -
- {{service.odometer_planned}} km - - {% if service.odometer_done %} - {{service.odometer_done}} km - {% else %} - -- km - {% endif %} - - {% if service.date %} - {{service.date}} - {% else %} - -- - {% endif %} - - - {% for task in service.tasks.split(',') %} - {{task}}
+
+ +
+
+
+ + {{ print_service_header() }} + {% for service in data['services'] | reverse() %} + {% if not service.odometer_done %} + {{ print_service(service) }} + {% endif %} {% endfor %} - - - {% endfor %} -
+
+
+ +
+
+ + {{ print_service_header() }} + {% for service in data['services'] %} + {% if service.odometer_done %} + {{ print_service(service) }} + {% endif %} + {% endfor %} +
+
+
+ + + {% endblock %} \ No newline at end of file