{#
This file is part of EC-CUBE

Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.

http://www.ec-cube.co.jp/

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% extends '@admin/default_frame.twig' %}

{% set menus = ['setting', 'system', 'security'] %}

{% block title %}{{ 'admin.setting.system.security_management'|trans }}{% endblock %}
{% block sub_title %}{{ 'admin.setting.system'|trans }}{% endblock %}

{% form_theme form '@admin/Form/bootstrap_4_layout.html.twig' %}

{% block stylesheet %}
    <style type="text/css">
        .col-sm-2 {
            max-width: none;
        }

        label {
            display: inline;
        }
    </style>
{% endblock %}

{% block main %}
    <form method="post" action="{{ url('admin_setting_system_security') }}">
        {{ form_widget(form._token) }}
        <div class="c-contentsArea__cols">
            <div class="c-contentsArea__primaryCol">
                <div class="c-primaryCol">
                    <div class="card rounded border-0 mb-4">
                        <div class="card-header">
                            <div class="row">
                                <div class="col-8">
                                    <span class="card-title">{{ 'admin.setting.system.security__card_title'|trans }}</span>
                                </div>
                                <div class="col-4 text-right">
                                    <a data-toggle="collapse" href="#basicConfig" aria-expanded="false" aria-controls="basicConfig"><i class="fa fa-angle-up fa-lg"></i></a>
                                </div>
                            </div>
                        </div>
                        <div class="collapse show ec-cardCollapse" id="basicConfig">
                            <div class="card-body">
                                <!-- ディレクトリ名 -->
                                <div class="row mb-2">
                                    <div class="col-3">
                                        <div class="d-inline-block" data-tooltip="true" data-placement="top" title="{{ 'tooltip.setting.system.security.admin_url'|trans }}">
                                            <span>{{ 'admin.setting.system.security.admin_url'|trans }}</span><i class="fa fa-question-circle fa-lg ml-1"></i>
                                        </div>
                                    </div>
                                    <div class="col">
                                        {{ form_widget(form.admin_route_dir) }}
                                        {{ form_errors(form.admin_route_dir) }}
                                    </div>
                                </div>
                                <!-- IP制限 -->
                                <div class="row mb-2">
                                    <div class="col-3">
                                        <div class="d-inline-block" data-tooltip="true" data-placement="top" title="{{ 'tooltip.setting.system.security.ip_limit'|trans }}">
                                            <span>{{ 'admin.setting.system.security.ip_limit'|trans }}</span><i class="fa fa-question-circle fa-lg ml-1"></i>
                                        </div>
                                    </div>
                                    <div class="col">
                                        {{ form_widget(form.admin_allow_hosts, { 'attr': { 'rows': '8', 'placeholder': 'admin.setting.system.security.ip_limit_sample'|trans }}) }}
                                        {{ form_errors(form.admin_allow_hosts) }}
                                        <p>{{ 'admin.setting.system.security.ip_limit_description'|trans|nl2br }}</p>
                                    </div>
                                </div>
                                <!-- 強制SSL -->
                                <div class="row mb-2">
                                    <div class="col-3">
                                        <div class="d-inline-block" data-tooltip="true" data-placement="top" title="{{ 'tooltip.setting.system.security.force_ssl'|trans }}">
                                            <span>{{ 'admin.setting.system.security.force_ssl'|trans }}</span><i class="fa fa-question-circle fa-lg ml-1"></i>
                                        </div>
                                    </div>
                                    <div class="col">
                                        {% if app.request.secure %}
                                            {{ form_widget(form.force_ssl) }}
                                            {{ form_errors(form.force_ssl) }}
                                        {% else %}
                                            {{ form_widget(form.force_ssl, { 'attr': { 'disabled': 'disabled' }}) }}
                                            {{ form_errors(form.force_ssl) }}
                                            <p class="text-danger">{{ 'admin.setting.system.security.force_ssl_description'|trans }}</p>
                                        {% endif %}
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div><!-- /.card -->
                </div>
            </div>

            <div class="c-conversionArea">
                <div class="c-conversionArea__container">
                    <div class="row justify-content-between align-items-center">
                        <div class="col-6">
                            <div class="c-conversionArea__leftBlockItem"></div>
                        </div>
                        <div class="col-6">
                            <div id="ex-conversion-action" class="row align-items-center justify-content-end">
                                <div class="col-auto">
                                    <button type="submit" class="btn btn-ec-conversion px-5">{{ 'admin.common.registration'|trans }}</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </form>
{% endblock %}
