{% extends "cranefly/layout.html" %} {% import "cranefly/macros.html" as macros with context %} {% block title %}{% if user.alerts -%} {{ macros.page_title(title=get_title(),parent=_('Your Notifications')) }} {%- else -%} {{ macros.page_title(title=get_title()) }} {%- endif %}{% endblock %} {% block container %}
{% if alerts %}
{% if alerts.today %}{{ alerts_list(_("Today Notifications"), alerts.today) }}{% endif %} {% if alerts.yesterday %}{{ alerts_list(_("Yesterday Notifications"), alerts.yesterday) }}{% endif %} {% if alerts.week %}{{ alerts_list(_("This Week"), alerts.week) }}{% endif %} {% if alerts.month %}{{ alerts_list(_("This Month"), alerts.month) }}{% endif %} {% if alerts.older %}{{ alerts_list(_("Older Notifications"), alerts.older) }}{% endif %}
{% else %}

{% trans %}Looks like you don't have any notifications... yet.{% endtrans %}

{% endif %}
{% endblock %} {% macro get_title() -%} {% if new_alerts -%} {% trans count=new_alerts -%} You have one new alert {%- pluralize -%} You have {{ count }} new alerts {%- endtrans %} {%- else -%} {% trans %}Your Notifications{% endtrans %} {%- endif %} {%- endmacro %} {% macro alerts_list(title, alerts) %} {% for alert in alerts %} {% endfor %}
  {{ title }}
{{ (_(alert.message) % alert.vars())|safe }} {{ alert.date|reltimesince }}
{% endmacro %}