{% use "application/forms/itop_base_layout.html.twig" %} {%- block form_start -%} {%- do form.setMethodRendered() -%} {% set method = method|upper %} {%- if method in ["GET", "POST"] -%} {% set form_method = method %} {%- else -%} {% set form_method = "POST" %} {%- endif -%} {%- set attr = attr|merge({class: (attr.class|default('') ~ ' ibo-form')}) -%}
{%- if form_method != method -%} {%- endif -%} {%- endblock form_start -%} {%- block form_end -%} {%- if not render_rest is defined or render_rest -%} {{ form_rest(form) }} {%- endif -%}
{%- endblock form_end -%} {%- block widget_attributes -%} {{- parent() -}} {% if trigger_form_submit_on_modify %} onChange="this.form.TriggerTurbo(this);" {% endif %} {%- endblock widget_attributes -%} {%- block attributes -%} {{- parent() -}} {% if impacted_by is not empty %} data-impacted-by="{{ impacted_by|join(',') }}" {% endif %} {%- endblock attributes -%} {%- block form_widget_simple -%} {% 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 form_widget_simple -%} {%- block textarea_widget -%} {% 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 textarea_widget -%} {%- block choice_widget_collapsed -%} {% set attr = attr|merge({class: (attr.class|default('') ~ ' ibo-input')|trim}) %} {%- endblock choice_widget_collapsed -%} {%- block choice_widget_expanded -%}
{%- for child in form %} {{- form_widget(child) -}} {{- form_label(child, null, {translation_domain: choice_translation_domain, no_label_class: true}) -}} {% endfor -%}
{%- endblock choice_widget_expanded -%} {%- block form_label -%} {%- set no_legend_element = inline_display is defined and inline_display -%} {%- if compound is defined and compound and not no_legend_element -%} {%- set element = 'legend' -%} {%- elseif no_label_class is not defined or not no_label_class -%} {% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ibo-field--label')|trim}) %} {%- endif -%} {{- parent() -}} {%- endblock form_label -%} {%- block form_rows -%} {% for block in blocks %} {% if block.added == 1 %} {% set row_attr = row_attr|merge({id: 'turbo_' ~ block.id }) %} {{ form_row(form[block.name], {row_attr: row_attr}) }} {% else %}
{% endif %} {% endfor %} {%- endblock form_rows -%} {%- 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 -%} {%- block collection_widget -%} {% if prototype is defined and not prototype.rendered %} {%- set prototype_html = '' ~ form_widget(prototype) ~'' -%} {%- set attr = attr|merge({'data-prototype': prototype_html, 'class': name, 'data-index': form|length > 0 ? form|last.vars.name + 1 : 0 }) -%} {% endif %} {% if allow_add %} {% endif %}
{% for child in form %} {{ form_widget(child) }} {% endfor %}
{%- endblock collection_widget -%} {%- block form_label_content -%} {{- parent() -}}
{%-endblock form_label_content -%} {%- block form_errors -%}
{{- parent() -}}
{%- endblock form_errors -%} {%- block oql_form_widget -%}
{% if with_ai_button is defined and with_ai_button %} {% endif %}
{%- endblock oql_form_widget -%}