{{ header }}
<div id="meuConfirm" style="display:none;" title="Confirmar"></div>
<header
  class="background-white bottom-margin-large"
  data-info='{"titleModules": "{{ constant('Type_TitleModules::Tp_Config') }}", "urlRetorno": "{{ url.retorno }}", "type_marketplace": "{{ type_marketplace }}", "type": {{ type }} }'
>
  <div class="container-fluid">
    <div class="row no-space-xs">
      <div class="col-xs-12">
        <div class="content-box vertical-padding-large flex between-xs middle-xs js-header-notifications">
          <div>
            <span class="text-x-large text-dark">{{ heading_title }}</span>
            <div class="adm-breadcrumb">
              {% for breadcrumb in breadcrumbs %}
                <i class="fas fa-angle-right text-x-small text-gray horizontal-padding-small"></i>
                <a href="{{ breadcrumb.href }}"
                   class="text-x-small text-gray text-decoration-none">{{ breadcrumb.text }}</a>
              {% endfor %}
            </div>
          </div>
          <div class="flex flex-row middle-xs">
            <a href="{{ url.cancel }}"
               class="btn-default btn-medium btn-outline right-margin-small">
              <span>Cancelar</span>
            </a>
            <a class="btn-default btn-medium btn-primary js-bulkSetting" data-modal-id="bulk-setting">
              <span>{{ text_bulk_ml_product }}</span>
            </a>
          </div>
          {% if error_warning %}<div class="warning full-width">{{ error_warning }}</div>{% endif %}
          {% if success %}<div class="success full-width">{{ success }}</div>{% endif %}
        </div>
      </div>
    </div>
  </div>
