<h1>
    {{ "Activity creation"|trans }}
</h1>
<h2 class="badge-title mb-5">
    <span class="title_label"></span>
    <span class="title_action">
        {{ entity.type.name | localize_translatable_string }}
    </span>
</h2>

{{ form_start(form) }}
{{ form_errors(form) }}

{%- if form.emergency is defined -%}
    {{ form_row(form.emergency) }}
{% endif %}

{%- if form.sentReceived is defined -%}
    {{ form_row(form.sentReceived) }}
{% endif %}

{%- if form.user is defined -%}
    {{ form_row(form.user) }}
{% endif %}

{%- if form.scope is defined -%}
    {{ form_row(form.scope) }}
{% endif %}

{%- if form.socialIssues is defined -%}
    {{ form_row(form.socialIssues) }}
{% endif %}

{%- if form.socialActions is defined -%}
    {{ form_row(form.socialActions) }}
{% endif %}

{%- if form.socialIssues is defined or form.socialActions is defined -%}
    <div id="social-issues-acc"></div>
{% endif %}

{%- if form.reasons is defined -%}
    {{ form_row(form.reasons) }}
{% endif %}

{%- if form.persons is defined or form.thirdParties is defined or form.users is defined -%}

    <h2 class="chill-blue">{{ 'Concerned groups'|trans }}</h2>

    {%- if form.persons is defined -%}
        {{ form_widget(form.persons) }}
    {% endif %}
    {%- if form.thirdParties is defined -%}
        {{ form_widget(form.thirdParties) }}
    {% endif %}
    {%- if form.users is defined -%}
        {{ form_widget(form.users) }}
    {% endif %}

    <div id="add-persons"></div>

{% endif %}

<h2 class="chill-blue">{{ 'Activity data'|trans }}</h2>

{%- if form.date is defined -%}
    {{ form_row(form.date) }}
{% endif %}

{%- if form.location is defined -%}
    {{ form_row(form.location) }}
    <div id="location"></div>
{% endif %}

{%- if form.durationTime is defined -%}
    {{ form_row(form.durationTime) }}
{% endif %}

{%- if form.travelTime is defined -%}
    {{ form_row(form.travelTime) }}
{% endif %}

{%- if form.comment is defined -%}
    {{ form_row(form.comment) }}
{% endif %}

{%- if form.privateComment is defined -%}
    {{ form_row(form.privateComment) }}
{% endif %}

{%- if form.attendee is defined -%}
    {{ form_row(form.attendee) }}
{% endif %}

{%- if form.documents is defined -%}
    {{ form_row(form.documents) }}
    <div data-docgen-template-picker="data-docgen-template-picker" data-entity-class="Chill\ActivityBundle\Entity\Activity" data-entity-id="{{ entity.id }}"></div>
{% endif %}

{# TODO .. status #}

<ul class="record_actions sticky-form-buttons">
  <li class="cancel">
    <a
      class="btn btn-cancel"
      {%- if context == 'person' -%}
      href="{{ chill_return_path_or('chill_activity_activity_list', { 'person_id': person.id } )}}"
      {%- else -%}
      href="{{ chill_return_path_or('chill_activity_activity_list', { 'accompanying_period_id': accompanyingCourse.id } )}}"
      {%- endif -%}
      >
      {{ 'Cancel'|trans|chill_return_path_label }}
    </a>
  </li>
  <li>
    <button class="btn btn-save" type="submit">
      {{ 'Create'|trans }}
    </button>
  </li>
</ul>
{{ form_end(form) }}

{% block js %}
    {{ encore_entry_script_tags('mod_pickentity_type') }}
{% endblock %}

{% block css %}
    {{ encore_entry_link_tags('mod_pickentity_type') }}
{% endblock %}