{% macro navigation() -%} {% if current_user.email %}
  • Create Pitstop
  • Statistics
  • Account
  • {% if current_user.has_role('admin') %}
  • Admin
  • {% endif %}
  • Logout
  • {% else %}
  • Login
  • Register
  • {% endif %} {%- endmacro %} {% macro render_field_with_errors(field) %}
    {% if field.type == 'SubmitField' %}
    {% else %}
    {% if field.type == 'SelectField' %} {% elif field.type == 'BooleanField' %} {% elif field.type == 'StringField' %} {% elif field.type == 'PasswordField' %} {% elif field.type == 'DateField' %} {% elif field.type == 'IntegerField' %} {% elif field.type == 'DecimalField' %} {% else %} {{ field(**kwargs)|safe }} {% endif %} {% if field.errors %}

    {% for error in field.errors %} {{ error }} {% endfor %}

    {% endif %}
    {% endif %}
    {% endmacro %} {% macro render_login_form() %}

    Login

    {{ login_user_form.hidden_tag() }} {{ render_field_with_errors(login_user_form.email) }} {{ render_field_with_errors(login_user_form.password) }} {{ render_field_with_errors(login_user_form.remember) }} {{ render_field(login_user_form.next) }} {{ render_field_with_errors(login_user_form.submit) }} {% if security.recoverable %} Forgot password {% endif %}
    {% endmacro %} {% macro chartScript(divId, data, unit)%} {% set hash = divId | md5 %} data_{{ hash }} = [{% for stop in data %}{ "date": "{{stop.date}}", "value": {{stop.value}} }{% if not loop.last %},{%endif%} {% endfor%} ] var chart_{{ hash }} = createChart('{{divId}}', data_{{ hash }}, '{{unit}}'); function zoom_chart_{{ hash }}() { chart_{{ hash }}.zoomToIndexes( chart_{{ hash }}.dataProvider.length - 40, chart_{{ hash }}.dataProvider.length - 1 ); } chart_{{ hash }}.addListener("rendered", zoom_chart_{{ hash }}); zoom_chart_{{ hash }}() {% endmacro %} refuel journal
    {% block body %} {% endblock %}
    {# #}