{% macro field(input, numeric=false, autocomplete='off') %}
{{ input.label }} {% if numeric %} {{ input(inputmode='numeric', autocomplete=autocomplete, aria_invalid='true' if input.errors else 'false', aria_describedby=input.id ~ '-error' if input.errors else '') }} {% else %} {{ input(autocomplete=autocomplete, aria_invalid='true' if input.errors else 'false', aria_describedby=input.id ~ '-error' if input.errors else '') }} {% endif %} {% if input.errors %}
{% for error in input.errors %}

{{ error }}

{% endfor %}
{% endif %}
{% endmacro %} {% macro reading_rows(readings, sys_threshold, dia_threshold) %} {% if readings %}
Date & timeBlood pressurePulsePersonal thresholdAction
{% for reading in readings %} {% set above = reading.systolic >= sys_threshold or reading.diastolic >= dia_threshold %}
Blood pressure{{ reading.systolic }} / {{ reading.diastolic }}mmHg
Pulse{{ reading.heart_rate }} bpm
{{ 'At / above' if above else 'Below' }} threshold
Edit
{% endfor %}
{% else %}

No readings in this period

Add a reading or choose another date range.

Add reading
{% endif %} {% endmacro %}