From e0f9010ec2a558f6cf7d16fb96a2c4cdb34e3f37 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 15 Jun 2017 09:43:48 +0200 Subject: Notifications Signed-off-by: Thomas Citharel --- .../views/themes/common/Developer/client.html.twig | 1 + .../views/themes/common/Developer/index.html.twig | 1 + .../views/themes/common/Static/about.html.twig | 2 +- .../views/themes/common/Static/howto.html.twig | 2 +- .../themes/common/Static/quickstart.html.twig | 2 +- .../views/themes/material/Config/index.html.twig | 2 +- .../views/themes/material/Entry/entries.html.twig | 1 + .../material/Notification/notifications.html.twig | 56 ++++++++++++++++++++++ .../views/themes/material/Tag/tags.html.twig | 1 + .../views/themes/material/layout.html.twig | 54 +++++++++++++++++++++ 10 files changed, 118 insertions(+), 4 deletions(-) create mode 100644 src/Wallabag/CoreBundle/Resources/views/themes/material/Notification/notifications.html.twig (limited to 'src/Wallabag/CoreBundle/Resources/views/themes') diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client.html.twig index 8a5da71a..d566795d 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client.html.twig @@ -3,6 +3,7 @@ {% block title %}{{ 'developer.client.page_title'|trans }}{% endblock %} {% block content %} +{{ parent() }}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/index.html.twig index 528b055c..53210688 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/index.html.twig @@ -3,6 +3,7 @@ {% block title %}{{ 'developer.page_title'|trans }}{% endblock %} {% block content %} +{{ parent() }}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/about.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/about.html.twig index 1cd3485c..ffd9b1b8 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/about.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/about.html.twig @@ -3,7 +3,7 @@ {% block title %}{{ 'about.page_title'|trans }}{% endblock %} {% block content %} - + {{ parent() }}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/howto.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/howto.html.twig index 231f9bdf..4c598b85 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/howto.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/howto.html.twig @@ -3,7 +3,7 @@ {% block title %}{{ 'howto.page_title'|trans }}{% endblock %} {% block content %} - + {{ parent() }}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/quickstart.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/quickstart.html.twig index 4580813c..70265be2 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/quickstart.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/quickstart.html.twig @@ -3,7 +3,7 @@ {% block title %}{{ 'quickstart.page_title'|trans }}{% endblock %} {% block content %} - + {{ parent() }}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig index a8143315..bd5932b0 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig @@ -3,7 +3,7 @@ {% block title %}{{ 'config.page_title'|trans }}{% endblock %} {% block content %} - + {{ parent() }}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig index 0c4dc80b..1cc5489f 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig @@ -19,6 +19,7 @@ {% endblock %} {% block content %} + {{ parent() }} {% set listMode = app.user.config.listMode %} {% set currentRoute = app.request.attributes.get('_route') %}
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 index 00000000..49cc0d40 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Notification/notifications.html.twig @@ -0,0 +1,56 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{{ 'notifications.list.page_title' | trans }}{% endblock %} + +{% block content %} + {{ parent() }} +
+
+ {% if app.user.notifications is not empty %} + +
    + {% for notification in notifications | slice(0, 10) %} +
  • + {% 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 %} + {{ notification.title | trans(notification.parameters) }} +

    {{ notification.description | trans | trans(notification.parameters) }}

    + +
    + {% if not notification.read %} + {% for action in notification.actions %} + {{ action.label | trans(notification.parameters) }} + {% endfor %} + check + {% endif %} +
    +
  • + {% endfor %} +
+ {% else %} + {{ 'notifications.list.none' | trans }} + {% endif %} + {% if notifications.getNbPages > 1 %} + {{ pagerfanta(notifications, 'twitter_bootstrap_translated', {'proximity': 1}) }} + {% endif %} +
+
+{% endblock %} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig index 97ddedc9..7a0f793c 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig @@ -3,6 +3,7 @@ {% block title %}{{ 'tag.page_title'|trans }}{% endblock %} {% block content %} + {{ parent() }}
{{ 'tag.list.number_on_the_page'|transchoice(tags|length) }}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig index 60907e11..ccc44931 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig @@ -110,6 +110,13 @@ search +
  • + {% set unreadNotifs = get_notifications() | unread_notif | length %} + + notifications{% if unreadNotifs == 0 %}_none{% endif %} + {% if unreadNotifs > 0 %}{{ unreadNotifs }}{% endif %} + +
  • filter_list @@ -135,6 +142,53 @@ {% endblock %} +{% block content %} + + +{% endblock %} + {% block footer %}