{% extends 'form_div_layout.html.twig' %} {%- block form_widget_compound -%} {%- if form is rootform -%} {{ form_errors(form) }} {{- block('form_rows') -}} {{- form_rest(form) -}} {% else %} {% set attr = attr|merge({'class': (attr.class|default('') ~ ' gold-fieldset')|trim}) %}
{{ block('legend') }} {{- block('compound_form_rows') -}} {{- form_rest(form) -}}
{%- endif -%} {%- endblock form_widget_compound -%} {% block hint_text %} {%- if hint_text is not empty -%}
{{ hint_text }}
{%- endif -%} {% endblock hint_text %} {% block legend %} {% if required -%} * {% endif %} {{ label|default(name|humanize) }} {{ block('hint_text') }} {% endblock legend %} {%- block form_row -%} {% if errors|length > 0 -%}
{%- else -%}
{%- endif -%} {{- form_errors(form) -}} {{- form_label(form) -}} {{- form_widget(form) -}}
{%- endblock form_row -%} {%- block honeypot_row -%}
{{ form_row(form) }}
{%- endblock honeypot_row -%} {%- block compound_form_rows -%} {% for child in form %} {{ form_errors(child) }} {{ form_label(child, null, {'label_attr': {'class' : 'gold-label-light'}}) }} {{ form_widget(child) }} {% endfor %} {%- endblock compound_form_rows -%} {%- block form_label -%} {% if not compound %} {% if label is not same as(false) -%} {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' gold-label')|trim}) %} {% if not compound -%} {% set label_attr = label_attr|merge({'for': id}) %} {%- endif -%} {% if label is empty -%} {%- if label_format is not empty -%} {% set label = label_format|replace({ '%name%': name, '%id%': id, }) %} {%- else -%} {% set label = name|humanize %} {%- endif -%} {%- endif -%} {% if required -%} * {% endif %} {%- if translation_domain is same as(false) -%} {{- label -}} {%- else -%} {{- label|trans({}, translation_domain) -}} {%- endif -%} {%- endif -%} {# only show hint text here if this is not an inline label #} {% if not inline is defined or not inline %} {{ block('hint_text') }} {% endif %} {% endif %} {%- endblock form_label -%} {%- block form_errors -%} {% if form is rootform %} {% endif %} {%- if errors|length > 0 -%}
{%- for error in errors -%} Error: {{ error.message }}
{%- endfor -%}
{%- endif -%} {%- endblock form_errors -%} {%- block widget_attributes -%} id="{{ id }}" name="{{ full_name }}" {%- if read_only %} readonly="readonly"{% endif -%} {%- if disabled %} disabled="disabled"{% endif -%} {%- if required %} required="required"{% endif -%} {%- if errors|length > 0 %} {% set attr = attr|merge({'aria-invalid': 'true', 'class': (attr.class|default('') ~ ' gold-input--invalid')|trim}) %} {% set attr = attr|merge({'aria-describedby' : (attr['aria-describedby']|default('') ~ " %s-error"|format(id))|trim}) %} {% endif -%} {%- if hint_text is not empty -%} {% set attr = attr|merge({'aria-describedby' : (attr['aria-describedby']|default('') ~ " %s-hint"|format(id))|trim}) %} {%- endif -%} {%- for attrname, attrvalue in attr if 'readonly' != attrname or not read_only -%} {{- " " -}} {%- if attrname in ['placeholder', 'title'] -%} {{- attrname }}="{{ translation_domain is same as(false) ? attrvalue : attrvalue|trans({}, translation_domain) }}" {%- elseif attrvalue is same as(true) -%} {{- attrname }}="{{ attrname }}" {%- elseif attrvalue is not same as(false) -%} {{- attrname }}="{{ attrvalue }}" {%- endif -%} {%- endfor -%} {%- endblock widget_attributes -%} {%- block form_start -%} {# Add the Cloudflare assets here 100426 #} {% if form is rootform %} {# should this be in form_errors block? #} {% if not form.vars.valid %} {% endif %}
{%- do form.setMethodRendered() -%} {% set method = method|upper %} {%- if method in ["GET", "POST"] -%} {% set form_method = method %} {%- else -%} {% set form_method = "POST" %} {%- endif -%} {%- if form_method != method -%} {%- endif -%} {%- endif -%} {%- endblock form_start -%} {%- block form_end -%} {%- if not render_rest is defined or render_rest -%} {{ form_rest(form) }} {%- endif -%}
{%- if disclaimer -%}

Data protection and confidentiality

We will store and use the information you send in order to provide our service to you. We will only contact you in relation to this enquiry. Read our Privacy Notices to understand how we will use what you send us.

{%- endif -%}
{%- endblock form_end -%} {%- block widget_container_attributes -%} {%- if id is not empty %}id="{{ id }}"{% endif -%} {%- if errors|length > 0 %} {% set attr = attr|merge({'aria-invalid': 'true', 'class': (attr.class|default('') ~ ' gold-input--invalid')|trim}) %} {% set attr = attr|merge({'aria-describedby' : (attr['aria-describedby']|default('') ~ " %s-error"|format(id))|trim}) %} {% endif -%} {%- if hint_text is not empty -%} {% set attr = attr|merge({'aria-describedby' : (attr['aria-describedby']|default('') ~ " %s-hint"|format(id))|trim}) %} {%- endif -%} {%- for attrname, attrvalue in attr -%} {{- " " -}} {%- if attrname in ['placeholder', 'title'] -%} {{- attrname }}="{{ translation_domain is same as(false) ? attrvalue : attrvalue|trans({}, translation_domain) }}" {%- elseif attrvalue is same as(true) -%} {{- attrname }}="{{ attrname }}" {%- elseif attrvalue is not same as(false) -%} {{- attrname }}="{{ attrvalue }}" {%- endif -%} {%- endfor -%} {%- endblock widget_container_attributes -%} {%- block table_choice_widget -%} {% set attr = attr|merge({'class': (attr.class|default('') ~ ' gold-fieldset')|trim}) %}
{{ block('legend') }}
{% for col in columns %} {% endfor %} {% set colcount = columns|length %} {% for row in rows %} {% set rowIndex = loop.index - 1 %} {% set startRow = rowIndex * colcount %} {% set rowForms = form|slice(startRow, colcount) %} {% for child in rowForms %} {% set checkbox = child %} {% endfor %} {% endfor %}
{{ col }}
{{ row }}
{{- form_widget(checkbox, {'attr': {'class': 'gold-checkboxes__input'}}) -}} {{- form_label(checkbox, ' ', {'label_attr': {'class' : 'gold-checkboxes__label'}, 'inline': true}) -}}
{%- endblock table_choice_widget -%} {%- block choice_widget_expanded -%} {% set attr = attr|merge({'class': (attr.class|default('') ~ ' gold-fieldset')|trim}) %}
{{ block('legend') }} {% if multiple %}
{%- for child in form %} {% set checkbox = child %} {{ block('inline_checkbox') }} {% endfor -%}
{% else %}
{%- for child in form %} {% set radio = child %} {# the required indicator will be set on the container, not the individual radio labels #} {% set required = false %} {{ block('inline_radio') }} {% endfor -%}
{% endif %}
{%- endblock choice_widget_expanded -%} {%- block checkbox_row -%} {% if errors|length > 0 -%}
{%- else -%}
{%- endif -%} {{ form_errors(form) }} {{ block('hint_text') }} {% set checkbox = form %} {{ block('inline_checkbox') }}
{%- endblock checkbox_row -%} {%- block inline_checkbox -%}
{{- form_widget(checkbox, {'attr': {'class': 'gold-checkboxes__input'}}) -}} {{- form_label(checkbox, null, {'label_attr': {'class' : 'gold-checkboxes__label'}, 'inline': true}) -}}
{%- endblock inline_checkbox -%} {%- block radio_row -%} {% if errors|length > 0 -%}
{%- else -%}
{%- endif -%} {{ form_errors(form) }} {{ block('hint_text') }} {% set radio = form %} {{ block('inline_radio') }}
{%- endblock radio_row -%} {%- block inline_radio -%}
{{- form_widget(radio, {'attr': {'class': 'gold-radios__input'}}) -}} {{- form_label(radio, null, {'required': required, 'label_attr': {'class' : 'gold-radios__label'}, 'inline': true}) -}}
{%- endblock inline_radio -%} {%- block date_widget -%} {%- if widget == 'single_text' -%} {{ block('form_widget_simple') }} {%- else -%} {% set attr = attr|merge({'class': (attr.class|default('') ~ ' gold-fieldset gold-fieldset--inline')|trim}) %}
{{ block('legend') }} {{- date_pattern|replace({ '{{ year }}': block('year_widget'), '{{ month }}': block('month_widget'), '{{ day }}': block('day_widget'), })|raw -}}
{%- endif -%} {%- endblock date_widget -%} {%- block year_widget -%}
{{ form_label(form.year, null, {'required' : false, 'label_attr': {'class' : 'gold-label-light'}}) }} {{ form_widget(form.year, { 'type' : 'number', 'attr': { 'class': 'gold-input-medium' }}) }}
{%- endblock year_widget -%} {%- block month_widget -%}
{{ form_label(form.month, null, {'required' : false, 'label_attr': {'class' : 'gold-label-light'}}) }} {{ form_widget(form.month, { 'type' : 'number', 'attr': { 'class': 'gold-input-small', 'min': 1, 'max': 12 }}) }}
{%- endblock month_widget -%} {%- block day_widget -%}
{{ form_label(form.day, null, {'required' : false, 'label_attr': {'class' : 'gold-label-light'}}) }} {{ form_widget(form.day, { 'type' : 'number', 'attr': { 'class': 'gold-input-small', 'min': 1, 'max': 31 }}) }}
{%- endblock day_widget -%}