{% extends "@ChillMain/layout.html.twig"  %}

{% set activeRouteKey = 'chill_person_duplicate' %}
{% import '@ChillPerson/PersonDuplicate/_sidepane.html.twig' as sidepane %}

{% block title %}{{ 'Person duplicate'|trans|capitalize ~ ' ' ~ person.firstName|capitalize ~
' ' ~ person.lastName }}{% endblock %}

{% block content %}
<style>
    div.duplicate-content {
        margin: 0 2rem;
    }
    div.col {
        padding: 1em;
        border: 3px solid #cccccc;
    }
    div.border {
        border: 4px solid #3c9f8d;
    }


</style>
<div class="container-fluid content"><div class="duplicate-content">

    <h1>{{ 'Merge duplicate persons folders'|trans }}</h1>

    <div class="col-md-11">
        <p><b>{{ 'Old person'|trans }}</b>:
            {{ 'Old person explain'|trans }}
        </p>
        <div class="col">

            <h1><span><a class="btn btn-show" target="_blank" title="{{ 'Open in another window'|trans }}" href="{{ path('chill_person_view', { person_id : person2.id }) }}"></a></span>
                {{ person2 }}
            </h1>

            <h4>{{ 'Deleted datas'|trans ~ ':' }}</h4>
            {{ sidepane.details(person2) }}

            <h4>{{ 'Moved links'|trans ~ ':' }}</h4>
            {{ sidepane.links(person2) }}
        </div>
    </div>

    <div class="col-md-11">
        <p><b>{{ 'New person'|trans }}</b>:
            {{ 'New person explain'|trans }}
        </p>
        <div class="col border">

            <h1><span><a class="btn btn-show" target="_blank" title="{{ 'Open in another window'|trans }}" href="{{ path('chill_person_view', { person_id : person.id }) }}"></a></span>
                {{ person }}
            </h1>

            <h4>{{ 'Keeped datas'|trans ~ ':' }}</h4>
            {{ sidepane.details(person) }}

            <h4>{{ 'Keeped links'|trans ~ ':' }}</h4>
            {{ sidepane.links(person) }}
        </div>
    </div>

    {{ form_start(form) }}

    <div class="col-md-12 centered">

        <div class="container-fluid" style="padding-top: 1em;">
            <div class="clear" style="padding-top: 10px;">
                {{ form_widget(form.confirm) }}
            </div>
            <div class="col-11">
                {{ form_label(form.confirm) }}
            </div>
        </div>
    </div>

    <ul class="col-12 record_actions">
        <li class="cancel">
            <a href="{{ app.request.headers.get('referer') }}" class="btn btn-chill-gray center margin-5">
                {{ 'Return'|trans }}
            </a>
        </li>
        <li class="cancel">
            <a  href="{{ path('chill_person_duplicate_confirm', { person1_id : person2.id, person2_id : person.id }) }}"
                class="btn btn-action">
                <i class="fa fa-exchange"></i>
                {{ 'Invert'|trans }}
            </a>
        </li>
        <li>
            <button class="btn btn-submit" type="submit"><i class="fa fa-cog fa-fw"></i>{{ 'Merge'|trans }}</button>
        </li>
    </ul>

    {{ form_end(form) }}

</div></div>
{% endblock %}
