X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FController%2FEntryController.php;h=006fa396476019c3055ed9c83da58b6f542acdba;hb=8ce32af61229eec8f4cc34b207273d47f60adc48;hp=8894690ced079e07c971dd8d7dba1567df28be08;hpb=2686457448372543fdf4f1fc54c4fd20f0f02c2c;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 8894690c..006fa396 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -18,11 +18,11 @@ class EntryController extends Controller /** * @param Request $request * - * @Route("/new", name="new_entry") + * @Route("/new-entry", name="new_entry") * * @return \Symfony\Component\HttpFoundation\Response */ - public function addEntryAction(Request $request) + public function addEntryFormAction(Request $request) { $entry = new Entry($this->getUser()); @@ -48,11 +48,23 @@ class EntryController extends Controller return $this->redirect($this->generateUrl('homepage')); } - return $this->render('WallabagCoreBundle:Entry:new.html.twig', array( + return $this->render('WallabagCoreBundle:Entry:new_form.html.twig', array( 'form' => $form->createView(), )); } + /** + * @param Request $request + * + * @Route("/new", name="new") + * + * @return \Symfony\Component\HttpFoundation\Response + */ + public function addEntryAction(Request $request) + { + return $this->render('WallabagCoreBundle:Entry:new.html.twig'); + } + /** * Edit an entry content. * @@ -124,9 +136,9 @@ class EntryController extends Controller return $this->render( 'WallabagCoreBundle:Entry:entries.html.twig', array( - 'form' => $form->createView(), - 'entries' => $entries, - 'currentPage' => $page + 'form' => $form->createView(), + 'entries' => $entries, + 'currentPage' => $page, ) ); } @@ -166,9 +178,9 @@ class EntryController extends Controller return $this->render( 'WallabagCoreBundle:Entry:entries.html.twig', array( - 'form' => $form->createView(), - 'entries' => $entries, - 'currentPage' => $page + 'form' => $form->createView(), + 'entries' => $entries, + 'currentPage' => $page, ) ); } @@ -208,9 +220,9 @@ class EntryController extends Controller return $this->render( 'WallabagCoreBundle:Entry:entries.html.twig', array( - 'form' => $form->createView(), - 'entries' => $entries, - 'currentPage' => $page + 'form' => $form->createView(), + 'entries' => $entries, + 'currentPage' => $page, ) ); } @@ -253,7 +265,7 @@ class EntryController extends Controller $this->get('session')->getFlashBag()->add( 'notice', - 'Entry archived' + 'Entry '.($entry->isArchived() ? 'archived' : 'unarchived') ); return $this->redirect($request->headers->get('referer')); @@ -278,7 +290,7 @@ class EntryController extends Controller $this->get('session')->getFlashBag()->add( 'notice', - 'Entry starred' + 'Entry '.($entry->isStarred() ? 'starred' : 'unstarred') ); return $this->redirect($request->headers->get('referer'));