wip: initial commit

This commit is contained in:
Björn Fromme
2024-11-20 18:32:09 +01:00
parent ae964198e9
commit d4c4e69d09
91 changed files with 32685 additions and 144 deletions
+62
View File
@@ -0,0 +1,62 @@
{% use 'form_div_layout.html.twig' %}
{%- block form_widget_simple -%}
{%- set type = type|default('text') -%}
{%- if type == 'range' or type == 'color' -%}
{# Attribute "required" is not supported #}
{%- set required = false -%}
{%- endif -%}
{%- if errors|length > 0 -%}
{% set attr = attr|merge({ 'aria-invalid': 'true', 'aria-describedby': 'error-' ~ id }) %}
{%- endif -%}
<input type="{{ type }}" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}/>
{%- endblock form_widget_simple -%}
{%- block form_row -%}
<fieldset{% with {attr: row_attr} %}{{ block('attributes') }}{% endwith %}>
<legend>
<strong>
{{- label -}}
</strong>
</legend>
{{- form_widget(form) -}}
{{- form_errors(form) -}}
{{- form_help(form) -}}
</fieldset>
{%- endblock form_row -%}
{%- block form_errors -%}
{%- if errors|length > 0 -%}
<small id="error-{{ id }}">
{%- for error in errors -%}
<div>{{ error.message }}</div>
{%- endfor -%}
</small>
{%- endif -%}
{%- endblock form_errors -%}
{%- block choice_widget_expanded -%}
{%- for child in form %}
{{- form_widget(child) -}}
{% endfor -%}
{%- endblock choice_widget_expanded -%}
{%- block checkbox_widget -%}
<label for="{{ id }}">
{{ parent() }}
{{ label|trans|raw }}
{%- if attr.disabled is defined and attr.disabled == true and attr.checked == true -%}
<input type="hidden" name="{{ form.vars.full_name }}" value="{{ form.vars.value }}">
{%- endif -%}
</label>
{%- endblock checkbox_widget -%}
{%- block radio_widget -%}
<label for="{{ id }}">
{{ parent() }}
{{ label|trans|raw }}
</label>
{%- if attr.disabled is defined and attr.disabled == true and attr.checked == true -%}
<input type="hidden" name="{{ form.vars.full_name }}" value="{{ form.vars.value }}">
{%- endif -%}
{%- endblock radio_widget -%}