From: Nicolas LÅ“uillet Date: Wed, 12 Aug 2015 06:22:30 +0000 (+0200) Subject: add new post form in material header X-Git-Tag: 2.0.0-alpha.0~46^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=053b9568b2e3d032720d405bc1c2b71eccb36714;hp=-c;p=github%2Fwallabag%2Fwallabag.git add new post form in material header --- 053b9568b2e3d032720d405bc1c2b71eccb36714 diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 29e0ffb0..ef686ff1 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -15,11 +15,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()); @@ -45,11 +45,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. * diff --git a/src/Wallabag/CoreBundle/Resources/views/Entry/new.html.twig b/src/Wallabag/CoreBundle/Resources/views/Entry/new.html.twig index b11512a4..95ed0785 100644 --- a/src/Wallabag/CoreBundle/Resources/views/Entry/new.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Entry/new.html.twig @@ -3,5 +3,5 @@ {% block title %}{% trans %}Save new entry{% endtrans %}{% endblock %} {% block content %} - {{ form(form) }} + {{ render(controller( "WallabagCoreBundle:Entry:addEntryForm" )) }} {% endblock %} diff --git a/src/Wallabag/CoreBundle/Resources/views/Entry/new_form.html.twig b/src/Wallabag/CoreBundle/Resources/views/Entry/new_form.html.twig new file mode 100644 index 00000000..d182d552 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/Entry/new_form.html.twig @@ -0,0 +1,15 @@ +
+ + {% if form_errors(form) %} + {{ form_errors(form) }} + {% endif %} + + {% if form_errors(form.url) %} + {{ form_errors(form.url) }} + {% endif %} + + {{ form_label(form.url) }} + {{ form_widget(form.url) }} + + +
diff --git a/src/Wallabag/CoreBundle/Resources/views/Static/howto.html.twig b/src/Wallabag/CoreBundle/Resources/views/Static/howto.html.twig index c69c03c3..58cb316b 100644 --- a/src/Wallabag/CoreBundle/Resources/views/Static/howto.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Static/howto.html.twig @@ -7,7 +7,7 @@

{% trans %}There are several ways to save an article:{% endtrans %}

{% trans %}Browser Addons{% endtrans %}