diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/EntryController.php | 7 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/StaticController.php | 11 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 37f7ab60..3d22c7bc 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php | |||
@@ -166,6 +166,11 @@ class EntryController extends Controller | |||
166 | */ | 166 | */ |
167 | public function showUnreadAction(Request $request, $page) | 167 | public function showUnreadAction(Request $request, $page) |
168 | { | 168 | { |
169 | // load the quickstart if no entry in database | ||
170 | if ($page == 1 && $this->get('wallabag_core.entry_repository')->countAllEntriesByUsername($this->getUser()->getId()) == 0) { | ||
171 | return $this->redirect($this->generateUrl('quickstart')); | ||
172 | } | ||
173 | |||
169 | return $this->showEntries('unread', $request, $page); | 174 | return $this->showEntries('unread', $request, $page); |
170 | } | 175 | } |
171 | 176 | ||
@@ -211,7 +216,7 @@ class EntryController extends Controller | |||
211 | */ | 216 | */ |
212 | private function showEntries($type, Request $request, $page) | 217 | private function showEntries($type, Request $request, $page) |
213 | { | 218 | { |
214 | $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry'); | 219 | $repository = $this->get('wallabag_core.entry_repository'); |
215 | 220 | ||
216 | switch ($type) { | 221 | switch ($type) { |
217 | case 'starred': | 222 | case 'starred': |
diff --git a/src/Wallabag/CoreBundle/Controller/StaticController.php b/src/Wallabag/CoreBundle/Controller/StaticController.php index 64875a66..9ada371b 100644 --- a/src/Wallabag/CoreBundle/Controller/StaticController.php +++ b/src/Wallabag/CoreBundle/Controller/StaticController.php | |||
@@ -28,4 +28,15 @@ class StaticController extends Controller | |||
28 | array() | 28 | array() |
29 | ); | 29 | ); |
30 | } | 30 | } |
31 | |||
32 | /** | ||
33 | * @Route("/quickstart", name="quickstart") | ||
34 | */ | ||
35 | public function quickstartAction() | ||
36 | { | ||
37 | return $this->render( | ||
38 | 'WallabagCoreBundle:Static:quickstart.html.twig', | ||
39 | array() | ||
40 | ); | ||
41 | } | ||
31 | } | 42 | } |