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, `odometer_done` INTEGER,
`tasks` TEXT NOT NULL `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,20 +1,24 @@
{% macro alert_level(km_left) -%} {% macro alert_level(km_left) -%}
{% if km_left < 0 %} {% if km_left == None %}
alert-success
{% elif km_left < 0 %}
alert-danger alert-danger
{% elif km_left < 300 %} {% elif km_left < 300 %}
alert-warning alert-warning
{% else %} {% else %}
alert-success alert-success
{% endif %} {% endif %}
{%- endmacro %} {%- endmacro %}
{% macro service_warning() -%} {% 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"> <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"> <button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
Service required in {{ data.service_info['km_left'] }} km. Tasks: {{ data.service_info['tasks'] }}. Service required in {{ data.service_info['km_left'] }} km. Tasks: {{ data.service_info['tasks'] }}.
</div> </div>
{% endif %}
{%- endmacro %} {%- endmacro %}
{% macro navigation() -%} {% macro navigation() -%}