From eb77d03ea3a0862ae85a9d0f2f1e98ee85168629 Mon Sep 17 00:00:00 2001 From: Joachim Lusiardi Date: Sun, 2 Aug 2015 22:45:03 +0200 Subject: [PATCH] App now runs on empty DB. --- app/schema.sql | 5 ----- app/templates/layout.html | 10 +++++++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/schema.sql b/app/schema.sql index e9f88b4..fc0b9f9 100644 --- a/app/schema.sql +++ b/app/schema.sql @@ -13,8 +13,3 @@ CREATE TABLE `services` ( `odometer_done` INTEGER, `tasks` TEXT NOT NULL ); -insert into services (date, odometer_planned, odometer_done, tasks) values ( NULL, 500, NULL, 'Initialinspektion,Ölwechsel'); -insert into services (date, odometer_planned, odometer_done, tasks) values ( NULL, 2500, NULL, 'Ölwechsel'); -insert into services (date, odometer_planned, odometer_done, tasks) values ( NULL, 5000, NULL, 'Inspektion,Ölwechsel'); -insert into services (date, odometer_planned, odometer_done, tasks) values ( NULL, 7500, NULL, 'Ölwechsel'); -insert into services (date, odometer_planned, odometer_done, tasks) values ( NULL, 10000, NULL, 'Inspektion,Ölwechsel'); diff --git a/app/templates/layout.html b/app/templates/layout.html index bebc7d2..94d6b2c 100644 --- a/app/templates/layout.html +++ b/app/templates/layout.html @@ -1,20 +1,24 @@ {% macro alert_level(km_left) -%} - {% if km_left < 0 %} + {% if km_left == None %} + alert-success + {% elif km_left < 0 %} alert-danger - {% elif km_left < 300 %} + {% elif km_left < 300 %} alert-warning {% else %} alert-success - {% endif %} + {% endif %} {%- endmacro %} {% macro service_warning() -%} + {% if data != None and data.service_info != None and 'km_left' in data.service_info %} + {% endif %} {%- endmacro %} {% macro navigation() -%}