{% extends '@ChillPerson/CRUD/view.html.twig' %}

{% block content %}
{% embed '@ChillPerson/CRUD/_view_content.html.twig' %}
    {% block crud_content_header %}
        <h1>{{ ('crud.' ~ crud_name ~ '.title_view')|trans({'%person%': person|chill_entity_render_string }) }}</h1>
    {% endblock crud_content_header %}

    {% block crud_content_view_details %}
        <dl class="chill_view_data">
            <dt>Date du rapport</dt>
            <dd>{{ entity.reportDate|format_date('long') }}</dd>

            <dt>Freins identifiés</dt>
            <dd>
                {% if entity.freinsPerso|length > 0 %}
                <ul>
                {% for e in entity.freinsPerso %}
                    <li>{{ ('freins_perso.' ~ e)|trans }}</li>
                {% endfor %}
                </ul>
                {% else %}
                    <p>{{ null|chill_print_or_message("Aucun frein personnel renseigné") }}
                {% endif %}

                {% if entity.notesPerso is not empty %}
                    {{ entity.notesPerso|chill_print_or_message(null, 'blockquote') }}
                {% endif %}
            </dd>

            <dt>Freins d'accès à l'emploi</dt>
            <dd>
                {% if entity.freinsEmploi|length > 0 %}
                <ul>
                {% for e in entity.freinsEmploi %}
                    <li>{{ ('freins_emploi.' ~ e)|trans }}</li>
                {% endfor %}
                </ul>
                {% else %}
                    <p>{{ null|chill_print_or_message("Aucun frein à l'emploi renseigné") }}
                {% endif %}

                {% if entity.notesEmploi is not empty %}
                    {{ entity.notesEmploi|chill_print_or_message(null, 'blockquote') }}
                {% endif %}
            </dd>
        </dl>
    {% endblock crud_content_view_details %}
    {% block content_view_actions_duplicate_link %}{% endblock %}

    {% block content_view_actions_back %}
        <li class="cancel">
            <a class="btn btn-cancel" href="{{ chill_return_path_or('chill_job_report_index', { 'person': entity.person.id }) }}">
                {{ 'Cancel'|trans }}
            </a>
        </li>
    {% endblock %}
{% endembed %}
{% endblock %}
