<form class="form-horizontal" method="POST" action="{{ request.url }}">
<div class="modal-header">
  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  <h4 class="modal-title" id="myModalLabel">{{ _('Edit Participant') }}</h4>
</div>
<div class="modal-body" style="padding-bottom:5px; padding-top:20px;">
{{ form.hidden_tag() }}
{%- for field in form -%}
{%- if field.type != 'CSRFTokenField' -%}
<div class="form-group {% if field.errors %}has-error{% endif %}">
    {{ field.label(class_='col-sm-3 control-label') }}
    <div class="col-sm-7">
        {% if field.name == 'supervisor' %}
            {{ field(class_='form-control select2-container span3 select2 select2-observers-clear', **{'data-name': participant.supervisor.name, 'data-participant_id': participant.supervisor.participant_id}) }}
        {% elif field.name == 'location' %}
            {{ field(class_='form-control select2-container span3 select2 select2-locations', **{'data-name': participant.location.name, 'data-location_type': participant.location.location_type}) }}
        {% else %}
        {{ field(class_='form-control span3') }}
        {% endif %}
        {% if field.errors %}
        {% for e in field.errors %}
        <p class="help-block">{{ e }}</p>
        {% endfor %}
        {% endif %}
    </div>
    <div class="col-sm-2"></div>
</div>
{%- endif -%}
{%- endfor -%}
</div>
<div class="modal-footer">
  <div class="row">
    <div class="col-sm-1"></div>
      <div class="col-sm-10" style="padding-right:1.8em;">
        <button type="submit" style="width:122px;"class="btn btn-primary">{{ _('Save') }}</button>
        <button type="button" style="width:122px;"class="btn btn-default" data-dismiss="modal">{{ _('Close') }}</button>
      </div>
  </div>
</div>
</form>
