{% extends "@ChillPerson/Person/layout.html.twig"  %}

{% set activeRouteKey = 'chill_person_accompanying_period_list' %}

{% block title %}{{ 'Accompanying period list for person'|trans }}{% endblock title %}

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

    <h1>{{ 'Accompanying period list'|trans }}</h1>

    {% include '@ChillPerson/AccompanyingPeriod/_list.html.twig' %}

    <ul class="record_actions sticky-form-buttons">
        <li class="cancel">
            <a href="{{ path ('chill_person_view', {'person_id' : person.id } ) }}"
               class="btn btn-cancel">{{ 'Person details'|trans }}
            </a>
        </li>
        <li>
            <a class="btn btn-create"
               href="{{ path ('chill_person_accompanying_course_new', {'person_id' : [ person.id ] } ) }}" role="button">
                {{ 'Create an accompanying period'|trans }}
            </a>
        </li>

        {#  Disabled dropdown
        <li class="dropdown">
            <a class="btn btn-create change-icon dropdown-toggle"
               href="#" role="button" id="newAccompanyingPeriod" data-bs-toggle="dropdown" aria-expanded="false">
                {{ 'Create an accompanying period'|trans }}
            </a>
            <ul class="dropdown-menu" aria-labelledby="newAccompanyingPeriod">
                <li>
                    <a class="dropdown-item" href="{{ path ('chill_person_accompanying_course_new', {'person_id' : [ person.id ] } ) }}">
                        <i class="fa fa-fw fa-plus"></i> {{ 'Create an accompanying period'|trans }}
                    </a>
                </li>
                <li>
                    <a class="dropdown-item" href="{{ path ('chill_person_accompanying_period_create', {'person_id' : person.id } ) }}">
                        <i class="fa fa-fw fa-reply"></i> {{ 'Add an accompanying period in the past'|trans }}
                    </a>
                </li>
                {% if person.isOpen == false %}
                    <li>
                        <a class="dropdown-item" href="{{ path('chill_person_accompanying_period_open', {'person_id' : person.id} ) }}">
                            <i class="fa fa-fw fa-unlock"></i> {{'Begin a new accompanying period'|trans }}
                        </a>
                    </li>
                {% endif %}
            </ul>
        </li>
        #}
    </ul>

</div>
{% endblock %}
