From 5cfed3d53664f89a59f624a32ce502ae164dba32 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Tue, 4 Jan 2022 19:05:06 +0000 Subject: [PATCH] [TWIG] Display errors in templates that display forms with form_start --- .../templates/left_panel/edit_feeds.html.twig | 31 ++++++++++--------- .../Search/templates/search/show.html.twig | 1 + templates/reset_password/reset.html.twig | 1 + templates/security/register.html.twig | 1 + 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/components/LeftPanel/templates/left_panel/edit_feeds.html.twig b/components/LeftPanel/templates/left_panel/edit_feeds.html.twig index e70fac9236..5f94b1a46d 100644 --- a/components/LeftPanel/templates/left_panel/edit_feeds.html.twig +++ b/components/LeftPanel/templates/left_panel/edit_feeds.html.twig @@ -14,22 +14,23 @@ {# Since the form is not separated into individual groups, this happened #} {{ form_start(edit_feeds) }} + {{ form_errors(edit_feeds) }} {% for child in edit_feeds.children %} - {% if 'row_url' in child.vars.block_prefixes %} -
- {{ form_label(child) }} - {{ form_widget(child) }} - {% elseif 'row_title' in child.vars.block_prefixes %} - {{ form_label(child) }} - {{ form_widget(child) }} - {% elseif 'row_order' in child.vars.block_prefixes %} - {{ form_label(child) }} - {{ form_widget(child) }} - {% elseif 'row_remove' in child.vars.block_prefixes %} - {{ form_label(child) }} - {{ form_widget(child) }} -
- {% endif %} + {% if 'row_url' in child.vars.block_prefixes %} +
+ {{ form_label(child) }} + {{ form_widget(child) }} + {% elseif 'row_title' in child.vars.block_prefixes %} + {{ form_label(child) }} + {{ form_widget(child) }} + {% elseif 'row_order' in child.vars.block_prefixes %} + {{ form_label(child) }} + {{ form_widget(child) }} + {% elseif 'row_remove' in child.vars.block_prefixes %} + {{ form_label(child) }} + {{ form_widget(child) }} +
+ {% endif %} {% endfor %} {{ form_end(edit_feeds) }} diff --git a/components/Search/templates/search/show.html.twig b/components/Search/templates/search/show.html.twig index 684dab7384..bb4cabd0a4 100644 --- a/components/Search/templates/search/show.html.twig +++ b/components/Search/templates/search/show.html.twig @@ -13,6 +13,7 @@ {{ form_start(search_form) }}
+ {{ form_errors(search_form) }} {{ form_row(search_form.search_query) }} {% if actor is not null %}
diff --git a/templates/reset_password/reset.html.twig b/templates/reset_password/reset.html.twig index 799aa10f54..56e6ca6160 100644 --- a/templates/reset_password/reset.html.twig +++ b/templates/reset_password/reset.html.twig @@ -6,6 +6,7 @@

Reset your password

{{ form_start(resetForm) }} + {{ form_errors(resetForm) }} {{ form_row(resetForm.plainPassword) }} {{ form_end(resetForm) }} diff --git a/templates/security/register.html.twig b/templates/security/register.html.twig index cab7ee1bd3..e72302a35e 100644 --- a/templates/security/register.html.twig +++ b/templates/security/register.html.twig @@ -12,6 +12,7 @@
{{ form_start(registration_form) }} + {{ form_errors(registration_form) }}
{{ "Register" | trans }}