{{ header }}
<header class="background-white bottom-margin-large">
  <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">
          <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 class="btn-default btn-outline btn-medium right-margin-small js-submit-main-form">
              <span>{{ button_delete }}</span>
            </a>
            <a href="{{ insert }}" class="btn-primary btn-medium btn-default">
              <span>{{ button_insert }}</span>
            </a>
          </div>
        </div>
        {% if error_warning %}
          <div class="text-small text-error background-error padding-medium rounded-x-small full-width">{{ error_warning }}</div>
        {% endif %}
        {% if success %}
          <div class="text-small text-success background-success padding-medium rounded-x-small full-width">{{ success }}</div>
        {% endif %}
      </div>
    </div>
  </div>
</header>
<div class="container-fluid">
  <div class="row no-space-xs">
    <div class="col-xs-12">
      <div class="content">
        <div class="pull-right bottom-padding-small flex between-xs middle-xs">
          {% if filter_count >= 1 %}
            <a class="text-small text-primary text-decoration-none horizontal-padding-large vertical-padding-small" href="index.php?route=sale/return&token={{ token }}">
              <span>Limpar Filtros ({{ 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>Filtrar</span>
          </button>
        </div>
        <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">Filtros</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">
            <label class="field field-medium top-margin-medium">
              <span class="field-label">{{ column_return_id }}</span>
              <input class="field-entry" type="text" name="filter_return_id" value="{{ filter_return_id }}">
            </label>
            <label class="field field-medium top-margin-medium">
              <span class="field-label">{{ column_order_id }}</span>
              <input class="field-entry" type="text" name="filter_order_id" value="{{ filter_order_id }}">
            </label>
            <label class="field field-medium top-margin-medium">
              <span class="field-label">{{ column_customer }}</span>
              <input class="field-entry" type="text" name="filter_customer" value="{{ filter_customer }}">
            </label>
            <label class="field field-medium top-margin-medium">
              <span class="field-label">{{ column_product }}</span>
              <input class="field-entry" type="text" name="filter_product" value="{{ filter_product }}">
            </label>
            <label class="field field-medium top-margin-medium">
              <span class="field-label">{{ column_model }}</span>
              <input class="field-entry" type="text" name="filter_model" value="{{ filter_model }}">
            </label>
            <label class="field field-medium top-margin-medium">
              <span class="field-label">{{ column_status }}</span>
              <select class="field-entry" name="filter_return_status_id">
                <option value="*">Todos</option>
                {% for return_status in return_statuses %}
                  <option value="{{ return_status.return_status_id }}" {{ return_status.return_status_id == filter_return_status_id ? 'selected' : '' }}>{{ return_status.name }}</option>
                {% endfor %}
              </select>
            </label>
            <label class="field field-medium top-margin-medium">
              <span class="field-label">{{ column_date_added }}</span>
              <input class="field-entry date" type="text" name="filter_date_added" value="{{ filter_date_added }}">
            </label>
            <label class="field field-medium top-margin-medium">
              <span class="field-label">{{ column_date_modified }}</span>
              <input class="field-entry date" type="text" name="filter_date_modified" value="{{ filter_date_modified }}">
            </label>
          </div>
          <div class="padding-large">
            <a class="btn-default btn-medium btn-full btn-primary js-btn-filter">
              <span>{{ button_filter }}</span>
            </a>
          </div>
        </div>
      </div>
    </div>
    <div class="col-xs-12">
      <form action="{{ delete }}" method="post" class="js-main-form">
        {% if returns %}
          {% for return in returns %}
            <div class="content-box flex middle-xs background-white shadow-small bottom-margin-small">
              <div class="left-margin-medium">
                <label class="checkbox checkbox-medium">
                  <input
                    type="checkbox"
                    class="checkbox-entry"
                    name="selected[]"
                    value="{{ return.return_id }}"
                    {{ return.selected ? 'checked="checked"' : '' }}
                  />
                  <span class="checkbox-text"></span>
                </label>
              </div>
              <div class="col-xs-width-auto">
                <div class="content-box">
                  <span class="text-small text-dark text-bold">#{{ return.return_id }}</span>
                </div>
              </div>
              <div class="col-xs-12 col-md">
                <div class="content-box">
                  <span class="text-small text-dark visible-block">{{ return.customer }}</span>
                  <span class="text-small text-gray">{{ return.product }}</span>
                </div>
              </div>
              <div class="col-xs-width-auto">
                <div class="content-box">
                  <span class="text-small text-gray" data-tooltip="id do pedido">#{{ return.order_id }}</span>
                </div>
              </div>
              <div class="col-xs-8 col-md-2">
                <div class="content-box">
                  <span class="text-small text-dark">{{ return.status }}</span>
                </div>
              </div>
              <div class="col-xs-width-auto">
                <div class="content-box">
                  {% for action in return.action %}
                    <a href="{{ action.href }}" class="btn-default btn-medium btn-outline"><span>{{ action.text }}</span></a>
                  {% endfor %}
                </div>
              </div>
            </div>
          {% endfor %}
        {% else %}
          <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>
        {% endif %}
      </form>
      <div class="row top-margin-medium">
        <div class="col-xs-12">
          <div class="content-box">
            {{ pagination }}
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
{{ footer }}