{% extends "base_body.txt" %}

{% block content -%}
{% trans secpath=secrec['raw_key'], securl='{}/sections/{}?revision={}'.format(config.EMAIL_LINKS_BASE, secrec['raw_key']|urlencode, secrec['meta']['revision']) -%}
  Broken selectors appeared in section "{{ secpath }}"
  {{ securl }}
{%- endtrans %}

{% for brse in broken_selectors -%}
{% for rule_name in brse['rule_names']|sort -%}
{% trans rule_name=rule_name, ruleurl='{}/rules/{}/{}?revision={}'.format(config.EMAIL_LINKS_BASE, secrec['raw_key']|urlencode, rule_name|urlencode, secrec['meta']['revision']) -%}
  Rule: "{{ rule_name }}"
  {{ ruleurl }}
{%- endtrans %}
{% endfor %}
{% trans selector=brse['selector']|indent(width=2, indentfirst=True) -%}
  Selector:
{{ selector }}
{%- endtrans %}

{% if brse['status'] == 'missing' -%}
  {% trans %}Selector is missing from "volatile" collection.{% endtrans %}
{% else -%}
  {% with tried_for = ngettext("%(num)d minute", "%(num)d minutes", (brse['fail_duration'] / 60)|round) -%}
    {% trans num_attempts = brse['pcount'] -%}
      We've tried to resolve it {{ num_attempts }} time in {{ tried_for }}, but got no luck.
Processing log of the last attempt goes below:
    {%- pluralize num_attempts -%}
      We've tried to resolve it {{ num_attempts }} times in {{ tried_for }}, but got no luck.
Processing log of the last attempt goes below:
    {%- endtrans -%}
  {% endwith %}
{% for ts, msg in brse['proclog'] %}  {{ msg }}
{% endfor -%}
{% endif %}

{% endfor -%}

{% if extra_errors -%}
{% trans %}There were some errors during notification creation:{% endtrans %}

{% for ee in extra_errors %}{{ ee }}

{% endfor -%}
{% endif -%}

{% trans %}You have received this email because you are the owner of the section.{% endtrans %}
{%- endblock %}
