{% set title = (candidacy is defined and candidacy.id) ? 'edit' : 'add' %}

{{ title | trans }}

{% set action = (candidacy is defined and candidacy.id) ? path('app_candidacy_edit', {'id': candidacy.id}) : path('app_candidacy_new',{date:date}) %} {{ form_start(form, {'action': action, 'method': 'POST', 'attr': {'id':'formSubmit'}}) }}
{{ form_label( form.startTime, 'startTime', {'errors' : ''}) }} {{ form_widget(form.startTime) }} {{ form_errors(form.startTime) }}
{{ form_label( form.endTime, 'endTime', {'errors' : ''}) }} {{ form_widget(form.endTime) }} {{ form_errors(form.endTime) }}
{{ form_label( form.candidate, 'candidate', {'errors' : ''}) }} {{ form_widget(form.candidate) }} {{ form_errors(form.candidate) }}
{{ form_label( form.type, '', {'errors' : ''}) }} {{ form_widget(form.type) }} {{ form_errors(form.type) }}
{%if candidacy is defined and candidacy.id %} {{ 'delete'|trans }} {%endif%}
{{ form_end(form) }}