{% 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(lang_today(), alerts.today) }}{% endif %} {% if alerts.yesterday %}{{ alerts_list(lang_yesterday(), alerts.yesterday) }}{% endif %} {% if alerts.week %}{{ alerts_list(lang_week(), alerts.week) }}{% endif %} {% if alerts.month %}{{ alerts_list(lang_month(), alerts.month) }}{% endif %} {% if alerts.older %}{{ alerts_list(lang_older(), alerts.older) }}{% endif %}
{% else %}

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

{% endif %}
{% endblock %} {% macro get_title() -%} {% if new_alerts -%} {% trans alerts=new_alerts -%} You have one new alert {%- pluralize -%} You have {{ alerts }} new alerts {%- endtrans %} {%- else -%} {% trans %}Your Notifications{% endtrans %} {%- endif %} {%- endmacro %} {% macro alerts_list(title, alerts) %} {% for alert in alerts %} {% endfor %}
  {{ title }}
{% if alert.new %} {% else %} {% endif %} {{ (_(alert.message) % alert.vars())|safe }} {{ alert.date|reltimesince }}
{% endmacro %} {# Language strings macros #} {% macro lang_today() -%}{% trans %}Today Notifications{% endtrans %}{%- endmacro %} {% macro lang_yesterday() -%}{% trans %}Yesterday Notifications{% endtrans %}{%- endmacro %} {% macro lang_week() -%}{% trans %}This Week{% endtrans %}{%- endmacro %} {% macro lang_month() -%}{% trans %}This Month{% endtrans %}{%- endmacro %} {% macro lang_older() -%}{% trans %}Older Notifications{% endtrans %}{%- endmacro %}