/**
* @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());
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.
*
{% block title %}{% trans %}Save new entry{% endtrans %}{% endblock %}
{% block content %}
- {{ form(form) }}
+ {{ render(controller( "WallabagCoreBundle:Entry:addEntryForm" )) }}
{% endblock %}
--- /dev/null
+<form name="entry" method="post" action="{{ path('new_entry')}}">
+
+ {% if form_errors(form) %}
+ <span class="black-text">{{ form_errors(form) }}</span>
+ {% endif %}
+
+ {% if form_errors(form.url) %}
+ <span class="black-text">{{ form_errors(form.url) }}</span>
+ {% endif %}
+
+ {{ form_label(form.url) }}
+ {{ form_widget(form.url) }}
+
+ <div class="hidden">{{ form_rest(form) }}</div>
+</form>
<p>{% trans %}There are several ways to save an article:{% endtrans %}</p>
<ul>
- <li><a href="{{ path('new_entry') }}">{% trans %}Thanks to this form{% endtrans %}</a></li>
+ <li><a href="{{ path('new') }}">{% trans %}Thanks to this form{% endtrans %}</a></li>
</ul>
<h3>{% trans %}Browser Addons{% endtrans %}</h3>
<ul>
<li><a href="{{ path('starred') }}">{% trans %}favorites{% endtrans %}</a></li>
<li><a href="{{ path('archive') }}"}>{% trans %}archive{% endtrans %}</a></li>
<li><a href="{{ path ('tag') }}">{% trans %}tags{% endtrans %}</a></li>
- <li><a href="{{ path('new_entry') }}">{% trans %}save a link{% endtrans %}</a></li>
+ <li><a href="{{ path('new') }}">{% trans %}save a link{% endtrans %}</a></li>
<li style="position: relative;"><a href="javascript: void(null);" id="search">{% trans %}search{% endtrans %}</a>
<div id="search-form" class="messages info popup-form">
<form method="get" action="index.php">
{% block title %}{% trans %}Save new entry{% endtrans %}{% endblock %}
{% block content %}
- <div class="row">
- <div class="col s12">
- <div class="card-panel">
-
- <form name="entry" method="post" action="">
- <div class="card-content">
-
- {% if form_errors(form) %}
- <span class="black-text">{{ form_errors(form) }}</span>
- {% endif %}
-
- {% if form_errors(form.url) %}
- <span class="black-text">{{ form_errors(form.url) }}</span>
- {% endif %}
-
- <div class="input-field s12">
- {{ form_label(form.url) }}
- {{ form_widget(form.url) }}
- </div>
-
- <button class="btn waves-effect waves-light" type="submit" name="entry[save]">
- {% trans %}Save{% endtrans %}
- <i class="mdi-content-send right"></i>
- </button>
- </div>
- <div class="hidden">{{ form_rest(form) }}</div>
- </form>
-
-
- {{ form(form) }}
-
- </div>
- </div>
- </div>
+ {{ render(controller( "WallabagCoreBundle:Entry:addEntryForm" )) }}
{% endblock %}
--- /dev/null
+<form name="entry" method="post" action="{{ path('new_entry')}}">
+
+ {% if form_errors(form) %}
+ <span class="black-text">{{ form_errors(form) }}</span>
+ {% endif %}
+
+ {% if form_errors(form.url) %}
+ <span class="black-text">{{ form_errors(form.url) }}</span>
+ {% endif %}
+
+ {{ form_widget(form.url) }}
+
+ <div class="hidden">{{ form_rest(form) }}</div>
+</form>
<div id="set1" class="col s12">
- <a href="{{ path('new_entry') }}">{% trans %}Thanks to this form{% endtrans %}</a>
+ <a href="{{ path('new') }}">{% trans %}Thanks to this form{% endtrans %}</a>
</div>
</div>
<div class="input-field nav-panel-buttom">
<ul>
- <li class="bold"><a class="waves-effect" href="{{ path('new_entry') }}" id="nav-btn-add"><i class="mdi-content-add"></i></a></li>
+ <li class="bold"><a class="waves-effect" href="{{ path('new') }}" id="nav-btn-add"><i class="mdi-content-add"></i></a></li>
<li><a class="waves-effect" href="javascript: void(null);" id="nav-btn-search"><i class="mdi-action-search"></i></a>
</ul>
</div>
<i class="mdi-navigation-close"></i>
</div>
</form>
+ <div class="input-field nav-panel-add" style="display: none">
+ {{ render(controller( "WallabagCoreBundle:Entry:addEntryForm" )) }}
+ <label for="add"><i class="mdi-content-add"></i></label>
+ <i class="mdi-navigation-close"></i>
+ </div>
<!--<form name="entry" method="post" action="{{ path('new_entry') }}">
<div class="input-field nav-panel-add" style="display: none">
<input id="add entry_url" name="entry[url]" type="search" required placeholder="{% trans %}Enter your link here{% endtrans %}">
</div>
</div>
</footer>
-{% endblock %}
\ No newline at end of file
+{% endblock %}
accordion : false
});
- //$('#nav-btn-add').click(function(){
- // $(".nav-panel-buttom").hide(100);
- // $(".nav-panel-add").show(100);
- // $(".nav-panel-menu").hide(100);
- // $(".nav-panels .action").hide(100);
- // $(".nav-panel-menu").addClass('hidden');
- // $(".nav-panels").css('background', 'white');
- // return false;
- //});
+ $('#nav-btn-add').click(function(){
+ $(".nav-panel-buttom").hide(100);
+ $(".nav-panel-add").show(100);
+ $(".nav-panel-menu").hide(100);
+ $(".nav-panels .action").hide(100);
+ $(".nav-panel-menu").addClass('hidden');
+ $(".nav-panels").css('background', 'white');
+ $("#entry_url").focus();
+ return false;
+ });
$('#nav-btn-search').click(function(){
$(".nav-panel-buttom").hide(100);
$(".nav-panel-search").show(100);