{% extends '@CpCreationVitiCore/admin/base.html.twig' %}

{% block title %}{{ 'age_verification.admin.page_title'|trans }} - {{ parent() }}{% endblock %}

{% block content %}
    <h1 class="page-header">{{ 'age_verification.admin.heading'|trans }}</h1>

    <form action="{{ path('admin_age_verification') }}" method="POST" novalidate>
        <div class="panel panel-default">
            <div class="panel-heading">
                <button type="submit" class="btn btn-primary form-submit btn-rounded">
                    {{ 'age_verification.admin.save'|trans }}
                </button>
                <div class="clearfix"></div>
            </div>
        </div>

        {% if not form.vars.valid %}
            <div class="alert alert-danger" role="alert">
                <strong>{{ 'age_verification.admin.errors_heading'|trans }}</strong>
                {{ form_errors(form) }}
            </div>
        {% endif %}

        <div class="row">
            <div class="col-md-5">
                <div class="panel panel-info">
                    <div class="panel-heading">{{ 'age_verification.admin.general_settings'|trans }}</div>
                    <div class="panel-body">
                        {{ form_row(form.enabled) }}
                        {{ form_row(form.defaultCountryCode) }}
                        {{ form_row(form.defaultMinimumAge) }}
                        {{ form_row(form.rememberForDays) }}
                    </div>
                </div>
            </div>
            <div class="col-md-7">
                <div class="panel panel-info">
                    <div class="panel-heading">{{ 'age_verification.admin.country_rules'|trans }}</div>
                    <div class="panel-body">
                        <div class="alert alert-info" role="note">
                            <strong>{{ 'age_verification.admin.country_rules_association'|trans }}</strong><br>
                            {{ 'age_verification.admin.country_rules_intro'|trans }}
                        </div>
                        {{ form_row(form.countryRules, {
                            attr: {
                                class: 'age-verification-country-rule-collection',
                                'data-add-label': 'age_verification.admin.add_rule'|trans,
                                'data-remove-label': 'age_verification.admin.remove_rule'|trans,
                            },
                        }) }}
                    </div>
                </div>
            </div>
        </div>

        {{ form_rest(form) }}

        <div class="panel panel-default">
            <div class="panel-heading">
                <button type="submit" class="btn btn-primary form-submit btn-rounded">
                    {{ 'age_verification.admin.save'|trans }}
                </button>
                <div class="clearfix"></div>
            </div>
        </div>
    </form>
{% endblock %}
