]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Controller/EntryController.php
Added route to list entries with annotations
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Controller / EntryController.php
index ba5bfbe2916540ca7f2564d2f06891b6acd96ead..2c4b5536edc634f1a41087a385222cf1859b0f13 100644 (file)
@@ -235,12 +235,26 @@ class EntryController extends Controller
         return $this->showEntries('untagged', $request, $page);
     }
 
+    /**
+     * Shows entries with annotations for current user.
+     *
+     * @param int $page
+     *
+     * @Route("/with_annotations/list/{page}", name="with_annotations", defaults={"page" = "1"})
+     *
+     * @return \Symfony\Component\HttpFoundation\Response
+     */
+    public function showWithAnnotationsEntriesAction(Request $request, $page)
+    {
+        return $this->showEntries('with_annotations', $request, $page);
+    }
+
     /**
      * Shows random entry depending on the given type.
      *
      * @param string $type
      *
-     * @Route("/{type}/random", name="random_entry", requirements={"type": "unread|starred|archive|untagged|all"})
+     * @Route("/{type}/random", name="random_entry", requirements={"type": "unread|starred|archive|untagged|with_annotations|all"})
      *
      * @return \Symfony\Component\HttpFoundation\RedirectResponse
      */
@@ -503,6 +517,9 @@ class EntryController extends Controller
             case 'archive':
                 $qb = $repository->getBuilderForArchiveByUser($this->getUser()->getId());
                 break;
+            case 'with_annotations':
+                $qb = $repository->getBuilderForAnnotationsByUser($this->getUser()->getId());
+                break;
             case 'unread':
                 $qb = $repository->getBuilderForUnreadByUser($this->getUser()->getId());
                 break;