]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
First draft for notifications
authorThomas Citharel <tcit@tcit.fr>
Fri, 12 May 2017 13:02:32 +0000 (15:02 +0200)
committerThomas Citharel <tcit@tcit.fr>
Fri, 23 Jun 2017 08:02:45 +0000 (10:02 +0200)
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
19 files changed:
app/Resources/static/themes/material/index.js
src/Wallabag/CoreBundle/Controller/NotificationsController.php
src/Wallabag/CoreBundle/Entity/Notification.php
src/Wallabag/CoreBundle/Notifications/Action.php
src/Wallabag/CoreBundle/Notifications/ActionInterface.php
src/Wallabag/CoreBundle/Notifications/NotificationInterface.php
src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
src/Wallabag/CoreBundle/Twig/WallabagExtension.php

index 435cd02f1a69f26f878fb32d3a1a27df20a48f30..e16749f6d9c310f522324ab04b237bf8847c72fa 100755 (executable)
@@ -76,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');
+    });
+  });
 });
index 17e576cdaa12a2f22b0572bd7ef51bdf16e7abf1..ec7bf3c0ab3ca4040afc50eeb2794616d2ed2224 100644 (file)
@@ -40,6 +40,7 @@ class NotificationsController extends Controller
             'notifications' => $notifications,
             'currentPage' => $page,
         ]);
+
     }
 
     /**
index 6b30b0449d5d5c3aa4f00d915bc8e8d93d9ea876..aa4c03c335ccace6d8c820bc04a0a5a0cb7f9694 100644 (file)
@@ -12,6 +12,7 @@ use Wallabag\UserBundle\Entity\User;
 
 /**
  * Class Notification.
+ * Class Notification
  *
  * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\NotificationRepository")
  * @ORM\Table(name="`notification`")
@@ -24,32 +25,32 @@ class Notification implements NotificationInterface
      * @ORM\Column(name="id", type="integer")
      * @ORM\Id
      * @ORM\GeneratedValue(strategy="AUTO")
+     *
      */
     protected $id;
 
     /**
-     * @var int
+     * @var int $type
      *
      * @ORM\Column(name="type", type="integer")
      */
     protected $type;
 
     /**
-     * @var User
+     * @var User $user
      *
      * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="notifications")
      */
     protected $user;
 
     /**
-     * @var \DateTime
      *
      * @ORM\Column(name="timestamp", type="datetime")
      */
     protected $timestamp;
 
     /**
-     * @var string
+     * @var string $title
      *
      * @ORM\Column(name="title", type="string")
      */
@@ -63,7 +64,7 @@ class Notification implements NotificationInterface
     protected $description;
 
     /**
-     * @var bool
+     * @var boolean $read
      *
      * @ORM\Column(name="read", type="boolean")
      */
@@ -225,7 +226,6 @@ class Notification implements NotificationInterface
      * @param ActionInterface $action
      *
      * @return NotificationInterface
-     *
      * @throws \InvalidArgumentException
      */
     public function addAction(ActionInterface $action)
@@ -235,7 +235,6 @@ class Notification implements NotificationInterface
         }
         $this->actionTypes[$action->getType()] = true;
         $this->actions->add($action);
-
         return $this;
     }
 
index d032adf9568bc0e4305bd1366d65be032ff22ed7..d92ffe54d992cd222e83026e70db074f6fb87659 100644 (file)
@@ -56,7 +56,6 @@ class Action implements ActionInterface
      * @param int $type
      *
      * @return ActionInterface
-     *
      * @throws \InvalidArgumentException
      */
     public function setType($type)
