{#
 # For the full copyright and license information, please view the
 # docs/licenses/LICENSE.txt file that was distributed with this source code.
 #}
{% form_theme regenThumbnailsForm '@PrestaShop/Admin/TwigTemplateForm/prestashop_ui_kit.html.twig' %}

{{ form_start(regenThumbnailsForm, {action: path('admin_image_settings_regenerate_thumbnails')}) }}
  <div class="card">
    <h3 class="card-header">
      <i class="material-icons">image</i>
      {{ 'Regenerate thumbnails'|trans({}, 'Admin.Design.Feature') }}
    </h3>
    <div class="alert alert-warning mx-3 mt-3 mb-0">
      {{ 'Be careful! Depending on the options selected, former manually uploaded thumbnails might be erased and replaced by automatically generated thumbnails.'|trans({}, 'Admin.Design.Notification') }}
      <br />
      {{ 'Also, regenerating thumbnails for all existing images can take several minutes, please be patient.'|trans({}, 'Admin.Design.Notification') }}
    </div>
    <div class="card-body">
      <div class="form-wrapper">
        {% block form_regenerate_thumbnails_widget %}
          {{ form_rest(regenThumbnailsForm) }}
        {% endblock %}
      </div>
    </div>
    <div class="card-footer clearfix">
      <div class="d-inline-flex float-right">
        <button
          class="btn btn-primary btn-confirm-form"
          id="regenerate-thumbnails-button"
          data-confirm-message="{{ 'Regenerate thumbnails for the selected images? With the "erase" option enabled, the previously selected thumbnails will be deleted.'|trans({}, 'Admin.Design.Notification') }}"
          data-confirm-title="{{ 'Regenerate thumbnails'|trans({}, 'Admin.Design.Feature') }}"
          data-confirm-cancel="{{ 'Cancel'|trans({}, 'Admin.Actions') }}"
          data-confirm-apply="{{ 'Regenerate thumbnails'|trans({}, 'Admin.Actions') }}"
        >{{ 'Regenerate thumbnails'|trans({}, 'Admin.Actions') }}</button>
      </div>
    </div>
  </div>
{{ form_end(regenThumbnailsForm) }}
