{% block form_row %}
{% spaceless %}
    <div class="form-row form-row-{{ name }}">
        {#
        <ol>
            {% for key, value in _context  %}
              <li>{{ key }}</li>
            {% endfor %}
        </ol>
        {{ name }}
        #}
        {{ form_errors(form) }}
        {{ form_label(form) }}
        {#
        <label for="form_{{form.get('name')}}">{{form.get('label')}}:</label>                
        #}
        {{ form_widget(form) }}
        {{ block('field_help') }}
    </div>
{% endspaceless %}
{% endblock form_row %}

{% block form_errors %}
{% spaceless %}
    {% if errors|length > 0 %}    
    <div class="form-errors">
    {% if errors|length == 1 %}    
        {% for error in errors %}
            {{ error.message }}
        {% endfor %}
    {% else %}
    <ul>
        {% for error in errors %}
            <li>{{ error.message }}</li>
        {% endfor %}
    </ul>    
    {% endif %}
    </div>
    {% endif %}
{% endspaceless %}
{% endblock form_errors %}

{% block form_label %}
{% spaceless %}
    {% if label is not sameas(false) %}
        {% if not compound %}
            {% set label_attr = label_attr|merge({'for': id}) %}
        {% endif %}
        {% if required %}
            {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %}
        {% endif %}
        {% if label is empty %}
            {% set label = name|humanize %}
        {% endif %}
        <label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>{{ label|trans({}, translation_domain) }}:</label>
    {% endif %}
{% endspaceless %}
{% endblock form_label %}

{% block datetime_widget %}
{% spaceless %}
    {% if widget == 'single_text' %}
        {{ block('form_widget_simple') }}
    {% else %}
        <div {{ block('widget_container_attributes') }}>
            <table border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td align="left" valign="middle" class="form-datetime-date">
                        {{ form_errors(form.date) }}
                        {{ form_widget(form.date) }}
                    </td>
                    <td align="left" valign="middle" class="form-datetime-time">
                        {{ form_errors(form.time) }}
                        {{ form_widget(form.time) }}
                    </td>
                </tr>
            </table>
        </div>
    {% endif %}
{% endspaceless %}
{% endblock datetime_widget %}

{% block field_help %}
    {% if help is defined %}
        {#
        <ol>
            {% for key, value in _context  %}
              <li>{{ key }}</li>
            {% endfor %}
        </ol>
        #}
        <div class="form-help form-help-{{ name }}">{{ help }}</div>
    {% endif %}
{% endblock %}