{# **
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 * #}
{% extends '@PrestaShop/Admin/layout.html.twig' %}
{% trans_default_domain 'Admin.Advparameters.Feature' %}
{% import '@PrestaShop/Admin/macros.html.twig' as ps %}

{% block content %}
  {{ include('@PrestaShop/Admin/Common/multistore-infotip.html.twig') }}

  {{ form_start(generalForm, {attr: {class: 'form'}, action: path('admin_security_general_save')}) }}
    {% block administration_form_general %}
      <div class="card" id="configuration_fieldset_general">
        <h3 class="card-header">
          <i class="material-icons">settings</i> {{ 'General'|trans({}, 'Admin.Global') }}
        </h3>
        <div class="card-body">
          <div class="form-wrapper">
            {{ form_widget(generalForm) }}
            {{ form_rest(generalForm) }}
          </div>
        </div>
        <div class="card-footer">
          <div class="d-flex justify-content-end">
            <button type="submit" class="btn btn-primary">{{ 'Save'|trans({}, 'Admin.Actions') }}</button>
          </div>
        </div>
      </div>
    {% endblock %}
  {{ form_end(generalForm) }}

  {{ form_start(passwordPolicyForm, {attr: {class: 'form'}, action: path('admin_security_password_policy_save')}) }}
    {% block administration_form_password_policy %}
      <div class="card" id="configuration_fieldset_password_policy">
        <h3 class="card-header">
          <i class="material-icons">settings</i> {{ 'Password policy'|trans({}, 'Admin.Advparameters.Feature') }}
        </h3>
        <div class="card-body">
          <div class="form-wrapper">
            <div class="form-group row">
              {{ form_label(passwordPolicyForm.minimum_score) }}
              <div class="col-sm">
                {{ form_widget(passwordPolicyForm.minimum_score) }}
                <small class="form-text">
                  {{ 'Scores are integers from 0 to 4.'|trans({}, 'Admin.Advparameters.Help') }}
                  <ol id="help-password-score">
                    <li>{{ '0 means the password is extremely easy to guess (within 10^3 guesses). Dictionary words like "password" or "mother" score 0.'|trans({}, 'Admin.Advparameters.Feature') }}</li>
                    <li>{{ '1 is still very easy to guess (guesses less than 10^6). An extra character on a dictionary word can score 1.'|trans({}, 'Admin.Advparameters.Feature') }}</li>
                    <li>{{ '2 is pretty easy to guess (guesses less than 10^8). It provides some protection from unthrottled online attacks.'|trans({}, 'Admin.Advparameters.Feature') }}</li>
                    <li>{{ '3 is safely unguessable (guesses less than 10^10). It offers moderate protection from offline slow-hash scenario.'|trans({}, 'Admin.Advparameters.Feature') }}</li>
                    <li>{{ '4 is very unguessable (guesses greater than or equal to 10^10) and provides strong protection from offline slow-hash scenario.'|trans({}, 'Admin.Advparameters.Feature') }}</li>
                  </ol>
                </small>
              </div>
            </div>
            {{ form_rest(passwordPolicyForm) }}
          </div>
        </div>
        <div class="card-footer">
          <div class="d-flex justify-content-end">
            <button type="submit" class="btn btn-primary">{{ 'Save'|trans({}, 'Admin.Actions') }}</button>
          </div>
        </div>
      </div>
    {% endblock %}
  {{ form_end(passwordPolicyForm) }}
{% endblock %}
