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() -%}