From 22a4b20ed04a9c709fbbe3e254ad8b2d7757a38b Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 12 May 2017 15:02:32 +0200 Subject: First draft for notifications Signed-off-by: Thomas Citharel --- .../static/themes/material/css/sidenav.scss | 4 + .../static/themes/material/css/various.scss | 6 + app/Resources/static/themes/material/index.js | 12 +- app/Resources/static/themes/material/js/tools.js | 9 +- .../Controller/NotificationsController.php | 38 ++++ src/Wallabag/CoreBundle/Entity/Notification.php | 220 +++++++++++++++++++++ src/Wallabag/CoreBundle/Notifications/Action.php | 84 ++++++++ .../CoreBundle/Notifications/ActionInterface.php | 41 ++++ .../Notifications/NotificationInterface.php | 66 +++++++ .../Repository/NotificationRepository.php | 17 ++ .../Resources/translations/messages.da.yml | 8 + .../Resources/translations/messages.de.yml | 8 + .../Resources/translations/messages.en.yml | 8 + .../Resources/translations/messages.es.yml | 8 + .../Resources/translations/messages.fa.yml | 8 + .../Resources/translations/messages.fr.yml | 8 + .../Resources/translations/messages.it.yml | 8 + .../Resources/translations/messages.oc.yml | 8 + .../Resources/translations/messages.pl.yml | 8 + .../Resources/translations/messages.pt.yml | 8 + .../Resources/translations/messages.ro.yml | 8 + .../Resources/translations/messages.tr.yml | 8 + .../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 | 42 ++++ .../views/themes/material/Tag/tags.html.twig | 1 + .../views/themes/material/layout.html.twig | 45 +++++ src/Wallabag/CoreBundle/Twig/WallabagExtension.php | 10 + src/Wallabag/UserBundle/Entity/User.php | 21 ++ .../UserBundle/Resources/views/manage.html.twig | 2 +- 35 files changed, 718 insertions(+), 7 deletions(-) create mode 100644 src/Wallabag/CoreBundle/Controller/NotificationsController.php create mode 100644 src/Wallabag/CoreBundle/Entity/Notification.php create mode 100644 src/Wallabag/CoreBundle/Notifications/Action.php create mode 100644 src/Wallabag/CoreBundle/Notifications/ActionInterface.php create mode 100644 src/Wallabag/CoreBundle/Notifications/NotificationInterface.php create mode 100644 src/Wallabag/CoreBundle/Repository/NotificationRepository.php create mode 100644 src/Wallabag/CoreBundle/Resources/views/themes/material/Notification/notifications.html.twig diff --git a/app/Resources/static/themes/material/css/sidenav.scss b/app/Resources/static/themes/material/css/sidenav.scss index 416dc1c7..f45970de 100644 --- a/app/Resources/static/themes/material/css/sidenav.scss +++ b/app/Resources/static/themes/material/css/sidenav.scss @@ -36,6 +36,10 @@ } } +#notifications { + width: 300px; +} + .bold > a { font-weight: bold; } diff --git a/app/Resources/static/themes/material/css/various.scss b/app/Resources/static/themes/material/css/various.scss index 7daf40ec..300015ab 100644 --- a/app/Resources/static/themes/material/css/various.scss +++ b/app/Resources/static/themes/material/css/various.scss @@ -30,3 +30,9 @@ nav .input-field input { .tab { flex: 1; } + +#notifications-count { + position: relative; + top: -50px; + left: 15px; +} diff --git a/app/Resources/static/themes/material/index.js b/app/Resources/static/themes/material/index.js index d6afbb8a..e16749f6 100755 --- a/app/Resources/static/themes/material/index.js +++ b/app/Resources/static/themes/material/index.js @@ -8,7 +8,7 @@ import 'materialize-css/dist/js/materialize'; import '../_global/index'; /* Tools */ -import { initExport, initFilters } from './js/tools'; +import { initExport, initFilters, initNotifications } from './js/tools'; /* Import shortcuts */ import './js/shortcuts/main'; @@ -34,6 +34,7 @@ $(document).ready(() => { }); initFilters(); initExport(); + initNotifications(); $('#nav-btn-add-tag').on('click', () => { $('.nav-panel-add-tag').toggle(100); @@ -75,4 +76,13 @@ $(document).ready(() => { const scrollPercent = (s / (d - c)) * 100; $('.progress .determinate').css('width', `${scrollPercent}%`); }); + + $('.notification').on('click', () => { + $.ajax({ + url: Routing.generate('notification-archive-all'), + method: 'GET', + }).done(() => { + $('#notifications').sideNav('hide'); + }); + }); }); diff --git a/app/Resources/static/themes/material/js/tools.js b/app/Resources/static/themes/material/js/tools.js index 39398fd8..492640a0 100644 --- a/app/Resources/static/themes/material/js/tools.js +++ b/app/Resources/static/themes/material/js/tools.js @@ -21,4 +21,11 @@ function initExport() { } } -export { initExport, initFilters }; +function initNotifications() { + if ($('div').is('#notifications')) { + $('#button_notifications').show(); + $('.js-notifications-action').sideNav({ edge: 'right' }); + } +} + +export { initExport, initFilters, initNotifications }; diff --git a/src/Wallabag/CoreBundle/Controller/NotificationsController.php b/src/Wallabag/CoreBundle/Controller/NotificationsController.php new file mode 100644 index 00000000..24870b37 --- /dev/null +++ b/src/Wallabag/CoreBundle/Controller/NotificationsController.php @@ -0,0 +1,38 @@ +getDoctrine()->getRepository('WallabagCoreBundle:Notification')->findByUser($this->getUser()); + + return $this->render('WallabagCoreBundle:Notification:notifications.html.twig', ['notifications' => $notifications]); + } + + /** + * @Route("/notifications/readall", name="notification-archive-all") + * + * @param Request $request + * @return Response + */ + public function markAllNotificationsAsReadAction(Request $request) + { + $this->getDoctrine()->getRepository('WallabagCoreBundle:Notification')->markAllAsReadForUser($this->getUser()->getId()); + + return $this->redirectToRoute('notifications-all'); + } +} diff --git a/src/Wallabag/CoreBundle/Entity/Notification.php b/src/Wallabag/CoreBundle/Entity/Notification.php new file mode 100644 index 00000000..e1c1b449 --- /dev/null +++ b/src/Wallabag/CoreBundle/Entity/Notification.php @@ -0,0 +1,220 @@ + + * + * @ORM\Column(name="actions", type="array", nullable=true) + */ + protected $actions; + + protected $actionTypes = []; + + const TYPE_ADMIN = 0; + const TYPE_USER = 1; + const TYPE_RELEASE = 2; + + public function __construct(User $user = null) + { + $this->logger = new NullLogger(); + $this->timestamp = new \DateTime(); + $this->actions = new ArrayCollection(); + $this->read = false; + $this->user = $user; + } + + /** + * @param LoggerInterface $logger + * @return NotificationInterface + */ + public function setLogger(LoggerInterface $logger) + { + $this->logger = $logger; + return $this; + } + + /** + * @return mixed + */ + public function getId() + { + return $this->id; + } + + /** + * @return mixed + */ + public function getType() + { + return $this->type; + } + + /** + * @param mixed $type + * @return NotificationInterface + */ + public function setType($type) + { + $this->type = $type; + return $this; + } + + /** + * @return User + */ + public function getUser() + { + return $this->user; + } + + /** + * @param User $user + * @return NotificationInterface + */ + public function setUser(User $user) + { + $this->user = $user; + return $this; + } + + /** + * @return \DateTime + */ + public function getTimestamp() + { + return $this->timestamp; + } + + /** + * @param \DateTime $timestamp + * @return NotificationInterface + */ + public function setTimestamp(\DateTime $timestamp) + { + $this->timestamp = $timestamp; + return $this; + } + + /** + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * @param string $title + * @return NotificationInterface + */ + public function setTitle($title) + { + $this->title = $title; + return $this; + } + + /** + * @return bool + */ + public function isRead() + { + return $this->read; + } + + /** + * @param bool $read + * @return NotificationInterface + */ + public function setRead($read) + { + $this->read = $read; + return $this; + } + + /** + * @param ActionInterface $action + * @return NotificationInterface + * @throws \InvalidArgumentException + */ + public function addAction(ActionInterface $action) + { + if (isset($this->actionTypes[$action->getType()])) { + throw new \InvalidArgumentException('The notification already has a primary action'); + } + $this->actionTypes[$action->getType()] = true; + $this->actions->add($action); + return $this; + } + + /** + * @return ArrayCollection + */ + public function getActions() + { + return $this->actions; + } +} diff --git a/src/Wallabag/CoreBundle/Notifications/Action.php b/src/Wallabag/CoreBundle/Notifications/Action.php new file mode 100644 index 00000000..8ef1860a --- /dev/null +++ b/src/Wallabag/CoreBundle/Notifications/Action.php @@ -0,0 +1,84 @@ +label; + } + + /** + * @param string $label + * @return ActionInterface + */ + public function setLabel($label) + { + $this->label = $label; + return $this; + } + + /** + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * @param int $type + * @return ActionInterface + * @throws \InvalidArgumentException + */ + public function setType($type) + { + if ($type <= 0 || $type > 4) { + throw new \InvalidArgumentException('The given type option is invalid'); + } + $this->type = $type; + return $this; + } + + /** + * @return string + */ + public function getLink() + { + return $this->link; + } + + /** + * @param string $link + * @return ActionInterface + */ + public function setLink($link) + { + $this->link = $link; + return $this; + } +} diff --git a/src/Wallabag/CoreBundle/Notifications/ActionInterface.php b/src/Wallabag/CoreBundle/Notifications/ActionInterface.php new file mode 100644 index 00000000..0b40237d --- /dev/null +++ b/src/Wallabag/CoreBundle/Notifications/ActionInterface.php @@ -0,0 +1,41 @@ +getEntityManager()->createQueryBuilder() + ->update('WallabagCoreBundle:Notification', 'n') + ->set('n.read', true) + ->where('n.user = :userId')->setParameter('userId', $userId) + ->getQuery() + ->getResult(); + } +} diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 1bd0b8fd..4cfbd9ac 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -37,6 +37,7 @@ menu: search: 'Søg' filter_entries: 'Filtrer artikler' # export: 'Export' + # notifications: 'Notifications' search_form: input_label: 'Indtast søgning' @@ -241,6 +242,13 @@ entry: public: # shared_by_wallabag: "This article has been shared by wallabag" +# notifications: +# sidebar: +# view_more: 'View more' +# list: +# page_title: 'Notifications' +# mark_all_as_read: 'Mark all as read' + about: page_title: 'Om' top_menu: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 94bb3295..4874980e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -37,6 +37,7 @@ menu: search: 'Suche' filter_entries: 'Artikel filtern' export: 'Exportieren' + # notifications: 'Notifications' search_form: input_label: 'Suchbegriff hier eingeben' @@ -242,6 +243,13 @@ entry: public: shared_by_wallabag: "Dieser Artikel wurde mittels wallabag geteilt" +# notifications: +# sidebar: +# view_more: 'View more' +# list: +# page_title: 'Notifications' +# mark_all_as_read: 'Mark all as read' + about: page_title: 'Über' top_menu: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 3a006a0e..308878f4 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -37,6 +37,7 @@ menu: search: 'Search' filter_entries: 'Filter entries' export: 'Export' + notifications: 'Notifications' search_form: input_label: 'Enter your search here' @@ -242,6 +243,13 @@ entry: public: shared_by_wallabag: "This article has been shared by wallabag" +notifications: + sidebar: + view_more: 'View more' + list: + page_title: 'Notifications' + mark_all_as_read: 'Mark all as read' + about: page_title: 'About' top_menu: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index ca5d9b2c..e669268c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -37,6 +37,7 @@ menu: search: 'Buscar' filter_entries: 'Filtrar los artículos' export: 'Exportar' + # notifications: 'Notifications' search_form: input_label: 'Introduzca su búsqueda aquí' @@ -242,6 +243,13 @@ entry: public: shared_by_wallabag: "Este artículo se ha compartido con wallabag" +# notifications: +# sidebar: +# view_more: 'View more' +# list: +# page_title: 'Notifications' +# mark_all_as_read: 'Mark all as read' + about: page_title: 'Acerca de' top_menu: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index ecd8f64d..0b4d7726 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -37,6 +37,7 @@ menu: search: 'جستجو' filter_entries: 'فیلترکردن مقاله‌ها' export: 'برون‌بری' + # notifications: 'Notifications' search_form: input_label: 'جستجوی خود را این‌جا بنویسید:' @@ -242,6 +243,13 @@ entry: public: # shared_by_wallabag: "This article has been shared by wallabag" +# notifications: +# sidebar: +# view_more: 'View more' +# list: +# page_title: 'Notifications' +# mark_all_as_read: 'Mark all as read' + about: page_title: 'درباره' top_menu: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 84706459..660f4d85 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -37,6 +37,7 @@ menu: search: "Rechercher" filter_entries: "Filtrer les articles" export: "Exporter" + notifications: 'Notifications' search_form: input_label: "Saisissez votre terme de recherche" @@ -242,6 +243,13 @@ entry: public: shared_by_wallabag: "Cet article a été partagé par wallabag" +notifications: + sidebar: + view_more: 'Voir plus' + list: + page_title: 'Notifications' + mark_all_as_read: 'Marquer tout comme lu' + about: page_title: "À propos" top_menu: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index a8baa96f..56ff5bc0 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -37,6 +37,7 @@ menu: search: 'Cerca' filter_entries: 'Filtra contenuti' export: 'Esporta' + # notifications: 'Notifications' search_form: input_label: 'Inserisci qui la tua ricerca' @@ -242,6 +243,13 @@ entry: public: # shared_by_wallabag: "This article has been shared by wallabag" +# notifications: +# sidebar: +# view_more: 'View more' +# list: +# page_title: 'Notifications' +# mark_all_as_read: 'Mark all as read' + about: page_title: 'About' top_menu: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 8f39ce05..219478bc 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -37,6 +37,7 @@ menu: search: 'Cercar' filter_entries: 'Filtrar los articles' export: 'Exportar' + # notifications: 'Notifications' search_form: input_label: 'Picatz vòstre mot-clau a cercar aquí' @@ -242,6 +243,13 @@ entry: public: shared_by_wallabag: "Aqueste article es estat partejat per wallabag" +# notifications: +# sidebar: +# view_more: 'View more' +# list: +# page_title: 'Notifications' +# mark_all_as_read: 'Mark all as read' + about: page_title: 'A prepaus' top_menu: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index a6e0c10f..3662f9ab 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -37,6 +37,7 @@ menu: search: 'Szukaj' filter_entries: 'Filtruj wpisy' export: 'Eksportuj' + # notifications: 'Notifications' search_form: input_label: 'Wpisz swoje zapytanie tutaj' @@ -242,6 +243,13 @@ entry: public: shared_by_wallabag: "Ten artykuł został udostępniony przez wallabag" +# notifications: +# sidebar: +# view_more: 'View more' +# list: +# page_title: 'Notifications' +# mark_all_as_read: 'Mark all as read' + about: page_title: 'O nas' top_menu: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index a9473591..fa504617 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -37,6 +37,7 @@ menu: search: 'Pesquisa' filter_entries: 'Filtrar entradas' export: 'Exportar' + # notifications: 'Notifications' search_form: input_label: 'Digite aqui sua pesquisa' @@ -242,6 +243,13 @@ entry: public: shared_by_wallabag: "Este artigo foi compartilhado pelo wallabag" +# notifications: +# sidebar: +# view_more: 'View more' +# list: +# page_title: 'Notifications' +# mark_all_as_read: 'Mark all as read' + about: page_title: 'Sobre' top_menu: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 80d78a01..c5ecedc1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -37,6 +37,7 @@ menu: search: 'Căutare' filter_entries: 'Filtrează articolele' # export: 'Export' + # notifications: 'Notifications' search_form: input_label: 'Introdu căutarea ta' @@ -242,6 +243,13 @@ entry: public: # shared_by_wallabag: "This article has been shared by wallabag" +# notifications: +# sidebar: +# view_more: 'View more' +# list: +# page_title: 'Notifications' +# mark_all_as_read: 'Mark all as read' + about: page_title: 'Despre' top_menu: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 2896c823..62d58428 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -37,6 +37,7 @@ menu: search: 'Ara' filter_entries: 'Filtrele' export: 'Dışa Aktar' + # notifications: 'Notifications' search_form: input_label: 'Aramak istediğiniz herhangi bir şey yazın' @@ -242,6 +243,13 @@ entry: public: # shared_by_wallabag: "This article has been shared by wallabag" +# notifications: +# sidebar: +# view_more: 'View more' +# list: +# page_title: 'Notifications' +# mark_all_as_read: 'Mark all as read' + about: page_title: 'Hakkımızda' top_menu: 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 b3f0affb..575770d6 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 9b0816eb..67073c7d 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 b2d91c9c..b74d32b7 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 @@ -12,6 +12,7 @@ {% endblock %} {% block content %} + {{ parent() }} {% set listMode = app.user.config.listMode %}
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..bc72c704 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Notification/notifications.html.twig @@ -0,0 +1,42 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{{ 'notifications.list.page_title' | trans }}{% endblock %} + +{% block content %} +
+
+
    + {% 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 }} +

    {{ notification.timestamp | date }}

    +
    + {% for action in notification.actions %} + {{ action.label }} + {% endfor %} +
    +
  • + {% endfor %} +
+ {{ 'notifications.list.mark_all_as_read' | trans }} +
+
+{% 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 c83543ac..01dc4c6a 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 2dab1c18..6e2828de 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig @@ -105,6 +105,13 @@ search +
  • + {% set unreadNotifs = app.user.notifications | unread_notif | length %} + + notifications{% if unreadNotifs == 0 %}_none{% endif %} + {% if unreadNotifs > 0 %}{{ unreadNotifs }}{% endif %} + +
  • filter_list @@ -130,6 +137,44 @@ {% endblock %} +{% block content %} + + +{% endblock %} + {% block footer %}