49 lines
1.8 KiB
Twig
49 lines
1.8 KiB
Twig
{% set alerts = user.notifications(0, false)|batch(10) %}
|
|
|
|
{% set paginationPages = alerts %}
|
|
{% set paginationUrl %}{{ urls.format('SETTING_MODE', ['notifications', 'history']) }}{% endset %}
|
|
|
|
{% block css %}
|
|
<style type="text/css">
|
|
.pagination {
|
|
float: right;
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% if alerts %}
|
|
<div class="notification-history">
|
|
{% for alert in alerts[get.page|default(1) - 1] %}
|
|
<a id="notif-hist-{{ alert.id }}" class="clean {% if alert.read %}read{% endif %}"{% if alert.link %} href="{{ alert.link }}"{% endif %}>
|
|
<div class="notif-hist-icon">
|
|
{% if 'FONT:' in alert.image %}
|
|
<div class="font-icon fa {{ alert.image|replace({'FONT:': ''}) }} fa-4x"></div>
|
|
{% else %}
|
|
<img src="{{ alert.image }}" alt="Notification" />
|
|
{% endif %}
|
|
</div>
|
|
<div class="notif-hist-content">
|
|
<div class="notif-hist-inside">
|
|
<div class="notif-hist-title">
|
|
{{ alert.title }}
|
|
</div>
|
|
<div class="notif-hist-text">
|
|
{{ alert.title }}
|
|
</div>
|
|
</div>
|
|
<div class="notif-hist-time">
|
|
<time datetime="{{ alert.time|date('r') }}">{{ alert.time|date(config('date_format')) }}</time>
|
|
</div>
|
|
</div>
|
|
<div class="clear"></div>
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
{% if alerts|length > 1 %}
|
|
<div>
|
|
{% include 'elements/pagination.twig' %}
|
|
</div>
|
|
{% endif %}
|
|
{% else %}
|
|
<h1 class="stylised" style="margin: 2em auto; text-align: center;">You don't have any notifications in your history!</h1>
|
|
{% endif %}
|