{#
 # For the full copyright and license information, please view the
 # docs/licenses/LICENSE.txt file that was distributed with this source code.
 #}
{% 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 %}
