]>
Commit | Line | Data |
---|---|---|
378aaefb TC |
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} |
2 | ||
3 | {% block title %}{{ 'notifications.list.page_title' | trans }}{% endblock %} | |
4 | ||
5 | {% block content %} | |
6 | {{ parent() }} | |
7 | <div class="row notifications-page"> | |
8 | <div class="col l8 offset-l2"> | |
9 | {% if app.user.notifications is not empty %} | |
10 | <div class="row"> | |
11 | <a href="{{ path('notification-archive-all') }}" class="btn-light waves-effect waves-light right"><i class="material-icons">done_all</i> {{ 'notifications.list.mark_all_as_read' | trans }}</a> | |
12 | </div> | |
13 | <ul class="collection"> | |
14 | {% for notification in notifications | slice(0, 10) %} | |
15 | <li class="notification collection-item avatar{% if not notification.read %} light-blue lighten-5{% else %} grey-text{% endif %}"> | |
16 | <i class="material-icons circle">{% spaceless %} | |
17 | {% if notification.type == constant('TYPE_ADMIN', notification) %} | |
18 | build | |
19 | {% elseif notification.type == constant('TYPE_USER', notification) %} | |
20 | person | |
21 | {% elseif notification.type == constant('TYPE_RELEASE', notification) %} | |
22 | new_releases | |
23 | {% endif %} | |
24 | {% endspaceless %}</i> | |
25 | <span class="title">{{ notification.title | trans(notification.parameters) }}</span> | |
26 | <p>{{ notification.description | trans | trans(notification.parameters) }}</p> | |
27 | <time datetime="{{ notification.timestamp | date }}">{{ notification.timestamp | time_diff }}</time> | |
28 | <div class="secondary-content"> | |
29 | {% if not notification.read %} | |
30 | {% for action in notification.actions %} | |
31 | <a class="notification-action btn waves-effect waves-light {% spaceless %} | |
32 | {% if action.type == constant('TYPE_OK', action) %} | |
33 | {% elseif action.type == constant('TYPE_YES', action) %} | |
34 | cyan | |
35 | {% elseif action.type == constant('TYPE_NO', action) %} | |
36 | red | |
37 | {% elseif action.type == constant('TYPE_INFO', action) %} | |
38 | blue-grey | |
39 | {% endif %} | |
40 | {% endspaceless %}" data-id="{{ notification.id }}" href="{{ path('notification-archive-redirect', {'redirection': action.link, 'notification': notification.id}) }}">{{ action.label | trans(notification.parameters) }}</a> | |
41 | {% endfor %} | |
42 | <a href="{{ path('notification-archive', {'notification': notification.id}) }}" class="notification-action waves-effect waves-teal btn-flat"><i class="material-icons">check</i></a> | |
43 | {% endif %} | |
44 | </div> | |
45 | </li> | |
46 | {% endfor %} | |
47 | </ul> | |
48 | {% else %} | |
49 | {{ 'notifications.list.none' | trans }} | |
50 | {% endif %} | |
51 | {% if notifications.getNbPages > 1 %} | |
52 | {{ pagerfanta(notifications, 'twitter_bootstrap_translated', {'proximity': 1}) }} | |
53 | {% endif %} | |
54 | </div> | |
55 | </div> | |
56 | {% endblock %} |