{# Cycle pages: the core header (⌂ 📅 … ··· ‹ title › ··· ⚙) and the left column both pages share — status ring, the today button, averages — with the Calendar | History switch under it. #} {% from "_header.html" import nav_btns, settings_btn, title_block, subline, section_tabs %} {% macro head(title, sub, current=True, center_href="/cycle", prev_href=None, next_href=None, can_next=True) %}
{{ nav_btns() }} {{ title_block(title, center_href, current, prev_href, next_href, can_next=can_next, prev_title="Previous month", next_title="Next month") }} {{ settings_btn("cycle") }}
{{ subline(sub) }} {% if plugin_host("cycle") %}{{ section_tabs(plugin_host("cycle"), "/cycle") }}{% endif %}{# inside Health: its tab row #} {% endmacro %} {% macro dm(d) %}{{ d.day }} {{ d.strftime("%b") }}{% endmacro %} {% macro wdm(d) %}{{ d.strftime("%a") }} {{ d.day }} {{ d.strftime("%b") }}{% endmacro %} {# v = views.page(…) (ring, status, stats, preds, today) #} {% macro side(v) %} {% set st = v.status %}
{% if st.kind == "empty" %} No periods yetlog the first one {% elif st.kind == "period" %} periodDay {{ st.day }}since {{ dm(st.since) }} {% elif st.kind == "late" %} period{{ st.days }} day{{ "s" if st.days != 1 }} lateexpected {{ dm(st.expected) }} {% elif st.days == 0 %} periodTodayexpected {% else %} period in{{ st.days }} day{{ "s" if st.days != 1 }}around {{ wdm(st.next) }} {% endif %}
{% if st.cycle_day and st.kind != "period" %}
Cycle day {{ st.cycle_day }}
{% endif %} {% if st.today_on %} {% elif st.kind == "period" %} {% else %} {% endif %}
Cycle
{{ v.stats.cycle }} days
Period
{{ v.stats.period }} days
{% if v.preds %}
Next
{% for a, z in v.preds %}{{ dm(a) }}{{ " · " if not loop.last }}{% endfor %}
{% endif %}
{% endmacro %} {% macro assets() %} {% endmacro %}