{% extends 'base.html.twig' %}

{% block stylesheets %}
<link href="{{ asset('css/main.css') }}" rel="stylesheet" />
<link href='{{ asset('css/jquery-ui.theme.css') }}' rel='stylesheet' />
<link href='{{ asset('css/jquery-ui.structure.css') }}' rel='stylesheet' />
<link href='{{ asset('styles/style.css') }}' rel='stylesheet' />
<link href='//cdn.datatables.net/2.0.8/css/dataTables.dataTables.min.css' rel='stylesheet' />
<style>
button.button i {
    font-size: 1.5em;
}
.input-error {
    border: solid 2px red !important;
}
</style>
{% endblock %}

{% block javascripts %}
<script src="{{ asset('js/jquery.min.js') }}"></script>
<script src='{{ asset('js/jquery-ui.js') }}'></script>
<script src="{{ asset('js/browser.min.js') }}"></script>
<script src="{{ asset('js/breakpoints.min.js') }}"></script>
<script src="{{ asset('js/util.js') }}"></script>
<script src="{{ asset('js/main.js') }}"></script>
<script src='//momentjs.com/downloads/moment-with-locales.js'></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/markdown-it/13.0.2/markdown-it.min.js" integrity="sha512-ohlWmsCxOu0bph1om5eDL0jm/83eH09fvqLDhiEdiqfDeJbEvz4FSbeY0gLJSVJwQAp0laRhTXbUQG+ZUuifUQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src='//cdn.datatables.net/2.0.8/js/dataTables.min.js'></script>
{% endblock %}

{% block body %}
<div class="container mt-5 text-center">
    <h2 class="text-success">Database Transfer Complete!</h2>
    <p>Your data has been successfully moved to the new database, and the environment variables have been updated.</p>

    {% if logs|length > 0 %}
        <div class="alert alert-warning text-start mx-auto" style="max-width: 600px;">
            <h5 class="alert-heading">Data Clean-up Notice</h5>
            <p>During the transfer, the following orphaned records were safely ignored to maintain database integrity:</p>
            <ul>
                {% for log in logs %}
                    <li>{{ log }}</li>
                {% endfor %}
            </ul>
        </div>
    {% else %}
        <div class="alert alert-success mx-auto" style="max-width: 600px;">
            Perfect transfer! No orphaned records were found.
        </div>
    {% endif %}

    <div class="mt-4">
        <p class="text-muted">You must log in again to establish a connection with the new database.</p>
        <a href="{{ path('app_logout') }}" class="btn btn-primary btn-lg">Acknowledge & Relogin</a>
    </div>
</div>
{% endblock %}