{#
 # For the full copyright and license information, please view the
 # docs/licenses/LICENSE.txt file that was distributed with this source code.
 #}
<div id="module-modal-import" class="modal modal-vcenter fade" role="dialog" data-backdrop="static" data-keyboard="false">
  <div class="modal-dialog">
    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title module-modal-title">{{ 'Upload a module'|trans({}, 'Admin.Modules.Feature') }}</h4>
        <button id="module-modal-import-closing-cross" type="button" class="close">&times;</button>
      </div>
      <div class="modal-body">
        {% if level <= constant('PrestaShop\\PrestaShop\\Core\\Security\\Permission::LEVEL_UPDATE') %}
          <div class="alert alert-danger" role="alert">
            <p class="alert-text">
              {{ errorMessage }}
            </p>
          </div>
        {% else %}
          <form action="#" class="dropzone" id="importDropzone">
            <div class="module-import-start">
              <i class="module-import-start-icon material-icons">cloud_upload</i><br/>
              <p class="module-import-start-main-text">
                {{ 'Drop your module archive here or [1]select file[/1]'|trans({}, 'Admin.Modules.Feature')|replace({'[1]': '<a href="#" class="module-import-start-select-manual">', '[/1]': '</a>'})|raw_purified }}
              </p>
              <p class="module-import-start-footer-text">
                {{ 'Please upload one file at a time, .zip or tarball format (.tar, .tar.gz or .tgz).'|trans({}, 'Admin.Modules.Help') }}
                {{ 'Your module will be installed right after that.'|trans({}, 'Admin.Modules.Help') }}
              </p>
            </div>
            <div
              class="module-import-processing">
              <!-- Loader -->
              <div class="spinner"></div>
              <p class="module-import-processing-main-text">{{ 'Installing module...'|trans({}, 'Admin.Modules.Notification') }}</p>
              <p class="module-import-processing-footer-text">
                {{ "It will close as soon as the module is installed. It won't be long!"|trans({}, 'Admin.Modules.Notification') }}
              </p>
            </div>
            <div class="module-import-success">
              <i class="module-import-success-icon material-icons">done</i><br/>
              <p class="module-import-success-msg">{{ 'Module installed!'|trans({}, 'Admin.Modules.Notification') }}</p>
              <p class="module-import-success-details"></p>
              <a class="module-import-success-configure btn btn-primary" href="#">{{ 'Configure'|trans({}, 'Admin.Actions') }}</a>
            </div>
            <div class="module-import-failure">
              <i class="module-import-failure-icon material-icons">error</i><br/>
              <p class="module-import-failure-msg">{{ 'Oops... Upload failed.'|trans({}, 'Admin.Modules.Notification') }}</p>
              <a href="#" class="module-import-failure-details-action">{{ 'What happened?'|trans({}, 'Admin.Modules.Help') }}</a>
              <div class="module-import-failure-details"></div>
              <a class="module-import-failure-retry btn btn-secondary" href="#">{{ 'Try again'|trans({}, 'Admin.Actions') }}</a>
            </div>
            <div class="module-import-confirm"></div>
          </form>
        {% endif %}
      </div>
      <div class="modal-footer"></div>
    </div>
  </div>
</div>