index e166e45b006a053f895a51f23221119949906db5..d6bb0fcc34c42bb4936311dd1ea98c889f21d289 100644 (file)
@@ -4,6 +4,7 @@ namespace Wallabag\CoreBundle\Notifications;
 
 interface ActionInterface
 {
+
     /**
      * @return string
      */
index 4a3c27594b5216a105f4a3a2e382a2a86850c71f..fa226487d9caeb7013425778b9c06ba6f3497ea5 100644 (file)
@@ -37,12 +37,12 @@ interface NotificationInterface extends LoggerAwareInterface
     /**
      * If the notification has been viewed / dismissed or not.
      *
-     * @return bool
+     * @return boolean
      */
     public function isRead();
 
     /**
-     * @param bool $read
+     * @param boolean $read
      *
      * @return NotificationInterface
      */
index ad03fa910a6938f5881e52ce87f46b6e6c2ca1b9..906b8396dba08028db139d9ab8bf6f3888892777 100644 (file)
@@ -262,6 +262,13 @@ entry:
 #         title: "wallabag has been updated to version %version%"
 #         details: "View update's details"
 
+# notifications:
+#     sidebar:
+#         view_more: 'View more'
+#     list:
+#         page_title: 'Notifications'
+#         mark_all_as_read: 'Mark all as read'
+
 about:
     page_title: 'Om'
     top_menu:
index f2d75a62b47e36a63c813795c2ebf0e5e853c372..c0e583c4695c71742d2c172db9942509b33e57a3 100644 (file)
@@ -262,6 +262,13 @@ entry:
 #         title: "wallabag has been updated to version %version%"
 #         details: "View update's details"
 
+# notifications:
+#     sidebar:
+#         view_more: 'View more'
+#     list:
+#         page_title: 'Notifications'
+#         mark_all_as_read: 'Mark all as read'
+
 about:
     page_title: 'Über'
     top_menu:
index 228dd87e611c0708ad46b555c6bd1d7b707ac8dc..98f1b48ce28772141d293ae3a0df2ae8aadd82dd 100644 (file)
@@ -261,6 +261,7 @@ notifications:
     release:
         title: "wallabag has been updated to version %version%"
         details: "View update's details"
+
 about:
     page_title: 'About'
     top_menu:
index 28f064c77da2e1756143c6b0d266dc05975d0d89..2c3a005c7e7a280e029f307502cecf7d0b55e6f2 100644 (file)
@@ -262,6 +262,13 @@ entry:
 #         title: "wallabag has been updated to version %version%"
 #         details: "View update's details"
 
+# 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:
index 4496a2f24f3aada6fffe701131c039b821a314d1..8f0392e0542b20f290a24f60373c13ba84750e29 100644 (file)
@@ -262,6 +262,13 @@ entry:
 #         title: "wallabag has been updated to version %version%"
 #         details: "View update's details"
 
+# notifications:
+#     sidebar:
+#         view_more: 'View more'
+#     list:
+#         page_title: 'Notifications'
+#         mark_all_as_read: 'Mark all as read'
+
 about:
     page_title: 'درباره'
     top_menu:
index 8bccc8a4d13497f32100480edc5780ad8da369fd..277f2f63cd3fc3badf6b7882edaf05567cfc4f66 100644 (file)
@@ -262,6 +262,13 @@ notifications:
         title: "wallabag a été mis à jour vers la version %version%"
         details: "Voir les détails de la mise à jour"
 
+notifications:
+    sidebar:
+        view_more: 'Voir plus'
+    list:
+        page_title: 'Notifications'
+        mark_all_as_read: 'Marquer tout comme lu'
+
 about:
     page_title: "À propos"
     top_menu:
index c404b3e54a1f29eca26266bae4f3c70cfc3bb28d..3edd4973168d42124e50db7317042c941a376f4a 100644 (file)
@@ -261,6 +261,7 @@ entry:
 #     release:
 #         title: "wallabag has been updated to version %version%"
 #         details: "View update's details"
+
 about:
     page_title: 'A proposito'
     top_menu:
index af9d85c367a86fc935f3d88eb3aa40858574bae3..cd690e9fdd82744b057d41a752fca81b2c958c1f 100644 (file)
@@ -262,6 +262,13 @@ entry:
 #         title: "wallabag has been updated to version %version%"
 #         details: "View update's details"
 
+# 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:
index 78464162f04477166590c88f795eb61cc60c9282..de357bfe7f3c3db02260051d75499c1300d30f01 100644 (file)
@@ -262,6 +262,13 @@ entry:
 #         title: "wallabag has been updated to version %version%"
 #         details: "View update's details"
 
+# 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:
index 07eeefc26044927482e30ce46783b4665eb988ee..2d71cb9d63e3404859e1f9900775b5873f9d40d9 100644 (file)
@@ -262,6 +262,13 @@ entry:
 #         title: "wallabag has been updated to version %version%"
 #         details: "View update's details"
 
+# notifications:
+#     sidebar:
+#         view_more: 'View more'
+#     list:
+#         page_title: 'Notifications'
+#         mark_all_as_read: 'Mark all as read'
+
 about:
     page_title: 'Sobre'
     top_menu:
index ba7b11d543e48fa010c757fde2a0b7524399a2a1..f295378d0da68aa7f48a558142635f9efffb456c 100644 (file)
@@ -262,6 +262,13 @@ entry:
 #         title: "wallabag has been updated to version %version%"
 #         details: "View update's details"
 
+# notifications:
+#     sidebar:
+#         view_more: 'View more'
+#     list:
+#         page_title: 'Notifications'
+#         mark_all_as_read: 'Mark all as read'
+
 about:
     page_title: 'Despre'
     top_menu:
index 6cbe6dcda5c5945c12a0c208424a8cb699f35bd3..8b791b4861a73fe67ce39e9eda2bfbdd10897071 100644 (file)
@@ -260,6 +260,13 @@ entry:
 #         title: "wallabag has been updated to version %version%"
 #         details: "View update's details"
 
+# 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:
index 034b3fa2153ed824331566fcb892b9f6cc139e38..71dd7c2a6dab1e9366a4ce153f29719801b5d2c5 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace Wallabag\CoreBundle\Twig;
 
+use Doctrine\Common\Collections\Collection;
 use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
 use Wallabag\CoreBundle\Notifications\NotificationInterface;
 use Wallabag\CoreBundle\Repository\EntryRepository;