1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- {% 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 %}
- <div class="page-header header-primary">
- <div class="container">
- {{ messages_list(messages) }}
- <h1>{% if user.alerts %}{{ get_title() }} <small>{% trans %}Your Notifications{% endtrans %}</small>
- {%- else -%}
- {% trans %}Your Notifications{% endtrans %}{% endif %}</h1>
- </div>
- </div>
- <div class="container container-primary">
- {% if alerts %}
- <div class="user-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 %}
- </div>
- {% else %}
- <p class="lead">{% trans %}Looks like you don't have any notifications... yet.{% endtrans %}</p>
- {% endif %}
- </div>
- {% 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 style="width: 1%;"> </th>
- <th colspan="2">{{ title }}</th>
- </tr>
- </thead>
- <tbody>
- {% for alert in alerts %}
- <tr>
- <td class="alert-icon"><span class="label {% if alert.new %} label-warning{% endif %} tooltip-top" title="{% if alert.new %}{% trans %}New notification{% endtrans %}{% else %}{% trans %}Old notification{% endtrans %}{% endif %}"><i class="icon-fire"></i></label></td>
- <td class="alert-message">{{ (_(alert.message) % alert.vars())|safe }}</td>
- <td class="alert-date">{{ alert.date|reltimesince }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- {% endmacro %}
|