{% extends '@ChillPerson/AccompanyingCourse/layout.html.twig' %}

{% set activeRouteKey = 'chill_person_accompanying_period_work_assign_duplicate' %}

{% import '@ChillPerson/AccompanyingPeriodWorkDuplicate/_details.html.twig' as details %}

{% block title %}{{ 'Assign an accompanying period work duplicate' }}{% endblock %}

{% block content %}
    <div class="person-duplicate">

        <div class="col">
            <h4>{{ 'acpw_duplicate.to keep'|trans ~ ':' }}</h4>
            <div class="accompanying-course-work">
                <div class="flex-table">
                    {{ details.details(acpw, accompanyingCourse) }}
                </div>
            </div>
        </div>

        <h1>{{ 'acpw_duplicate.Assign duplicate'|trans }}</h1>
        {{ form_start(form) }}
        {%- if form.acpw is defined -%}
            {{ form_row(form.acpw) }}
            <div id="linked-acpw-selector" data-accompanying-period='{{ accompanyingCourse.id }}'></div>
        {% endif %}
        {{ form_rest(form) }}

        <ul class="record_actions sticky-form-buttons">
            <li class="cancel">
                <a href="{{ path('chill_person_accompanying_period_work_show',  {'id' : acpw.id}) }}" class="btn btn-cancel">
                    {{ 'Return'|trans }}
                </a>
            </li>
            <li>
                <button class="btn btn-action" type="submit">{{ 'Next'|trans }}</button>
            </li>
        </ul>

        {{ form_end(form) }}

    </div>
{% endblock %}

{% block js %}
    {{ parent() }}
    {{ encore_entry_script_tags('mod_duplicate_selector') }}
{% endblock %}

{% block css %}
    {{ parent() }}
    {{ encore_entry_link_tags('mod_duplicate_selector') }}
{% endblock %}
