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() }}
-
-
-
-
-
- Odometer
- (planned)
- |
-
- Odometer
- (done)
- |
-
- Date
- (done)
- |
-
- Tasks
- |
-
- {% for service in data['services'] %}
-
-
- {{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