{#- Текстовая версия письма «карта и прогноз» (web/mailer.py). События и причины начинаются с «* »,
    пункты «Делать» и «Воздержаться» — с «- ». Разметка строк перевода снимается фильтром plain. -#}
{% macro lists(rule, pad="") %}
{% if rule.do %}
{{ pad }}{{ t("forecast.do") }}:
{% for x in rule.do %}
{{ pad }}  - {{ x }}
{% endfor %}
{% endif %}
{% if rule.avoid %}
{{ pad }}{{ t("forecast.avoid") }}:
{% for x in rule.avoid %}
{{ pad }}  - {{ x }}
{% endfor %}
{% endif %}
{{ pad }}{{ t("forecast.source") }}: {{ rule.source }}
{% endmacro %}
{% macro title(text, mark="=") %}
{{ text }}
{{ mark * (text|length) }}
{% endmacro %}
{% set f = forecast %}
{{ title("1astro") }}
{{ t("mail.greeting", name=name) }}

{{ t("mail.intro") }}
{{ t("mail.birth") }}: {{ birth }}


{{ title(t("natal.h1"), "-") }}
{% for label, value in chart %}
{{ label }}: {{ value }}
{% endfor %}
{% if period %}
{{ period.label }}: {{ period.title }}, {{ period.until }}
{% endif %}


{{ title(t("forecast.title"), "-") }}{% if caution %}

{{ t("forecast.moon_caution") }}
{% endif %}

{{ t("forecast.now") }} ({{ f.as_of }}): {{ f.now.word }}, {{ f.now.until }}
{{ f.now.rule.text }}

{{ t("forecast.cause") }}: {{ f.now.cause.title }}
{{ f.now.cause.text }}
{% if f.now.softened_by %}
{{ t("forecast.softened") }}: {{ f.now.softened_by.title }}
{% endif %}
{{ lists(f.now.cause) }}

{{ t("forecast.why") }}
{% for w in f.why %}
* {{ w.rule.title }}
  {{ [w.word if w.signal else None, w.until]|select|join(", ") }}{% if w.note %}; {{ w.note }}{% endif %}

{% endfor %}
{% for section in sections %}

{{ title(section.title, "-") }}
{% for item in section["items"] %}
{% set rule = item.rule %}
* {{ rule.title }}
  {{ item.when }}{% if item.signal %} · {{ item.word }}{% endif %}{% for tag in item.tags %} · {{ tag }}{% endfor %}

{% if item.repeat_of %}
  {{ t("forecast.repeat", date=item.repeat_of.when)|plain }}
{% else %}
  {{ rule.text }}
{% if item.houses %}
  {{ t("forecast.houses") }}: {{ item.houses|join("; ") }}
{% endif %}
{{ lists(rule, "  ") }}
{%- endif %}

{% else %}
{{ t("forecast.feed_empty") }}

{% endfor %}
{% endfor %}

{{ t("forecast.limits.title") }}: {{ t("forecast.limits.trends") }} {{ t("forecast.limits.specialists") }}


{{ t("mail.subscribe_title") }}
{{ t("mail.subscribe_text_open" if billing_open else "mail.subscribe_text") }}
{{ t("mail.subscribe_button_open" if billing_open else "mail.subscribe_button") }}: {{ links.subscribe }}

--
{{ t("mail.footer_why") }}
{{ t("mail.footer_offers_text", url=links.unsubscribe) }}
{{ t("mail.footer_delete_text", url=links.delete) }}
