123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- {% 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(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 %}
- </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 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) %}
- <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{% if alert.new %} alert-new{% endif %}">
- {% if alert.new %}
- <i class="icon-star tooltip-top" title="{% trans %}New notification{% endtrans %}"></i>
- {% else %}
- <i class="icon-star-empty tooltip-top" title="{% trans %}Old notification{% endtrans %}"></i>
- {% endif %}
- </td>
- <td class="alert-message">{{ (_(alert.message) % alert.vars())|safe }}</td>
- <td class="alert-date">{{ alert.date|reltimesince }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- {% 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 %}
|