From: Raphaƫl Gertz Date: Wed, 11 Dec 2019 04:32:01 +0000 (+0100) Subject: Add recover form directly on login page when it failed X-Git-Tag: 0.1.1~31 X-Git-Url: https://git.rapsys.eu/.gitweb.cgi/airbundle/commitdiff_plain/1b404150ed3091d73848a272fed24d96a2366bad?ds=sidebyside;hp=0f1e9d0ce90560631d35dd27aa3db2f26f6964c7 Add recover form directly on login page when it failed Remove recover link Remove header block now moved in twig form template Add messages in new notice class Cleanup --- diff --git a/Resources/views/form/login.html.twig b/Resources/views/form/login.html.twig index d127e25..fd8ff05 100644 --- a/Resources/views/form/login.html.twig +++ b/Resources/views/form/login.html.twig @@ -2,31 +2,40 @@ {% block content %}

{% trans %}Login{% endtrans %}

-
- {{ form_start(form) }} - -
{{ form_errors(form) }}
- +
+ {{ form_start(login) }}
- {{ form_row(form.mail) }} - - {{ form_row(form.password) }} + {{ form_row(login.mail) }} - {% if error %} - - {% endif %} + {{ form_row(login.password) }}
- {{ form_row(form.submit) }} + {{ form_row(login.submit) }} {# Render CSRF token etc .#}
- {{ form_rest(form) }} + {{ form_rest(login) }}
+ {{ form_end(login) }} +
+ {% if recover is defined %} +
+

Recover

+ {{ form_start(recover) }} + +
+ {{ form_row(recover.mail) }} + + {{ form_row(recover.submit) }} +
+ + {# Render CSRF token etc .#} +
+ {{ form_rest(recover) }} +
- {{ form_end(form) }} -
+ {{ form_end(recover) }} +
+ {% endif %} {% endblock %} diff --git a/Resources/views/form/recover.html.twig b/Resources/views/form/recover.html.twig index 74043fb..90694be 100644 --- a/Resources/views/form/recover.html.twig +++ b/Resources/views/form/recover.html.twig @@ -3,13 +3,10 @@

{% trans %}Recover{% endtrans %}

{% if sent %} -

{% trans %}Your recover account message has been sent{% endtrans %}

+

{% trans %}Your recover account message has been sent{% endtrans %}

{% else %} -
+
{{ form_start(form) }} - -
{{ form_errors(form) }}
-
{{ form_row(form.mail) }}
@@ -20,9 +17,8 @@
{{ form_rest(form) }}
- {{ form_end(form) }} -
+
{% endif %} {% endblock %} diff --git a/Resources/views/form/recover_mail.html.twig b/Resources/views/form/recover_mail.html.twig index 081376e..1ee09d7 100644 --- a/Resources/views/form/recover_mail.html.twig +++ b/Resources/views/form/recover_mail.html.twig @@ -3,15 +3,12 @@

{% trans %}Recover{% endtrans %}

{% if sent %} -

{% trans %}Your password is updated and an account recover message has been sent{% endtrans %}

- {% elseif notfound %} -

{% trans %}Unable to find account{% endtrans %}

+

{% trans %}Your password is updated and an account recover message has been sent{% endtrans %}

+ {% elseif not found %} +

{% trans %}Unable to find account{% endtrans %}

{% else %} -
+
{{ form_start(form) }} - -
{{ form_errors(form) }}
-
{{ form_row(form.password) }}
@@ -22,9 +19,8 @@
{{ form_rest(form) }}
- {{ form_end(form) }} -
+
{% endif %} {% endblock %} diff --git a/Resources/views/form/register.html.twig b/Resources/views/form/register.html.twig index 740abb0..c4fefaf 100644 --- a/Resources/views/form/register.html.twig +++ b/Resources/views/form/register.html.twig @@ -3,13 +3,10 @@

{{ title|trans }}

{% if sent %} -

{% trans %}Your account has been created{% endtrans %}

+

{% trans %}Your account has been created{% endtrans %}

{% else %} -
+
{{ form_start(form) }} - -
{{ form_errors(form) }}
-
{{ form_row(form.mail) }} @@ -36,9 +33,8 @@ - {{ form_end(form) }} -
+
{% endif %} {% endblock %}