]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Controller/EntryController.php
CS
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Controller / EntryController.php
index 8894690ced079e07c971dd8d7dba1567df28be08..006fa396476019c3055ed9c83da58b6f542acdba 100644 (file)
@@ -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'));