{% extends 'form_div_layout.html.twig' %} {%- block textarea_widget -%} {% if attr and attr['data-maxchars'] -%} {% endif %} {%- endblock textarea_widget -%} {%- block _form_subform_row -%} {% if errors|length > 0 -%}
{%- else -%}
{%- endif -%} {#
{{- form_label(form) -}} #} {{- form_errors(form) -}} {%- if help_text is not empty -%}
{{ help_text|md2html }}
{%- endif -%} {{- form_widget(form) -}} {#
#}
{%- endblock _form_subform_row -%} {%- block form_row -%} {% if errors|length > 0 -%}
{%- else -%}
{%- endif -%} {{- form_label(form) -}} {{- form_errors(form) -}} {%- if help_text is not empty -%}
{{ help_text|md2html }}
{%- endif -%} {{- form_widget(form) -}}
{%- endblock form_row -%} {%- block form_errors -%} {%- if errors|length > 0 -%}
{%- for error in errors -%}

{{ error.message }}

{%- endfor -%}
{%- endif -%} {%- endblock form_errors -%} {%- block checkbox_row -%} {% if errors|length > 0 -%}
{%- else -%}
{%- endif -%} {{- form_errors(form) -}} {{- form_label(form) -}} {{- form_widget(form) -}} {%- if help_text is not empty -%}
{{ help_text|md2html }}
{%- endif -%}
{%- endblock checkbox_row -%} {%- block choice_widget_expanded -%}
{%- for child in form %} {{- form_label(child, null, {'required' : false, 'label_attr' : {'class' : 'radio-inline radio-inline'}}) -}} {{- form_widget(child) -}} {% endfor -%}
{%- endblock choice_widget_expanded -%} {%- block button_row %} {{ form_widget(form) }} {% endblock button_row -%} {# profile form has special handling for intro subsections which must be embedded in the containing section #} {%- block _profile_form_widget %}
{% if form.parent is null %} {{ form_errors(form) }} {% endif %} {%- if form is rootform -%} {{ form_errors(form) }} {%- endif -%} {{- block('profile_form_rows') -}} {{- form_rest(form) -}}
{% endblock _profile_form_widget -%} {%- block profile_form_rows -%} {% for child in form %} {# don't render intro sections before their containing section #} {% if not (child.vars.name ends with '_intro') %} {{- form_row(child) -}} {% endif %} {% endfor %} {%- endblock profile_form_rows -%} {%- block _profile_form_collection_row -%} {% set section_intro = null %} {% set section_intro_name = name ~ '_intro' %} {% if attribute(form.parent.children, section_intro_name) is defined %} {# this section has an intro section #} {% set section_intro = attribute(form.parent.children, section_intro_name) %} {% endif %} {{ block('collection_row') }} {%- endblock _profile_form_collection_row -%} {# A collection type #} {%- block collection_row -%} {%- if section_title is empty -%} {%- set section_title = name|humanize -%} {%- endif -%}
{% set legend_class = form.vars.optional ? '' : 'required' %} {% set required_label = form.vars.optional ? '' : ' (required)' %} {{ section_title }}{{ required_label }} {# look for an intro for this section (profile form) #} {% if section_intro is defined and section_intro is not null %} {% set options = {} %} {% set options = options|merge(section_intro.vars)|merge({}) %} {%- if options.help_text is not empty -%}
{{ options.help_text|md2html }}
{%- endif -%} {{ form_widget(section_intro, options) }} {% endif %} {%- if help_text is not empty -%}
{{ help_text|md2html }}
{%- endif -%} {{ block('collection_widget') }}
{%- endblock collection_row -%} {%- block collection_widget -%} {{ form_errors(form) }} {%- if prototype is defined -%} {%- set attr = attr|merge({'data-prototype': form_row(prototype) }) -%} {%- endif -%} {%- set attr = attr|merge({'data-maxitems': form.vars.max_items }) -%} {# {%- set attr = attr|merge({'data-optional': form.vars.optional }) -%} #} {%- set multiple = (form.vars.max_items > 1) ? 'multiple' : 'single' -%} {%- set optional = (form.vars.optional) ? 'optional' : 'mandatory' -%} {%- set class = (attr.class is defined) ? attr.class : '' -%} {%- set attr = attr|merge({ 'class' : [class, 'form-collection', multiple, optional]|join(' ') }) -%} {# {%- set attr = attr|merge({'class': form.vars.attr.class }) -%} #}
    {{ block('form_rows') }}
{%- if max_items > 1 and allow_add %} {%- set add_item = add_item_text ? : app.form_collection_add_text -%} {{ add_item }} {%- endif %} {%- endblock collection_widget -%} {%- block _profile_form_collection_entry_row -%} {{ form_errors(form) }}
  • {% for child in form %} {% if 'hidden' not in child.vars.block_prefixes %} {% set item_class = child.vars.attr.class|default('') %}
    {% if child.vars.label %} {{ form_label(child) -}} {% endif %} {{ form_errors(child) }} {{- form_widget(child) }}
    {% endif %} {% endfor %} {%- if form.parent.vars.max_items > 1 %}
    {{ form_rest(form) }} [ - ]
    {%- else %} {{ form_rest(form) }} {%- endif %}
  • {%- endblock _profile_form_collection_entry_row -%} {# Generic version of collection rows #} {%- block _form_collection_entry_row -%} {{ form_errors(form) }}
  • {% for child in form %} {% if 'hidden' not in child.vars.block_prefixes %} {% set item_class = child.vars.attr.class|default('') %}
    {% if child.vars.label %} {{ form_label(child) -}} {% endif %} {{ form_errors(child) }} {{- form_widget(child) }}
    {% endif %} {% endfor %} {%- if form.parent.vars.max_items > 1 %}
    {{ form_rest(form) }} {%- if form.parent.vars.allow_move %} {%- endif %} {%- if form.parent.vars.allow_delete %} [ - ] {%- endif %}
    {%- else %} {{ form_rest(form) }} {%- endif %}
  • {%- endblock _form_collection_entry_row -%} {# {% block _profile_form_table_collection_row %} {% if label is empty -%} {% set label = name|humanize %} {%- endif -%}
    {{ label }} {{ block('_profile_form_table_collection_widget') }}
    {% endblock _profile_form_table_collection_row %} {% block _profile_form_table_collection_widget %} {% if prototype is defined %} {%- set attr = attr|merge({'data-prototype': form_row(prototype) }) -%} {% endif %} {{- block('form_rows') -}}
    {{ add_item_text }} {% endblock _profile_form_table_collection_widget %} {% block _profile_form_table_collection_entry_row %} {% for child in form %} {{ form_label(child) }} {{ form_widget(child) }} {% endfor %} x remove {% endblock _profile_form_table_collection_entry_row %} #} {# {% block _profile_form_awards_entry_row %}
  • {% for child in form %} {{ form_widget(child) }} {% endfor %} x remove
  • {% endblock _profile_form_awards_entry_row %} #} {# {% block collection_entry_row %}
  • {% for child in form %} {{ form_widget(child) }} {% endfor %} x remove
  • {% endblock collection_entry_row %} #} {# {% block _profile_form_awards_entry_widget %}
  • {% for child in form %} {{ form_widget(child) }} {% endfor %} x remove
  • {% endblock _profile_form_awards_entry_widget %} #} {# {% block item_row %}
  • {% for child in form %} {{ form_widget(child) }} {% endfor %} x remove
  • {% endblock item_row %} #} {# {% block qualification_row %}
  • {% for child in form %} {{ form_widget(child) }} {% endfor %} x remove
  • {% endblock qualification_row %} #} {# {% block awards_row %}
  • {{- form_widget(form.year) }} {{ form_widget(form.description) }} {{ form_widget(form.sequence) }} x remove
  • {% endblock awards_row %} #}