Current File : /var/www/vinorea/modules/autoupgrade/views/templates/components/local-archive.html.twig
{#**
 * 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 Academic Free License version 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/AFL-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.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
 *#}
{% if (archiveFiles is defined and archiveFiles is not empty) and (xmlFiles is defined and xmlFiles is not empty) %}
  <div class="local-archive">
    <div class="form-group">
      <label for="{{ form_fields.archive_zip }}">
        {{ 'Archive to use'|trans({}) }}
        <span class="require-star">*</span>
      </label>

      <select
        class="form-control {% if errors[form_fields.archive_zip] %} error {% endif %}"
        id="{{ form_fields.archive_zip }}"
        name="{{ form_fields.archive_zip }}"
      >
        <option value="">{{ 'Select an archive'|trans({}) }}</option>
        {% for fileName in archiveFiles %}
          <option
            {% if current_values is defined and current_values.archive_zip == fileName %}
              selected
            {% endif %}
            value="{{ fileName }}"
          >
            {{ fileName }}
          </option>
        {% endfor %}
      </select>

      {% if errors[form_fields.archive_zip] %}
        <div class="error-message">
          <i class="material-icons">error</i>
          {{ errors[form_fields.archive_zip] }}
        </div>
      {% endif %}
    </div>

    <div class="form-group">
      <label for="{{ form_fields.archive_xml }}">
        {{ 'XML file to use'|trans({}) }}
        <span class="require-star">*</span>
      </label>

      <select
        class="form-control {% if errors[form_fields.archive_xml] %} error {% endif %}"
        id="{{ form_fields.archive_xml }}"
        name="{{ form_fields.archive_xml }}"
      >
        <option value="">{{ 'Select a file'|trans({}) }}</option>
        {% for fileName in xmlFiles %}
          <option
            {% if current_values is defined and current_values.archive_xml == fileName %}
              selected
            {% endif %}
            value="{{ fileName }}"
          >
            {{ fileName }}
          </option>
        {% endfor %}
      </select>

      {% if errors[form_fields.archive_xml] %}
        <div class="error-message">
          <i class="material-icons">error</i>
          {{ errors[form_fields.archive_xml] }}
        </div>
      {% endif %}

      {% if errors['global'] %}
        <div class="local-archive__alert">
          {% include "@ModuleAutoUpgrade/components/alert.html.twig" with {
            title: '',
            message: errors['global'],
            alertStatus: 'warning',
          } %}
        </div>
      {% endif %}
    </div>
  </div>
{% else %}
  {% include "@ModuleAutoUpgrade/components/alert.html.twig" with {
    title: '',
    message: 'No archive found in the following directory: /your-admin-directory/autoupgrade/download/'|trans({}),
    alertStatus: 'warning',
  } %}
{% endif %}