N°8771 - Add Symfony form component to iTop core (#760)

- Add Symfony Form Component
- Add Symfony CSRF security component
- Add iTop default form template
- Add Twig debug extension to Twig Environment
- Add iTop abstract controller facility to get form builder
- Add Twig filter to make trans an alias of dict_s filter
This commit is contained in:
Benjamin Dalsass
2025-10-10 16:02:25 +02:00
committed by GitHub
parent 82395727bf
commit 5dd450e9bf
605 changed files with 60106 additions and 12 deletions

View File

@@ -0,0 +1,4 @@
{% use "form_div_layout.html.twig" %}
{# Widgets #}

View File

@@ -0,0 +1,23 @@
{% use "application/forms/itop_base_layout.html.twig" %}
{# Widgets #}
{%- block widget_attributes -%}
{% if type == 'text' %}{% set ibo_class='ibo-input-string' %}{% else %}{% set ibo_class='ibo-input-' ~ type %}{% endif %}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' ibo-input ' ~ ibo_class)|trim}) %}
{{- parent() -}}
{%- endblock widget_attributes -%}
{%- block form_label -%}
{%- if compound is defined and compound -%}
{%- set element = 'legend' -%}
{%- else -%}
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ibo-field--label')|trim}) %}
{%- endif -%}
{{- parent() -}}
{%- endblock form_label -%}
{%- block form_row -%}
{% set row_attr = row_attr|merge({class: (row_attr.class|default('') ~ ' ibo-field ibo-content-block ibo-block ibo-field-small')|trim}) %}
{{- parent() -}}
{%- endblock form_row -%}