]> 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:35:53 +0000 (05:35 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Wed, 11 Dec 2019 04:46:49 +0000 (05:46 +0100)
Remove header block now moved in twig form template
Use fragment instead of form
Cleanup

Resources/views/location/index.html.twig

index 5863c760ec022bf8422aea1eaf324833a1d5f29e..ca5143117dc7cc65461a7faf3330cab38e7b2e8a 100644 (file)
@@ -1,9 +1,8 @@
 {% extends '@RapsysAir/body.html.twig' %}
 {% block content %}
 <section id="dashboard">
 {% extends '@RapsysAir/body.html.twig' %}
 {% block content %}
 <section id="dashboard">
-TODO:
        <h2>{% trans %}Dashboard{% endtrans %}</h2>
        <h2>{% trans %}Dashboard{% endtrans %}</h2>
-       <div class="panel">
+       <section class="panel">
                {% if calendar is defined and calendar %}
                        <table class="grid">
                                <tbody>
                {% if calendar is defined and calendar %}
                        <table class="grid">
                                <tbody>
@@ -30,29 +29,17 @@ TODO:
                                </tbody>
                        </table>
                {% endif %}
                                </tbody>
                        </table>
                {% endif %}
-               <div>
-               {{ form_start(form) }}
-
-                       <header>{{ form_errors(form) }}</header>
-
+               {# Display application or login form #}
+               {% if is_granted('ROLE_GUEST') %}
                        <section>
                        <section>
-                               {{ form_row(form.location) }}
-
-                               {{ form_row(form.date) }}
-
-                               {{ form_row(form.slot) }}
+                               {{ include('@RapsysAir/form/_application.html.twig') }}
                        </section>
                        </section>
-
-                       {{ form_row(form.submit) }}
-
-                       {# Render CSRF token etc .#}
-                       <footer style="display:none">
-                               {{ form_rest(form) }}
-                       </footer>
-
-               {{ form_end(form) }}
-               </div>
-       </div>
+               {% elseif not is_granted('IS_AUTHENTICATED_REMEMBERED') %}
+                       <section>
+                               {{ include('@RapsysAir/form/_login.html.twig') }}
+                       </section>
+               {% endif %}
+       </section>
        {# dump(calendar) #}
 </section>
 {% endblock %}
        {# dump(calendar) #}
 </section>
 {% endblock %}