{% trans_default_domain 'contao_tl_files' %}

{#  Header #}
<div class="tl_message">
    <p class="tl_confirm">{{ 'tl_files.syncComplete'|trans }}</p>
</div>
<div id="tl_buttons">
    <a href="{{ referer }}" class="header_back" title="{{ 'MSC.backBTTitle'|trans({}, 'contao_default') }}" accesskey="b" data-action="contao--scroll-offset#discard">{{ 'MSC.backBT'|trans({}, 'contao_default') }}</a>
</div>

{# Report #}
<div id="result-list">
    {% set modified = change_set.itemsToUpdate|filter(item => item.updatesHash) %}
    {% set moved = change_set.itemsToUpdate|filter(item => item.updatesPath) %}

    <p>{{ 'tl_files.syncResult'|trans([change_set.itemsToCreate|length, modified|length, '-', moved|length, change_set.itemsToDelete|length], 'contao_tl_files')|raw }}</p>

    {# Added resources #}
    {% for item in change_set.itemsToCreate %}
        <p class="tl_new">{{ 'tl_files.syncAdded'|trans([item.path]) }}</p>
    {% endfor %}

    {# Modified resources #}
    {% for item in modified %}
        <p class="tl_info">{{ 'tl_files.syncChanged'|trans([item.existingPath]) }}</p>
    {% endfor %}

    {# Moved resources #}
    {% for item in moved %}
        <p class="tl_info">{{ 'tl_files.syncMoved'|trans([item.existingPath, item.newPath]) }}</p>
    {% endfor %}

    {# Deleted resources #}
    {% for item in change_set.itemsToDelete %}
        <p class="tl_error">{{ 'tl_files.syncDeleted'|trans([item.path]) }}</p>
    {% endfor %}
</div>

{# Footer #}
<div class="tl_formbody_submit">
    <div class="tl_submit_container">
        <a href="{{ referer }}" class="tl_submit" style="display:inline-block">{{ 'MSC.continue'|trans({}, 'contao_default') }}</a>
    </div>
</div>
