{{ form_start(form, {'attr' : {'id' : 'create-form'}}) }}
{{ form_errors(form) }}
{{ form_row(form.kind) }}
    <div id="linked-entity">
        <fieldset class="mb-3">
            <div class="row">
                <legend class="col-sm-4 col-form-label">Associer un</legend>
                <div class="col-sm-8">
                    <div id="entity-selector">
                        <div class="form-check">
                            {% if resource is defined and resource.person is not null %}
                                <input checked type="radio" id="chill_personbundle_person_resource_linkedEntity_0" name="linked-entity" class="form-check-input" value="person" {% if form.vars.submitted and app.request.request.get('linked-entity', null) == 'person' %}checked{% endif %}/>
                                <label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_0">{{ 'person_resource.person_non_prof'|trans }}</label>
                            {% else %}
                                <input type="radio" id="chill_personbundle_person_resource_linkedEntity_0" name="linked-entity" class="form-check-input" value="person" />
                                <label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_0">{{ 'person_resource.person_non_prof'|trans }}</label>
                            {% endif %}
                        </div>
                        <div class="form-check">
                            {% if resource is defined and resource.thirdparty is not null %}
                                <input checked type="radio" id="chill_personbundle_person_resource_linkedEntity_1" name="linked-entity" class="form-check-input" value="thirdparty" {% if form.vars.submitted and app.request.request.get('linked-entity', null) == 'thirdparty' %}checked{% endif %}/>
                                <label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_1">{{ 'person_resource.thirdparty_prof'|trans }}</label>
                            {% else %}
                                <input type="radio" id="chill_personbundle_person_resource_linkedEntity_1" name="linked-entity" class="form-check-input" value="thirdparty" />
                                <label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_1">{{ 'person_resource.thirdparty_prof'|trans }}</label>
                            {% endif %}
                        </div>
                        <div class="form-check">
                            {% if resource is defined and resource.freeText is not null %}
                                <input checked type="radio" id="chill_personbundle_person_resource_linkedEntity_2" name="linked-entity" class="form-check-input" value="freetext" {% if form.vars.submitted and app.request.request.get('linked-entity', null) == 'thirdparty' %}checked{% endif %}/>
                                <label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_2">{{ 'person_resource.freetext'|trans }}</label>
                            {% else %}
                                <input type="radio" id="chill_personbundle_person_resource_linkedEntity_2" name="linked-entity" class="form-check-input" value="freetext" />
                                <label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_2">{{ 'person_resource.freetext'|trans }}</label>
                            {% endif %}
                        </div>
                    </div>
                </div>
            </div>
        </fieldset>
    </div>


    <div id="person-entity">
        {{ form_row(form.person) }}
    </div>
    <div id="thirdparty-entity">
        {{ form_row(form.thirdparty) }}
    </div>
    <div id="freetext-entity">
        {{ form_row(form.freetext) }}
    </div>


{{ form_row(form.comment) }}

{% if action is defined %}
    <ul class="record_actions sticky-form-buttons">
        <li class="cancel">
            <a href="{{ path('chill_person_resource_list', { 'person_id': resource.personOwner.id  } ) }}" class="btn btn-cancel">
                {{ 'Cancel'|trans }}
            </a>
        </li>
        <li class="edit">
            <button class="btn btn-edit"
            type="submit" id="newPersonResource">
                {{ 'edit resource'|trans|capitalize }}
            </button>
        </li>
    </ul>
{% else %}
    <ul class="record_actions">
        <li>
            <button class="btn btn-create"
            type="submit" id="newPersonResource">
                {{ 'Save'|trans }}
            </button>
        </li>
    </ul>
{% endif %}

{{ form_end(form) }}
