App now runs on empty DB.

This commit is contained in:
Joachim Lusiardi 2015-08-02 22:45:03 +02:00
parent 6f194deac5
commit eb77d03ea3
2 changed files with 7 additions and 8 deletions

View File

@ -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');

View File

@ -1,5 +1,7 @@
{% 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 %}
alert-warning
@ -9,12 +11,14 @@
{%- endmacro %}
{% macro service_warning() -%}
{% if data != None and data.service_info != None and 'km_left' in data.service_info %}
<div class="alert {{ alert_level(data.service_info['km_left']) }} alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
Service required in {{ data.service_info['km_left'] }} km. Tasks: {{ data.service_info['tasks'] }}.
</div>
{% endif %}
{%- endmacro %}
{% macro navigation() -%}