aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller')
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php42
-rw-r--r--src/Wallabag/CoreBundle/Controller/RssController.php21
2 files changed, 39 insertions, 24 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index 4a7a0644..49714d02 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -89,60 +89,72 @@ class EntryController extends Controller
89 /** 89 /**
90 * Shows unread entries for current user. 90 * Shows unread entries for current user.
91 * 91 *
92 * @Route("/unread", name="unread") 92 * @Route("/unread/list/{page}", name="unread", defaults={"page" = "1"})
93 * 93 *
94 * @return \Symfony\Component\HttpFoundation\Response 94 * @return \Symfony\Component\HttpFoundation\Response
95 */ 95 */
96 public function showUnreadAction() 96 public function showUnreadAction($page)
97 { 97 {
98 // TODO change pagination
99 $entries = $this->getDoctrine() 98 $entries = $this->getDoctrine()
100 ->getRepository('WallabagCoreBundle:Entry') 99 ->getRepository('WallabagCoreBundle:Entry')
101 ->findUnreadByUser($this->getUser()->getId(), 0); 100 ->findUnreadByUser($this->getUser()->getId());
101
102 $entries->setCurrentPage($page);
102 103
103 return $this->render( 104 return $this->render(
104 'WallabagCoreBundle:Entry:entries.html.twig', 105 'WallabagCoreBundle:Entry:entries.html.twig',
105 array('entries' => $entries) 106 array(
107 'entries' => $entries,
108 'currentPage' => $page
109 )
106 ); 110 );
107 } 111 }
108 112
109 /** 113 /**
110 * Shows read entries for current user. 114 * Shows read entries for current user.
111 * 115 *
112 * @Route("/archive", name="archive") 116 * @Route("/archive/list/{page}", name="archive", defaults={"page" = "1"})
113 * 117 *
114 * @return \Symfony\Component\HttpFoundation\Response 118 * @return \Symfony\Component\HttpFoundation\Response
115 */ 119 */
116 public function showArchiveAction() 120 public function showArchiveAction($page)
117 { 121 {
118 // TODO change pagination
119 $entries = $this->getDoctrine() 122 $entries = $this->getDoctrine()
120 ->getRepository('WallabagCoreBundle:Entry') 123 ->getRepository('WallabagCoreBundle:Entry')
121 ->findArchiveByUser($this->getUser()->getId(), 0); 124 ->findArchiveByUser($this->getUser()->getId());
125
126 $entries->setCurrentPage($page);
122 127
123 return $this->render( 128 return $this->render(
124 'WallabagCoreBundle:Entry:entries.html.twig', 129 'WallabagCoreBundle:Entry:entries.html.twig',
125 array('entries' => $entries) 130 array(
131 'entries' => $entries,
132 'currentPage' => $page
133 )
126 ); 134 );
127 } 135 }
128 136
129 /** 137 /**
130 * Shows starred entries for current user. 138 * Shows starred entries for current user.
131 * 139 *
132 * @Route("/starred", name="starred") 140 * @Route("/starred/list/{page}", name="starred", defaults={"page" = "1"})
133 * 141 *
134 * @return \Symfony\Component\HttpFoundation\Response 142 * @return \Symfony\Component\HttpFoundation\Response
135 */ 143 */
136 public function showStarredAction() 144 public function showStarredAction($page)
137 { 145 {
138 // TODO change pagination
139 $entries = $this->getDoctrine() 146 $entries = $this->getDoctrine()
140 ->getRepository('WallabagCoreBundle:Entry') 147 ->getRepository('WallabagCoreBundle:Entry')
141 ->findStarredByUser($this->getUser()->getId(), 0); 148 ->findStarredByUser($this->getUser()->getId());
149
150 $entries->setCurrentPage($page);
142 151
143 return $this->render( 152 return $this->render(
144 'WallabagCoreBundle:Entry:entries.html.twig', 153 'WallabagCoreBundle:Entry:entries.html.twig',
145 array('entries' => $entries) 154 array(
155 'entries' => $entries,
156 'currentPage' => $page
157 )
146 ); 158 );
147 } 159 }
148 160
diff --git a/src/Wallabag/CoreBundle/Controller/RssController.php b/src/Wallabag/CoreBundle/Controller/RssController.php
index 86754e15..8428dce0 100644
--- a/src/Wallabag/CoreBundle/Controller/RssController.php
+++ b/src/Wallabag/CoreBundle/Controller/RssController.php
@@ -23,11 +23,12 @@ class RssController extends Controller
23 $entries = $this->getDoctrine() 23 $entries = $this->getDoctrine()
24 ->getRepository('WallabagCoreBundle:Entry') 24 ->getRepository('WallabagCoreBundle:Entry')
25 ->findUnreadByUser( 25 ->findUnreadByUser(
26 $user->getId(), 26 $user->getId()
27 0,
28 $user->getConfig()->getRssLimit() ?: $this->container->getParameter('rss_limit')
29 ); 27 );
30 28
29 $perPage = $user->getConfig()->getRssLimit() ?: $this->container->getParameter('rss_limit');
30 $entries->setMaxPerPage($perPage);
31
31 return $this->render('WallabagCoreBundle:Entry:entries.xml.twig', array( 32 return $this->render('WallabagCoreBundle:Entry:entries.xml.twig', array(
32 'type' => 'unread', 33 'type' => 'unread',
33 'entries' => $entries, 34 'entries' => $entries,
@@ -47,11 +48,12 @@ class RssController extends Controller
47 $entries = $this->getDoctrine() 48 $entries = $this->getDoctrine()
48 ->getRepository('WallabagCoreBundle:Entry') 49 ->getRepository('WallabagCoreBundle:Entry')
49 ->findArchiveByUser( 50 ->findArchiveByUser(
50 $user->getId(), 51 $user->getId()
51 0,
52 $user->getConfig()->getRssLimit() ?: $this->container->getParameter('rss_limit')
53 ); 52 );
54 53
54 $perPage = $user->getConfig()->getRssLimit() ?: $this->container->getParameter('rss_limit');
55 $entries->setMaxPerPage($perPage);
56
55 return $this->render('WallabagCoreBundle:Entry:entries.xml.twig', array( 57 return $this->render('WallabagCoreBundle:Entry:entries.xml.twig', array(
56 'type' => 'archive', 58 'type' => 'archive',
57 'entries' => $entries, 59 'entries' => $entries,
@@ -71,11 +73,12 @@ class RssController extends Controller
71 $entries = $this->getDoctrine() 73 $entries = $this->getDoctrine()
72 ->getRepository('WallabagCoreBundle:Entry') 74 ->getRepository('WallabagCoreBundle:Entry')
73 ->findStarredByUser( 75 ->findStarredByUser(
74 $user->getId(), 76 $user->getId()
75 0,
76 $user->getConfig()->getRssLimit() ?: $this->container->getParameter('rss_limit')
77 ); 77 );
78 78
79 $perPage = $user->getConfig()->getRssLimit() ?: $this->container->getParameter('rss_limit');
80 $entries->setMaxPerPage($perPage);
81
79 return $this->render('WallabagCoreBundle:Entry:entries.xml.twig', array( 82 return $this->render('WallabagCoreBundle:Entry:entries.xml.twig', array(
80 'type' => 'starred', 83 'type' => 'starred',
81 'entries' => $entries, 84 'entries' => $entries,