diff --git a/CHANGELOG.md b/CHANGELOG.md index bda2fc21..2dcb8566 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [unreleased] - + +### Fixed + +- Fix text area fields size and alignment + ## [1.24.0] - 2026-04-16 ### Added diff --git a/templates/fields.html.twig b/templates/fields.html.twig index 7e704a5d..44a3c5a4 100644 --- a/templates/fields.html.twig +++ b/templates/fields.html.twig @@ -29,12 +29,20 @@ {% import 'components/form/fields_macros.html.twig' as macros %} {% set in_itilobject = item is instanceof('CommonITILObject') and container.fields['type'] == 'dom' %} +{% set in_projecttask = item is instanceof('ProjectTask') 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 col-xxl-5', + 'input_class': 'col-10 col-xxl-7', + 'is_horizontal': true, + 'align_label_right': true, + }, + 'in_projecttask': { 'field_class': 'col-12', 'label_class': 'col-2', 'input_class': 'col-10', @@ -49,25 +57,21 @@ 'align_label_right': false, }, 'default': { - 'field_class': 'col-12', - 'label_class': 'col-xxl-2', - 'input_class': 'col-xxl-10', + 'field_class': 'col-12 col-sm-6', + 'label_class': 'col-xxl-5', + 'input_class': 'col-xxl-7', '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 %} +{% set current_textarea_options = textarea_display_options[ + in_itilobject ? 'in_itilobject' : (in_projecttask ? 'in_projecttask' : (in_form_builder ? 'in_form_builder' : 'default')) +] %} {% 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' %} +{% set class = item.isNewItem() or item is instanceof('User') ? 'col-xxl-12' : 'col-xxl-9' %}