Quickstart for beginners

This commit is contained in:
Nicolas Lœuillet
2016-01-09 14:34:49 +01:00
committed by Nicolas Lœuillet
parent 0aafb8dfcb
commit 5c072d2b57
12 changed files with 227 additions and 15 deletions

View File

@ -166,6 +166,11 @@ class EntryController extends Controller
*/
public function showUnreadAction(Request $request, $page)
{
// load the quickstart if no entry in database
if ($page == 1 && $this->get('wallabag_core.entry_repository')->countAllEntriesByUsername($this->getUser()->getId()) == 0) {
return $this->redirect($this->generateUrl('quickstart'));
}
return $this->showEntries('unread', $request, $page);
}
@ -211,7 +216,7 @@ class EntryController extends Controller
*/
private function showEntries($type, Request $request, $page)
{
$repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry');
$repository = $this->get('wallabag_core.entry_repository');
switch ($type) {
case 'starred':

View File

@ -28,4 +28,15 @@ class StaticController extends Controller
array()
);
}
/**
* @Route("/quickstart", name="quickstart")
*/
public function quickstartAction()
{
return $this->render(
'WallabagCoreBundle:Static:quickstart.html.twig',
array()
);
}
}