]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Resources/views/themes/material/Notification/notifications.html.twig
Notifications
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Resources / views / themes / material / Notification / notifications.html.twig
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Notification/notifications.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Notification/notifications.html.twig
new file mode 100644 (file)
index 0000000..49cc0d4
--- /dev/null
@@ -0,0 +1,56 @@
+{% extends "WallabagCoreBundle::layout.html.twig" %}
+
+{% block title %}{{ 'notifications.list.page_title' | trans }}{% endblock %}
+
+{% block content %}
+    {{ parent() }}
+    <div class="row notifications-page">
+        <div class="col l8 offset-l2">
+            {% if app.user.notifications is not empty %}
+                <div class="row">
+                    <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>
+                </div>
+                <ul class="collection">
+                {% for notification in notifications | slice(0, 10) %}
+                    <li class="notification collection-item avatar{% if not notification.read %} light-blue lighten-5{% else %} grey-text{% endif %}">
+                        <i class="material-icons circle">{% spaceless %}
+                                {% if notification.type == constant('TYPE_ADMIN', notification) %}
+                                    build
+                                {% elseif notification.type == constant('TYPE_USER', notification) %}
+                                    person
+                                {% elseif notification.type == constant('TYPE_RELEASE', notification) %}
+                                    new_releases
+                                {% endif %}
+                            {% endspaceless %}</i>
+                        <span class="title">{{ notification.title | trans(notification.parameters) }}</span>
+                        <p>{{ notification.description | trans | trans(notification.parameters) }}</p>
+                        <time datetime="{{ notification.timestamp | date }}">{{ notification.timestamp | time_diff }}</time>
+                        <div class="secondary-content">
+                            {% if not notification.read %}
+                                {% for action in notification.actions %}
+                                    <a class="notification-action btn waves-effect waves-light {% spaceless %}
+                                       {% if action.type == constant('TYPE_OK', action) %}
+                                       {% elseif action.type == constant('TYPE_YES', action) %}
+                                            cyan
+                                       {% elseif action.type == constant('TYPE_NO', action) %}
+                                            red
+                                       {% elseif action.type == constant('TYPE_INFO', action) %}
+                                            blue-grey
+                                       {% endif %}
+                                        {% endspaceless %}" data-id="{{ notification.id }}" href="{{ path('notification-archive-redirect', {'redirection': action.link, 'notification': notification.id}) }}">{{ action.label | trans(notification.parameters) }}</a>
+                                {% endfor %}
+                            <a href="{{ path('notification-archive', {'notification': notification.id}) }}" class="notification-action waves-effect waves-teal btn-flat"><i class="material-icons">check</i></a>
+                            {% endif %}
+                        </div>
+                    </li>
+                {% endfor %}
+                </ul>
+            {% else %}
+                    {{ 'notifications.list.none' | trans }}
+            {% endif %}
+            {% if notifications.getNbPages > 1 %}
+                {{ pagerfanta(notifications, 'twitter_bootstrap_translated', {'proximity': 1}) }}
+            {% endif %}
+        </div>
+    </div>
+{% endblock %}