{#
 # For the full copyright and license information, please view the
 # docs/licenses/LICENSE.txt file that was distributed with this source code.
 #}
{% set isModuleActive = module.database.active|default('0') %}

<div
  class="module-item module-item-list col-md-12 {% if origin == 'manage' and isModuleActive == '0' %}module-item-list-isNotActive{% endif %}"
  data-id="{{ module.attributes.id }}"
  data-name="{{ module.attributes.displayName }}"
  data-scoring="{{ module.attributes.avgRate }}"
  data-logo="{{ module.attributes.img }}"
  data-author="{{ module.attributes.author }}"
  data-version="{{ module.attributes.version }}"
  data-description="{{ module.attributes.description }}"
  data-tech-name="{{ module.attributes.name }}"
  data-child-categories="{{ module.attributes.categoryName }}"
  data-categories="{{ category }}"
  data-type="{{ module.attributes.productType }}"
  data-price="{{ module.attributes.price.raw }}"
  data-active="{{ isModuleActive }}"
  data-installed="{{ module.database.installed|default('0') }}"
  data-last-access="{{ module.database.last_access_date }}"
>
  <div class="container-fluid">
    <div class="module-item-wrapper-list row">
      <div class="col-lg-1 text-sm-center">
        <div class="module-logo-thumb-list">
          <img src="{{ module.attributes.img }}" class="text-md-center" alt="{{ module.attributes.displayName }}"/>
        </div>
      </div>
      <div class="col-lg-11 row">
        <div class="col-md-10 col-lg-11">
          <h3
            class="text-ellipsis module-name-list"
            data-toggle="pstooltip"
            data-placement="top"
            title="{{ module.attributes.displayName }}"
          >
            {% if module.attributes.displayName %}
              {{ module.attributes.displayName|raw_purified }}

            {% else %}
              {{ module.attributes.name }}
            {% endif %}
          </h3>
        </div>
        <div class="col-md-2">
          <div class="text-ellipsis small-text">
            {% block addon_version %}
              {% if module.attributes.productType == 'service' %}
                {{ 'Service by %author%'|trans({'%author%': '<b>' ~ module.attributes.author ~ '</b>'}, 'Admin.Modules.Feature')|raw_purified }}
              {% else %}
                {{ 'v%version% - by %author%'|trans({'%version%': module.attributes.version, '%author%': '<b>' ~ module.attributes.author ~ '</b>'}, 'Admin.Modules.Feature')|raw_purified }}
              {% endif %}
            {% endblock %}
          </div>
          <div>
            {% if module.attributes.urls.upgrade is defined %}
                <span class="badge badge-success my-1">{{ 'Upgrade available'|trans({}, 'Admin.Modules.Feature') }}</span>
            {% endif %}
          </div>
        </div>
        <div class="col-md-8 col-lg-7 scroll-300">
          {% block addon_description %}
            {{ module.attributes.description|raw_purified }}
            {% if module.attributes.description|length > 0 and module.attributes.description|length < module.attributes.fullDescription|length %}
              ...
            {% endif %}
          {% endblock %}
          {% block addon_additional_description %}
            {% if module.attributes.additional_description is defined %}
              {{ module.attributes.additional_description|raw_purified }}
            {% endif %}
          {% endblock %}
        </div>
        <div class="col-lg-3 text-md-right">
          {% block module_actions %}
            {% if requireBulkActions is defined and requireBulkActions == true %}
              <div class="module-checkbox-bulk-list md-checkbox">
                <label>
                  <input type="checkbox" data-name="{{ module.attributes.displayName }}" data-tech-name="{{ module.attributes.name }}" />
                  <i class="md-checkbox-control"></i>
                </label>
              </div>
            {% endif %}
            {{ include('@PrestaShop/Admin/Module/Includes/action_menu.html.twig', {module: module}) }}
          {% endblock %}
        </div>
        {{ include('@PrestaShop/Admin/Module/Includes/modal_confirm.html.twig', {module: module}) }}
      </div>
    </div>
  </div>
</div>
