{#
 # This file is part of SolidInvoice package.
 #
 # (c) Pierre du Plessis <open-source@solidworx.co>
 #
 # This source file is subject to the MIT license that is bundled
 # with this source code in the file LICENSE.
 #}

{% extends '@SolidInvoiceInstall/layout.html.twig' %}

{% block content %}

    <div class="row">
        <div class="col-8 offset-2">
            {{ form_start(form) }}

            {{ form_errors(form) }}
            <div class="card card-primary">
                <div class="card-header with-border">
                    <h3 class="card-title" id="install-title">
                        {{ 'installation.setup.title.system_settings'|trans }}
                    </h3>
                </div>
                <div class="card-body">
                    <div class="row">
                        <div class="col-md-6">
                            <h4 class="mb-3">
                                {{ icon('cog') }} {{ 'installation.setup.title.system_settings'|trans }}
                            </h4>
                            {{ form_row(form.locale) }}
                        </div>
                        <div class="col-md-6">
                            {% if userCount > 0 %}
                                <div class="callout callout-warning">
                                    <h4>{{ 'installation.setup.notice'|trans }}</h4>
                                    <p>
                                        {{ 'installation.setup.user_exists'|trans }}
                                    </p>
                                </div>
                            {% else %}
                                <h4 class="mb-3">
                                    {{ icon('user') }} {{ 'installation.setup.title.admin_user'|trans }}
                                </h4>
                                {{ form_rest(form) }}
                            {% endif %}
                        </div>
                    </div>
                </div>
                <div class="card-footer">
                    <div class="row">
                        <div class="col align-self-start">
                            <a href="{{ path('_install_config') }}" class="btn btn-warning btn-block">
                                {{ icon('arrow-left') }} {{ "installation.action.previous"|trans }}
                            </a>
                        </div>
                        <div class="col-7">
                        </div>
                        <div class="col" id="next_button">
                            <button type="submit" class="btn btn-success btn-block" id="continue_step">
                                {{ "installation.action.next"|trans }} {{ icon('arrow-right') }}
                            </button>
                        </div>
                    </div>
                </div>
            </div>

            {{ form_end(form) }}
        </div>
    </div>

{% endblock %}
