{% extends "sora/layout.html" %} {% load i18n %} {% import "sora/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 content %} {% 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 Notifications"), alerts.week) }}{% endif %} {% if alerts.month %}{{ alerts_list(_("This Month Notifications"), 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 }} {% trans %}Date{% endtrans %}
{% if alert.new %}{% trans %}New{% endtrans %} {% endif %}{{ (_(alert.message) % alert.vars())|safe }} {{ alert.date|reltimesince }}
{% endmacro %}