{% extends '@!PrestaShop/Admin/Product/CatalogPage/Lists/list.html.twig' %}
{% block product_catalog_form_table_row %}
	<tr data-uniturl="{{ product.unit_action_url|default('#') }}" data-product-id="{{ product.id_product }}">
        <td class="checkbox-column form-group">
            <div class="md-checkbox md-checkbox-inline">
                <label>
                    <input type="checkbox" id="bulk_action_selected_products-{{ product.id_product }}" name="bulk_action_selected_products[]" value="{{ product.id_product }}">
                    <i class="md-checkbox-control"></i>
                </label>
            </div>
        </td>
        <td>
            <label class="form-check-label" for="bulk_action_selected_products-{{ product.id_product }}">
                {{ product.id_product }}
            </label>
        </td>
        <td>
            <a href="{{ product.url|default('') }}#tab-step1">{{ product.image|raw }}</a>
        </td>
        <td>
            <a href="{{ product.url|default('') }}#tab-step1">{{ product.name|default('N/A'|trans({}, 'Admin.Global')) }}</a>
        </td>
        <td>
            {{ product.reference|default('') }}
        </td>
        <td>
            {{ product.name_category|default('') }}
        </td>
        <td class="text-center">
            <a href="{{ product.url|default('') }}#tab-step2">{{ product.price|default('N/A'|trans({}, 'Admin.Global')) }}</a>
        </td>
        <td class="text-center">
            <a href="{{ product.url|default('') }}#tab-step2">{{ product.price_final|default('N/A'|trans({}, 'Admin.Global')) }}</a>
        </td>

        {% if configuration('PS_STOCK_MANAGEMENT') %}
            <td class="product-sav-quantity text-center" data-product-quantity-value="{{ product.sav_quantity|default('') }}">
                <a href="{{ product.url|default('') }}#tab-step3">
                    {% if product.sav_quantity is defined and product.sav_quantity > 0 %}
                        {{ product.sav_quantity }}
                    {% else %}
                        {{ product.sav_quantity|default('N/A'|trans({}, 'Admin.Global')) }}
                    {% endif %}
                </a>
            </td>
        {% else %}
            <td></td>
        {% endif %}
        <td class="text-center">

          <div
            class="ps-switch ps-switch-sm ps-switch-nolabel ps-switch-center"
            onclick="unitProductAction(this, {% if product.active|default(0) == 0 %}'activate'{% else %}'deactivate'{% endif %});"
          >
          <input type="radio" name="input-{{ product.id_product }}" id="input-false-{{ product.id_product }}" value="0" {% if product.active|default(0) == 0 %}checked{% endif %} aria-label="{{ "Disable %product_name% input"|trans({'%product_name%': product.name}, 'Admin.Global') }}">
              <label for="input-false-{{ product.id_product }}">Off</label>
              <input type="radio" name="input-{{ product.id_product }}" id="input-true-{{ product.id_product }}" value="1" {% if product.active|default(0) != 0 %}checked{% endif %} aria-label="{{ "Enable %product_name% input"|trans({'%product_name%': product.name}, 'Admin.Global') }}">
              <label for="input-true-{{ product.id_product }}">On</label>
              <span class="slide-button"></span>
            </div>
      </td>
      <td>{{ product.seller_name|default('') }}</td>
      {% if product.position is defined %}
          <td {% if activate_drag_and_drop %}class="placeholder"{% endif %} style="cursor: pointer; cursor: hand;">
              {% if activate_drag_and_drop %}
                  <big><big>⇅</big></big>
              {% endif %}
              <span class="position">{{ product.position }}</span>
              <input type="hidden" name="mass_edit_action_sorted_products[]" value="{{ product.id_product }}" />
              <input type="hidden" name="mass_edit_action_sorted_positions[]" value="{{ product.position }}" />
          </td>
      {% endif %}
      <td class="text-right">
          <div class="btn-group-action">

                {% set buttons_action = [
                    {
                        "href": product.preview_url|default('#'),
                        "target": "_blank",
                        "icon": "remove_red_eye",
                        "label": "Preview"|trans({}, 'Admin.Actions')
                    }
                ] %}

                {% set buttons_action = buttons_action|merge([
                    {
                        "onclick": "unitProductAction(this, 'duplicate');",
                        "icon": "content_copy",
                        "label": "Duplicate"|trans({}, 'Admin.Actions')
                    }
                ]) %}

                {% set buttons_action = buttons_action|merge([
                    {
                        "onclick": "unitProductAction(this, 'delete');",
                        "icon": "delete",
                        "label": "Delete"|trans({}, 'Admin.Actions')
                    }
                ]) %}

                {% include '@Product/CatalogPage/Forms/form_edit_dropdown.html.twig' with {
                    'button_id': "product_list_id_" ~ product.id_product ~ "_menu",
                    'default_item': {
                        "href": product.url|default('#'),
                        "icon": "mode_edit"
                    },
                    'right': true,
                    'items': buttons_action
                } %}
            </div>
        </td>
    </tr>
{% endblock %}