</header>
<div class="container-fluid">
  <div class="row bottom-padding-small">
    <div class="col-xs-12">
      <div class="content-box">
        <div class="flex end-xs">
          {% if filter_count >= 1 %}
            <a class="text-small text-primary text-decoration-none horizontal-padding-large vertical-padding-small"
               href="{{ url.clear_filter }}">
              <span>{{ text_cleaning_filters }} ({{ filter_count }})</span>
            </a>
          {% endif %}
          <button type="button" class="btn-default btn-medium-square btn-primary js-suspended-side-control"
                  id="suspended-side-filter">
            <i class="fas fa-filter"></i>
            <span>{{ button_filter }}</span>
          </button>
          <form class="js-filter">
            <div class="adm-suspended-side background-white shadow-large flex flex-column auto-overflow js-suspended-side js-suspended-side-filter">
              <div
                class="horizontal-padding-large top-padding-large bottom-padding-small flex between-xs middle-xs js-suspended-side-close">
                <span class="text-x-large text-dark">{{ text_filters }}</span>
                <i class="fas fa-times text-medium text-gray padding-small cursor-pointer"></i>
              </div>
              <div class="adm-suspended-side-content horizontal-padding-large">
                <div class="field-group top-margin-medium">
                  <label class="field-label" for="filter_product_ml_id">{{ text_filter_product_ml_id }}</label>
                  <input class="field-entry field-entry-medium" type="text" id="filter_product_ml_id"
                         name="filter_product_ml_id" value="{{ filter_product_ml_id }}" />
                </div>
                <div class="field-group top-margin-medium">
                  <label class="field-label" for="filter_model">{{ text_filter_product_id }}</label>
                  <div class="field-entry-group">
                    <select class="field-entry field-entry-medium" name="filter_content_model" id="filter_content_model">
                      {% for key, value in content_model %}
                        <option value="{{ value.content_model_id }}" {{ value.content_model_status }}>{{ value.content_model_name }}</option>
                      {% endfor %}
                    </select>
                    <input class="field-entry field-entry-medium" type="text" id="filter_model" name="filter_model" value="{{ filter_model }}" />
                  </div>
                </div>
                <div class="field-group top-margin-medium">
                  <label class="field-label" for="filter_product_ml_id">{{ text_filter_name }}</label>
                  <input class="field-entry field-entry-medium" type="text" id="filter_name" name="filter_name" value="{{ filter_name }}" />
                </div>
              </div>
              <div class="padding-large">
                <button type="button" class="btn-default btn-medium btn-full btn-primary js-filter-error">
                  <span>{{ button_filter }}</span>
                </button>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
  <div class="row no-space-xs bottom-padding-small middle-xs">
    <div class="col-xs-12">
      {% if errors %}
        <form action="" method="post" enctype="multipart/form-data" id="form">
          {% for error in errors %}
            <div
              class="middle-xs background-white shadow-small bottom-margin-small border-error horizontal-padding-medium">
              <div class="flex middle-xs">

                <div class="col-xs-width-auto">
                  <label class="checkbox right-margin-medium bottom-margin-x-small">
                    {% if error.selected or error.ml_error %}
                      <input class="checkbox-entry" type="checkbox" name="selected[]"
                             value="{{ error.product_key_id }}" checked />
                    {% else %}
                      <input class="checkbox-entry" type="checkbox" name="selected[]"
                             value="{{ error.product_key_id }}"
                             {% if error.cod_error == constant('Type_ErrorGrade::Tp_ErGrid') %}disabled{% endif %} />
                    {% endif %}
                    <span class="checkbox-text"></span>
                  </label>
                </div>

                <div class="col-xs col-md-2">
                  <span class="text-small text-bold text-dark"># {{ error.cod_mercadolivre }}</span>
                </div>

                <div class="col-xs col-md">
                  <span class="text-small text-dark visible-block">{{ error.name }}</span>
                </div>

                <div class="col-xs col-md-2">
                  <span class="text-small" data-tooltip="Código da Loja Virtual"># {{ error.cod_ecommerce }}</span>
                </div>

                <div class="col-xs-width-auto">
                  <div class="new-dropdown visible-inline-block js-new-dropdown">
                    <div class="new-dropdown-control">
                      <span class="new-dropdown-control-dot"></span>
                      <span class="new-dropdown-control-dot"></span>
                      <span class="new-dropdown-control-dot"></span>
                    </div>
                    <div class="new-dropdown-content background-white border-gray shadow-medium right js-new-dropdown-content">
                      {% if error.cod_error == constant('Type_ErrorGrade::Tp_ErGrid') %}
                        <a
                          class="new-dropdown-content-item text-small text-dark text-decoration-none js-mlerror-grade"
                          data-product-grid-id="{{ error.product_key_id }}">
                          Ajustar anúncio
                        </a>
                      {% else %}
                        <a class="new-dropdown-content-item text-small text-dark text-decoration-none js-bulkSettingUnique"
                           data-product-id="{{ error.product_key_id }}"
                           data-prod-type="{{ error.type_product }}">
                          Editar ficha técnica
                        </a>
                      {% endif %}
                      {% for key, value in error.mktError %}
                        <a class="new-dropdown-content-item text-small text-dark text-decoration-none {{ key }}" data-link="{{ value }}">
                          {{ key }}
                        </a>
                      {% endfor %}
                    </div>
                  </div>
                </div>
                <div class="full-width">
                  {% if error.mkt_error_grade %}
                    <span
                      class="text-error background-error top-border-error left-border-error right-border-error vertical-padding-small horizontal-padding-medium text-small visible-block">
                      {{ error.mkt_error_grade }}
                    </span>
                  {% endif %}
                  {% if error.ml_error %}
                    <span
                      class="text-error background-error top-border-error left-border-error right-border-error vertical-padding-small horizontal-padding-medium text-small visible-block">
                  {{ error.ml_error }}
                    </span>
                  {% endif %}
                  {% if error.ml_warning %}
                    <span
                      class="text-warning background-warning top-border-warning left-border-warning right-border-warning vertical-padding-small horizontal-padding-medium text-small visible-block">
                  {{ error.ml_warning }}
                    </span>
                  {% endif %}
                </div>
                {% if error.msg_error %}
                <div class="background-error vertical-padding-small horizontal-padding-medium border-error full-width" style="margin-bottom:-1px;">
                  {% if error.help %}
                    <a href="{{ error.help }}" target="_blank">
                      <i class="fas fa-question-circle text-medium text-info"></i>
                    </a>
                  {% endif %}
                  <span class="text-small background-error text-error">{{ error.msg_error }}</span>
                </div>
                {% endif %}
              </div>
            </div>
          {% endfor %}
        </form>
        <div class="row top-margin-medium">
          <div class="col-xs-12">
            <div class="content-box">
              {{ pagination }}
            </div>
          </div>
        </div>
      {% else %}
        <div class="row">
          <div class="col-xs-12">
            <div class="content-box background-white shadow-small vertical-padding-x-large horizontal-padding-large text-center">
              <span class="text-medium text-gray">{{ text_no_results }}</span>
            </div>
          </div>
        </div>
      {% endif %}
    </div>
  </div>
</div>
{{ footer }}