From 14686d537ee919eef4b95d963f385ac187915ebc Mon Sep 17 00:00:00 2001 From: RomainLvr Date: Thu, 2 Apr 2026 11:27:50 +0200 Subject: [PATCH 1/3] Fix (UI) - Text area fields alignment --- templates/fields.html.twig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/templates/fields.html.twig b/templates/fields.html.twig index d62e90bf..a639e6d2 100644 --- a/templates/fields.html.twig +++ b/templates/fields.html.twig @@ -94,9 +94,8 @@ {{ macros.textareaField(input_name, value, label, field_options|merge({ 'enable_richtext': true, 'field_class': 'col-12', - 'label_class': '', - 'input_class': '', - 'align_label_right': false, + 'label_class': 'col-xxl-2', + 'input_class': 'col-xxl-10', })) }} {% elseif type == 'yesno' %} From 60175ce2e861fd42824fce5b00651b7de03941a8 Mon Sep 17 00:00:00 2001 From: RomainLvr Date: Thu, 2 Apr 2026 16:38:07 +0200 Subject: [PATCH 2/3] Fix fields bloc alignment for new items & User forms --- templates/fields.html.twig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/templates/fields.html.twig b/templates/fields.html.twig index a639e6d2..eecbaf7d 100644 --- a/templates/fields.html.twig +++ b/templates/fields.html.twig @@ -36,9 +36,7 @@ {% endif %} {% if not already_wrapped and not dropdown_item%} - -{% set class = item.isNewItem() or item is instanceof('User') ? 'col-xxl-12' : 'col-xxl-9' %} -
+
From 5d65134406df1d20236d7acd6a97924f9e5b3671 Mon Sep 17 00:00:00 2001 From: RomainLvr Date: Fri, 3 Apr 2026 11:18:48 +0200 Subject: [PATCH 3/3] Follow the same logic as the Tag plugin --- templates/fields.html.twig | 51 ++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/templates/fields.html.twig b/templates/fields.html.twig index eecbaf7d..7e704a5d 100644 --- a/templates/fields.html.twig +++ b/templates/fields.html.twig @@ -28,15 +28,47 @@ {% import 'components/form/fields_macros.html.twig' as macros %} -{% set already_wrapped = item is instanceof('CommonITILObject') and container.fields['type'] == 'dom' %} -{% set dropdown_item = item is instanceof('CommonDropdown') and container.fields['type'] == 'dom' %} - -{% if item is instanceof('Glpi\\Form\\Form') %} - {% set already_wrapped = true %} +{% set in_itilobject = item is instanceof('CommonITILObject') and container.fields['type'] == 'dom' %} +{% set in_form_builder = item is instanceof('Glpi\\Form\\Form') %} +{% set already_wrapped = in_itilobject or in_form_builder %} +{% set dropdown_item = item is instanceof('CommonDropdown') and container.fields['type'] == 'dom' %} + +{% set textarea_display_options = { + 'in_itilobject': { + 'field_class': 'col-12', + 'label_class': 'col-2', + 'input_class': 'col-10', + 'is_horizontal': true, + 'align_label_right': true, + }, + 'in_form_builder': { + 'field_class': 'col-12', + 'label_class': 'form-label', + 'input_class': 'w-100', + 'is_horizontal': false, + 'align_label_right': false, + }, + 'default': { + 'field_class': 'col-12', + 'label_class': 'col-xxl-2', + 'input_class': 'col-xxl-10', + 'is_horizontal': true, + 'align_label_right': true, + }, +} %} + +{% if in_itilobject %} + {% set current_textarea_options = textarea_display_options.in_itilobject %} +{% elseif in_form_builder %} + {% set current_textarea_options = textarea_display_options.in_form_builder %} +{% else %} + {% set current_textarea_options = textarea_display_options.default %} {% endif %} {% if not already_wrapped and not dropdown_item%} -
+ +{% set class = item.isNewItem() or item is instanceof('User') or container.fields['type'] == 'dom' ? 'col-xxl-12' : 'col-xxl-9' %} +
@@ -86,14 +118,11 @@ })) }} {% elseif type == 'textarea' %} - {{ macros.textareaField(input_name, value, label, field_options) }} + {{ macros.textareaField(input_name, value, label, field_options|merge(current_textarea_options)) }} {% elseif type == 'richtext' %} - {{ macros.textareaField(input_name, value, label, field_options|merge({ + {{ macros.textareaField(input_name, value, label, field_options|merge(current_textarea_options)|merge({ 'enable_richtext': true, - 'field_class': 'col-12', - 'label_class': 'col-xxl-2', - 'input_class': 'col-xxl-10', })) }} {% elseif type == 'yesno' %}