2022-02-16 21:17:13 +00:00
|
|
|
{% use 'cards/forms/form_raw_layout.html.twig' %}
|
2021-12-25 16:19:46 +00:00
|
|
|
|
|
|
|
{%- block form_row -%}
|
|
|
|
{%- set row_attr = row_attr|merge({ class: row_attr.class|default(row_class|default('form-row')) }) -%}
|
|
|
|
{{- parent() -}}
|
|
|
|
{%- endblock form_row -%}
|
|
|
|
|
|
|
|
{%- block widget_attributes -%}
|
|
|
|
{%- set attr = attr|merge({ class: attr.class|default(widget_class|default('form-row-widget')) ~ (disabled ? ' ' ~ widget_disabled_class|default('form-row-widget-disabled')) ~ (errors|length ? ' ' ~ widget_errors_class|default('form-row-widget-error')) }) -%}
|
|
|
|
{{- parent() -}}
|
|
|
|
{%- endblock widget_attributes -%}
|
|
|
|
|
|
|
|
{%- block form_label -%}
|
|
|
|
{%- set label_attr = label_attr|merge({ class: label_attr.class|default(label_class|default('form-row-label')) }) -%}
|
|
|
|
{{- parent() -}}
|
|
|
|
{%- endblock form_label -%}
|
|
|
|
|
|
|
|
{%- block form_help -%}
|
|
|
|
{%- set help_attr = help_attr|merge({ class: help_attr.class|default(help_class|default('form-row-help')) }) -%}
|
|
|
|
{{- parent() -}}
|
|
|
|
{%- endblock form_help -%}
|
|
|
|
|
|
|
|
{%- block form_errors -%}
|
|
|
|
{%- if errors|length > 0 -%}
|
|
|
|
<ul>
|
|
|
|
{%- for error in errors -%}
|
|
|
|
<li class="{{ error_item_class|default('form-error') }}">{{ error.message }}</li>
|
|
|
|
{%- endfor -%}
|
|
|
|
</ul>
|
|
|
|
{%- endif -%}
|
|
|
|
{%- endblock form_errors -%}
|
|
|
|
|
|
|
|
{%- block choice_widget_expanded -%}
|
|
|
|
{%- set attr = attr|merge({ class: attr.class|default('form-row-choice') }) -%}
|
|
|
|
<div {{ block('widget_container_attributes') }}>
|
|
|
|
{%- for child in form %}
|
|
|
|
<div class="choice-children">
|
|
|
|
{{- form_widget(child) -}}
|
|
|
|
{{- form_label(child, null, { translation_domain: choice_translation_domain }) -}}
|
|
|
|
</div>
|
|
|
|
{% endfor -%}
|
|
|
|
</div>
|
|
|
|
{%- endblock choice_widget_expanded -%}
|
|
|
|
|
|
|
|
{%- block checkbox_row -%}
|
|
|
|
{%- set row_attr = row_attr|merge({ class: row_attr.class|default(row_class|default('form-row-checkbox')) }) -%}
|
|
|
|
{%- set widget_attr = {} -%}
|
|
|
|
{%- if help is not empty -%}
|
|
|
|
{%- set widget_attr = {attr: {'aria-describedby': id ~"_help"}} -%}
|
|
|
|
{%- endif -%}
|
|
|
|
<div{% with {attr: row_attr} %}{{ block('attributes') }}{% endwith %}>
|
|
|
|
{{- form_errors(form) -}}
|
|
|
|
<div class="inline-flex items-center">
|
|
|
|
{{- form_widget(form, widget_attr) -}}
|
|
|
|
{{- form_label(form) -}}
|
|
|
|
</div>
|
|
|
|
{{- form_help(form) -}}
|
|
|
|
</div>
|
|
|
|
{%- endblock checkbox_row -%}
|
|
|
|
|
2022-02-16 21:17:13 +00:00
|
|
|
{%- block button_row -%}
|
|
|
|
{%- set btn_class = 'is-link' -%}
|
|
|
|
{%- for color in [ 'is-primary', 'is-info', 'is-success', 'is-warning', 'is-danger' ] -%}
|
|
|
|
{%- set btn_class = color -%}
|
|
|
|
{%- endfor -%}
|
|
|
|
{%- set attr = attr|merge({class: (attr.class|default('') ~ ' button ' ~ btn_class)|trim}) -%}
|
|
|
|
{{- parent() -}}
|
|
|
|
{%- endblock button_row -%}
|
|
|
|
|
2021-12-25 16:19:46 +00:00
|
|
|
{%- block checkbox_widget -%}
|
|
|
|
{%- set widget_class = widget_class|default('form-row-checkbox-element') -%}
|
|
|
|
{{- parent() -}}
|
|
|
|
{%- endblock checkbox_widget -%}
|
|
|
|
|
|
|
|
{%- block radio_widget -%}
|
|
|
|
{%- set widget_class = widget_class|default('form-row-radio-element') -%}
|
|
|
|
{{- parent() -}}
|
|
|
|
{%- endblock radio_widget -%}
|