From 3b7e78b807393dcb80670fb5438849962a2fdc51 Mon Sep 17 00:00:00 2001 From: Michal Odorski Date: Wed, 3 Jan 2024 18:52:24 +0100 Subject: [PATCH] DROOP-1043 Divider is not visible when there is no header and content --- .../src/components/d-p-form/d-p-form.twig | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/themes/custom/droopler_theme/src/components/d-p-form/d-p-form.twig b/themes/custom/droopler_theme/src/components/d-p-form/d-p-form.twig index a7fb935eb..07f29af67 100644 --- a/themes/custom/droopler_theme/src/components/d-p-form/d-p-form.twig +++ b/themes/custom/droopler_theme/src/components/d-p-form/d-p-form.twig @@ -32,22 +32,33 @@ -
-
-
- {% block header %} - {% endblock %} +
+
- {% include '@droopler_theme/base/divider/divider.twig' %} + {% set has_header = block('header')|render|striptags('')|trim is not empty %} + {% set has_content = block('content')|render|striptags|trim is not empty %} - {% block content %} - {% endblock %} -
+ {% if has_header or has_content %} +
+ + {% if has_header %} + {% block header %} + {% endblock %} + + {% if has_content %} + {% include '@droopler_theme/base/divider/divider.twig' %} + {% endif %} + {% endif %} -
- {% block form %} - {% endblock %} + {% block content %} + {% endblock %} +
+ {% endif %} + +
+ {% block form %} + {% endblock %} +
-