]> Raphaël G. Git Repositories - airbundle/commitdiff
Add recover form directly on login page when it failed
authorRaphaël Gertz <git@rapsys.eu>
Wed, 11 Dec 2019 04:32:01 +0000 (05:32 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Wed, 11 Dec 2019 04:34:35 +0000 (05:34 +0100)
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
Resources/views/form/recover.html.twig
Resources/views/form/recover_mail.html.twig
Resources/views/form/register.html.twig

index d127e2547696f92e48e45bde8224b1257b578f56..fd8ff055b822ada810d4a7afd55f02f647b3b085 100644 (file)
@@ -2,31 +2,40 @@
 {% block content %}
        <section id="form">
                <h2><a href="{{ path('rapsys_user_login') }}">{% trans %}Login{% endtrans %}</a></h2>
 {% block content %}
        <section id="form">
                <h2><a href="{{ path('rapsys_user_login') }}">{% trans %}Login{% endtrans %}</a></h2>
-               <div>
-                       {{ form_start(form) }}
-
-                               <header>{{ form_errors(form) }}</header>
-
+               <section>
+                       {{ form_start(login) }}
                                <section>
                                <section>
-                                       {{ form_row(form.mail) }}
-
-                                       {{ form_row(form.password) }}
+                                       {{ form_row(login.mail) }}
 
 
-                                       {% if error %}
-                                               <div class="error">
-                                                       <ul><li><a href="{{ path('rapsys_user_recover') }}">{% trans %}To recover your account click here{% endtrans %}</a></li></ul>
-                                               </div>
-                                       {% endif %}
+                                       {{ form_row(login.password) }}
                                </section>
 
                                </section>
 
-                               {{ form_row(form.submit) }}
+                               {{ form_row(login.submit) }}
 
                                {# Render CSRF token etc .#}
                                <footer style="display:none">
 
                                {# Render CSRF token etc .#}
                                <footer style="display:none">
-                                       {{ form_rest(form) }}
+                                       {{ form_rest(login) }}
                                </footer>
                                </footer>
+                       {{ form_end(login) }}
+               </section>
+               {% if recover is defined %}
+                       <section>
+                               <h3>Recover</h3>
+                               {{ form_start(recover) }}
+
+                                       <section>
+                                               {{ form_row(recover.mail) }}
+
+                                               {{ form_row(recover.submit) }}
+                                       </section>
+
+                                       {# Render CSRF token etc .#}
+                                       <footer style="display:none">
+                                               {{ form_rest(recover) }}
+                                       </footer>
 
 
-                       {{ form_end(form) }}
-               </div>
+                               {{ form_end(recover) }}
+                       </section>
+               {% endif %}
        </section>
 {% endblock %}
        </section>
 {% endblock %}
index 74043fb79fc24c6e26fd95fec88fcb1e3390dfbb..90694beb8e318fe85442e14cd869a155fee7f56f 100644 (file)
@@ -3,13 +3,10 @@
        <section id="form">
                <h2><a href="{{ path('rapsys_user_recover') }}">{% trans %}Recover{% endtrans %}</a></h2>
                {% if sent %}
        <section id="form">
                <h2><a href="{{ path('rapsys_user_recover') }}">{% trans %}Recover{% endtrans %}</a></h2>
                {% if sent %}
-                       <p>{% trans %}Your recover account message has been sent{% endtrans %}</p>
+                       <p class="notice">{% trans %}Your recover account message has been sent{% endtrans %}</p>
                {% else %}
                {% else %}
-                       <div>
+                       <section>
                                {{ form_start(form) }}
                                {{ form_start(form) }}
-
-                                       <header>{{ form_errors(form) }}</header>
-
                                        <section>
                                                {{ form_row(form.mail) }}
                                        </section>
                                        <section>
                                                {{ form_row(form.mail) }}
                                        </section>
@@ -20,9 +17,8 @@
                                        <footer style="display:none">
                                                {{ form_rest(form) }}
                                        </footer>
                                        <footer style="display:none">
                                                {{ form_rest(form) }}
                                        </footer>
-
                                {{ form_end(form) }}
                                {{ form_end(form) }}
-                       </div>
+                       </section>
                {% endif %}
        </section>
 {% endblock %}
                {% endif %}
        </section>
 {% endblock %}
index 081376e2dec61adf6e10a554503c05105c96a3bf..1ee09d773d15684f83574cba15431465aaf9b9a9 100644 (file)
@@ -3,15 +3,12 @@
        <section id="form">
                <h2><a href="{{ path('rapsys_user_recover') }}">{% trans %}Recover{% endtrans %}</a></h2>
                {% if sent %}
        <section id="form">
                <h2><a href="{{ path('rapsys_user_recover') }}">{% trans %}Recover{% endtrans %}</a></h2>
                {% if sent %}
-                       <p>{% trans %}Your password is updated and an account recover message has been sent{% endtrans %}</p>
-               {% elseif notfound %}
-                       <p>{% trans %}Unable to find account{% endtrans %}</p>
+                       <p class="notice">{% trans %}Your password is updated and an account recover message has been sent{% endtrans %}</p>
+               {% elseif not found %}
+                       <p class="error">{% trans %}Unable to find account{% endtrans %}</p>
                {% else %}
                {% else %}
-                       <div>
+                       <section>
                                {{ form_start(form) }}
                                {{ form_start(form) }}
-
-                                       <header>{{ form_errors(form) }}</header>
-
                                        <section>
                                                {{ form_row(form.password) }}
                                        </section>
                                        <section>
                                                {{ form_row(form.password) }}
                                        </section>
@@ -22,9 +19,8 @@
                                        <footer style="display:none">
                                                {{ form_rest(form) }}
                                        </footer>
                                        <footer style="display:none">
                                                {{ form_rest(form) }}
                                        </footer>
-
                                {{ form_end(form) }}
                                {{ form_end(form) }}
-                       </div>
+                       </section>
                {% endif %}
        </section>
 {% endblock %}
                {% endif %}
        </section>
 {% endblock %}
index 740abb0c43197931eef85f7ba24470197a7d7ee3..c4fefaf8ace411e3428dfa05515df24bb0c2a91a 100644 (file)
@@ -3,13 +3,10 @@
        <section id="form">
                <h2>{{ title|trans }}</h2>
                {% if sent %}
        <section id="form">
                <h2>{{ title|trans }}</h2>
                {% if sent %}
-                       <p>{% trans %}Your account has been created{% endtrans %}</p>
+                       <p class="notice">{% trans %}Your account has been created{% endtrans %}</p>
                {% else %}
                {% else %}
-                       <div>
+                       <section>
                                {{ form_start(form) }}
                                {{ form_start(form) }}
-
-                                       <header>{{ form_errors(form) }}</header>
-
                                        <section>
                                                {{ form_row(form.mail) }}
 
                                        <section>
                                                {{ form_row(form.mail) }}
 
@@ -36,9 +33,8 @@
                                        <footer style="display:none">
                                                {{ form_rest(form) }}
                                        </footer>
                                        <footer style="display:none">
                                                {{ form_rest(form) }}
                                        </footer>
-
                                {{ form_end(form) }}
                                {{ form_end(form) }}
-                       </div>
+                       </section>
                {% endif %}
        </section>
 {% endblock %}
                {% endif %}
        </section>
 {% endblock %}