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

{% import '@ChillThirdParty/ThirdPartyDuplicate/_details.html.twig' as details %}

{% block title %}{{ 'thirdparty_duplicate.Thirdparty duplicate title'|trans ~ ' ' ~ thirdparty.name }}{% 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>{{ 'thirdparty_duplicate.title'|trans }}</h1>

            <div class="col-md-11">
                <p><b>{{ 'thirdparty_duplicate.Thirdparty to delete'|trans }}</b>:
                    {{ 'thirdparty_duplicate.Thirdparty to delete explanation'|trans }}
                </p>
                <div class="col">

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

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

{#                    <h4>{{ 'Moved links'|trans ~ ':' }}</h4>#}
{#                    {{ details.links(thirdparty2) }}#}
                </div>
            </div>

            <div class="col-md-11 mt-3">
                <p><b>{{ 'thirdparty_duplicate.Thirdparty to keep'|trans }}</b>:
                    {{ 'thirdparty_duplicate.Thirdparty to keep explanation'|trans }}
                </p>
                <div class="col border">

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

                    <h4>{{ 'thirdparty_duplicate.Data to keep'|trans ~ ':' }}</h4>
                    {{ details.details(thirdparty) }}

{#                    <h4>{{ 'thirdparty_duplicate.links to keep'|trans ~ ':' }}</h4>#}
{#                    {{ sidepane.links(thirdparty) }}#}
                </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="record_actions sticky-form-buttons">
                <li class="cancel">
                    <a href="{{ path('chill_thirdparty_find_duplicate', {thirdparty_id : thirdparty.id}) }}" class="btn btn-cancel">
                        {{ 'Cancel'|trans }}
                    </a>
                </li>
                <li>
                    <a  href="{{ path('chill_thirdparty_duplicate_confirm', { thirdparty1_id : thirdparty2.id, thirdparty2_id : thirdparty.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 %}
