This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/templates/yuuno/settings/notifications.history.twig
2016-03-26 17:36:58 +01:00

49 lines
1.7 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>{{ alert.time|date(sakura.dateFormat) }}</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 %}