1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- {% extends "cranefly/layout.html" %}
- {% load i18n %}
- {% 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 content %}
- <div class="page-header">
- <h1>{% if user.alerts %}{{ get_title() }} <small>{% trans %}Your Notifications{% endtrans %}</small>
- {%- else -%}
- {% trans %}Your Notifications{% endtrans %}{% endif %}</h1>
- </div>
- {% if alerts %}
- <div class="alerts-list">
- {% 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 %}
- </div>
- {% else %}
- <p class="lead">{% trans %}Looks like you don't have any notifications... yet.{% endtrans %}</p>
- {% 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) %}
- <table class="table table-striped">
- <thead>
- <tr>
- <th>{{ title }}</th>
- <th class="span3">{% trans %}Date{% endtrans %}</th>
- </tr>
- </thead>
- <tbody>
- {% for alert in alerts %}
- <tr>
- <td>{% if alert.new %}<span class="label label-warning">{% trans %}New{% endtrans %}</span> {% endif %}{{ (_(alert.message) % alert.vars())|safe }}</td>
- <td class="muted">{{ alert.date|reltimesince }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- {% endmacro %}
|