<div class="page__content">
    <h2>{{stepNumber}} - Database structure</h2>
    <p>
        Congratulations! Robert is now able to access its database. Plus, the base
        settings file has been saved on the server, into file
        <code>App/Config/settings.json</code>.
    </p>
    <p> Well done! </p>
    <p>
        All right, now, let's <strong>set the structure</strong> of the database.
        You have nothing special to do, except click on "Next step" button below.
        The wizard will create the structure for you.
    </p>
    {% if stepData['canProcess'] %}
    <a onclick="showHiddenFieldset()" id="showFieldset" class="form__fieldset-toggle">
        Click here to display the current status of database migrations...
    </a>
    <div class="form__fieldset form__fieldset--hidden">
        <p>Migrations list:</p>
        <ul>
            {% for line in stepData['migrationStatus'] %}
            <li>
                <strong>{{line['table']}}</strong> :
                <span
                    {% if line['state'] == 'up' %}
                        class="install__check-success"
                    {% else %}
                        class="install__check-info"
                    {% endif %}
                >
                    {{line['state']|capitalize}}
                </span>
            </li>
            {% endfor %}
        </ul>
        <div>
            (<span class="install__check-info">Down</span> = migration to do,
            <span class="install__check-success">Up</span> = migration already in place)
        </div>
        <a onclick="hideHiddenFieldset()" class="form__fieldset-toggle">
            ^^ Cacher les migrations ^^
        </a>
    </div>
    <form method="POST" class="form">
        <div class="form__submit">
            <button role="submit">Next step</button>
        </div>
    </form>
    {% else %}
    <p class="install__check-error">
        An error occurred while getting status of your database migrations.
        Detailed error (exit code {{stepData['code']}}):
    </p>
    <pre class="install__check-error">
        {{stepData['error']}}
    </pre>
    {% endif %}
</div>

<script src="js/install/fieldsetToggle.js"></script>
