From 1b404150ed3091d73848a272fed24d96a2366bad Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Wed, 11 Dec 2019 05:32:01 +0100 Subject: [PATCH 1/1] 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 --- Resources/views/form/login.html.twig | 43 +++++++++++++-------- Resources/views/form/recover.html.twig | 10 ++--- Resources/views/form/recover_mail.html.twig | 14 +++---- Resources/views/form/register.html.twig | 10 ++--- 4 files changed, 37 insertions(+), 40 deletions(-) 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 %} -- 2.41.1