{{ header }}

<header class="background-white bottom-margin-large"
  data-info='{
    "languages": {{ languageForJS|json_encode() }},
    "banners": {{ banners|json_encode() }},
    "escolas": {{ escolas|json_encode() }},
    "layout": {{ school_layout|json_encode() }}
  }'
>
  <div class="container-fluid">
    <div class="row no-space-xs middle-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="{{cancel}}" class="right-margin-small btn-default btn-medium btn-outline">
              <span>{{button_cancel}}</span>
            </a>
            <button class="btn-default btn-medium btn-primary js-autentication js-submit-main-form">
              <span>{{button_save}}</span>
            </button>
          </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 class="col-xs-12">
        <div class="flex js-tabs" id="tab-info"></div>
      </div>
    </div>
  </div>
</header>
<form action="{{ action }}" method="post" class="js-main-form">
  <div class="container-fluid" data-tabs-id="tab-info">
    <div class="row hidden" data-tab="{{ tab_general }}">
      <div class="col-xs-12">
        <div class="content-box">
          <div class="flex middle-xs">
            <span class="text-x-large text-dark">{{ tab_general }}</span>
          </div>
        </div>
      </div>
      <div class="col-xs-12 col-md-8">
        <div class="content-box background-white padding-large shadow-small">
          <div class="row">
            <div class="col-xs-12">
              <div class="content-box field-group">
                <label class="field-label">{{entry_status}}</label>
                <select class="field-entry field-entry-medium js-sort-by-option" name="listaescolar_status">
                  {% for status in status_list %}
                    <option value="{{ status.key }}" {{ status.selected }}>{{ status.value }}</option>
                  {% endfor %}
                </select>
              </div>
            </div>

            <div class="col-xs-12">
              <div class="content-box field-group">
                <label class="field-label">{{entry_exibir_menu}}</label>
                <select class="field-entry field-entry-medium js-sort-by-option" name="listaescolar_exibe_menu">
                  {% for status_menu in status_menu_list %}
                    <option value="{{ status_menu.key }}" {{ status_menu.selected }}>{{ status_menu.value }}</option>
                  {% endfor %}
                </select>
              </div>
            </div>

            <div class="col-xs-12">
              <div class="content-box field-group">
                <label class="field-label">{{entry_exibir_descricao}}</label>
                <select class="field-entry field-entry-medium js-sort-by-option" name="listaescolar_exibir_descricao">
                  {% for status_descricao in status_descricao_list %}
                    <option value="{{ status_descricao.key }}" {{ status_descricao.selected }}>{{ status_descricao.value }}</option>
                  {% endfor %}
                </select>
              </div>
            </div>

            <div class="col-xs-12">
              <div class="content-box field-group">
                <label class="field-label">{{entry_listaescolar_ordenacao}}</label>
                <select class="field-entry field-entry-medium js-sort-by-option" name="listaescolar_ordenacao">
                  {% for ordenacao in ordenacao_lista %}
                  <option value="{{ ordenacao.key }}" {{ ordenacao.selected }}>{{ ordenacao.value }}</option>
                  {% endfor %}
                </select>
              </div>
            </div>

            <div class="col-xs-12">
              <div class="content-box field-group">
                <label class="field-label">{{entry_disable_add_similar_item}}</label>
                <select class="field-entry field-entry-medium js-sort-by-option" name="listaescolar_disable_similar_item">
                  {% for status_descricao in status_add_similar %}
                  <option value="{{ status_descricao.key }}" {{ status_descricao.selected }}>{{ status_descricao.value }}</option>
                  {% endfor %}
                </select>
              </div>
            </div>

            <div class="col-xs-12">
              <div class="content-box field-group">
                <label class="field-label">{{entry_disabel_substitute_item}}</label>
                <select class="field-entry field-entry-medium js-sort-by-option" name="listaescolar_disable_substitute_item">
                  {% for status_descricao in status_substitute_item %}
                  <option value="{{ status_descricao.key }}" {{ status_descricao.selected }}>{{ status_descricao.value }}</option>
                  {% endfor %}
                </select>
              </div>
            </div>

            <div class="col-xs-12">
              <div class="content-box field-group">
                <label class="field-label">{{entry_substitute_item_table_price}}</label>
                <span class="field-description">{{descr_substitute_item_table_price}}</span>
                <select class="field-entry field-entry-medium" name="listaescolar_substitute_item_table_price">
                  {% for status_descricao in status_substitute_item_table_price %}
                    <option value="{{ status_descricao.key }}" {{ status_descricao.selected }}>{{ status_descricao.value }}</option>
                  {% endfor %}
                </select>
              </div>
            </div>

            <div class="col-xs-12">
              <div class="content-box field-group">
                <label class="field-label">{{entry_cart_obs}}</label>
                <select class="field-entry field-entry-medium" name="listaescolar_cart_obs">
                  {% for status_cart_obs in status_cart_obs_list %}
                    <option value="{{ status_cart_obs.key }}" {{ status_cart_obs.selected }}>{{ status_cart_obs.value }}</option>
                  {% endfor %}
                </select>
              </div>
            </div>

            <div class="col-xs-12">
              <div class="content-box field-group">
                <label class="field-label">{{entry_cart_obs_title}}</label>
                <input class="field-entry field-entry-medium " name="listaescolar_cart_obs_title" value="{{ listaescolar_cart_obs_title }}">
              </div>
            </div>

            <div class="col-xs-12">
              <div class="content-box field-group">
                <label class="field-label">{{entry_cart_obs_is_required}}</label>
                <select class="field-entry field-entry-medium" name="listaescolar_cart_obs_is_required">
                  {% for status_cart_obs in status_cart_obs_is_required %}
                    <option value="{{ status_cart_obs.key }}" {{ status_cart_obs.selected }}>{{ status_cart_obs.value }}</option>
                  {% endfor %}
                </select>
              </div>
            </div>

            <div class="col-xs-12">
              <div class="content-box field-group">
                <label class="field-label">{{entry_pesquisa_similares}}</label>
                <div>
                <input type="checkbox" name="listaescolar_pesquisa_gruposubgrupo" value="1" {% if listaescolar_pesquisa_gruposubgrupo %}checked="checked"{% endif %}>{{entry_pesquisa_similares_grupo_subgrupo}}
                </div>
                <div>
                <input type="checkbox" name="listaescolar_pesquisa_tag" value="1" {% if listaescolar_pesquisa_tag %}checked="checked"{% endif %}>{{entry_pesquisa_similares_tag}}
                </div>
              </div>
            </div>

            <div class="col-xs-12">
              <div class="content-box field-group">
                <label class="field-label bottom-margin-small">{{entry_link_lista}}</label>
                <span class="js-copy-content">{{link_listaescolar}}</span>
                <span class="js-copy-action text-medium rel">
                  <i class="far fa-clone" aria-hidden="true" title="Copiar"></i>
                </span>
              </div>
            </div>

            <div class="col-xs-12">
              <div class="content-box field-group">
                <label class="field-label">{{entry_listaescolar_dominio}}</label>
                <select class="field-entry field-entry-medium js-sort-by-option" name="listaescolar_dominio">
                  {% for dominio in dominio_list %}
                    <option value="{{ dominio.value }}" {{ dominio.selected }}>{{ dominio.value }}</option>
                  {% endfor %}
                </select>
              </div>
            </div>
            <div class="col-xs-12">
              <div class="content-box background-info border-info padding-medium rounded-small">
                <div class="row no-space-xs">
                  <div class="col-xs-width-auto">
                    <div class="content-box right-padding-medium top-padding-x-small">
                      <i class="fas fa-info-circle text-medium text-info"></i>
                    </div>
                  </div>
                  <div class="col-xs">
                    <div class="content-box">
                      <span class="text-small" style="color:#000">{{text_info_url}}</span>
                    </div>
                  </div>
                </div>
              </div>
            </div>

          </div>
        </div>
      </div>
    </div>

    <div class="row hidden" data-tab="{{ tab_banner }}">
      <div class="col-xs-12">
        <div class="content-box">
          <div class="flex between-xs bottom-padding-large">
            <span class="text-x-large text-dark">{{ tab_banner }}</span>
            <button type="button" class="btn-default btn-medium btn-primary" id="add-banner">
              <span>{{ button_add_module }}</span>
            </button>
          </div>
        </div>
        <div id="js-banner-container">
          {% for key, module in listaescolar_module %}
            <div id="{{ key }}" class="background-white padding-large bottom-margin-medium shadow-small adm-focus-within js-banner">
              <div class="row x-small-space-xs">
                <div class="col-md">
                  <label class="field field-medium">
                    <span class="field-label inline">{{ entry_banner }} {% if error_warning == error_duplicate %} <b class="required">*</b>{% endif %}</span>
                    <select class="field-entry" name="listaescolar_module[{{ key }}][banner_id]">
                      {% for banner in banners %}
                        <option
                          value="{{ banner.banner_id }}"
                          {% if banner.banner_id == module.banner_id %}selected{% endif %}
                        >
                          {{ banner.name }}
                        </option>
                      {% endfor %}
                    </select>
                  </label>
                </div>
                <div class="col-md">
                  <label class="field field-medium">
                    <span class="field-label">{{ entry_size_space }}</span>
                    <select class="field-entry" name="listaescolar_module[{{ key }}][tamanho]">
                      {% for size in module.size %}
                        <option
                          value="{{ size.id }}"
                          {{ size.status }}
                        >
                          {{ size.name }}
                        </option>
                      {% endfor %}
                    </select>
                  </label>
                </div>
                <div class="col-md-width-auto">
                  <label class="field field-medium" style="width:74px;">
                    <span class="field-label">{{ entry_full_screen }}</span>
                    <select class="field-entry" name="listaescolar_module[{{ key }}][type]">
                      {% for type in module.type %}
                        <option
                          value="{{ type.id }}"
                          {{ type.status }}
                        >
                          {{ type.name }}
                        </option>
                      {% endfor %}
                    </select>
                  </label>
                </div>
                <div class="col-md">
                  <label class="field field-medium">
                    <span class="field-label required">{{ entry_dimension }} {% if error_warning == error_dimension %} <b class="required">*</b>{% endif %}</span>
                    <div class="field-entry-group">
                      <input
                        class="mask-number field-entry{% if error_dimension[key] is defined %} field-entry-error{% endif %}"
                        type="text"
                        maxlength="4"
                        name="listaescolar_module[{{ key }}][width]"
                        value="{{ module.width }}" size="3"
                      >
                      <input
                        class="mask-number field-entry{% if error_dimension[key] is defined %} field-entry-error{% endif %}"
                        type="text"
                        maxlength="4"
                        name="listaescolar_module[{{ key }}][height]"
                        value="{{ module.height }}" size="3"
                      >
                    </div>
                  </label>
                </div>
                <div class="col-md">
                  <label class="field field-medium">
                    <span class="field-label">{{ entry_school }} {% if error_warning == error_duplicate %} <b class="required">*</b>{% endif %}</span>
                    <input type="hidden" name="listaescolar_module[{{ key }}][layout_id]" value="{{ school_layout.layout_id }}">
                    <select class="field-entry" name="listaescolar_module[{{ key }}][school_id]">
                      {% for layout in escolas %}
                        <option
                          value="{{ layout.school_id }}"
                          {% if layout.school_id == module.school_id %}selected{% endif %}
                        >
                          {{ layout.descricao }}
                        </option>
                      {% endfor %}
                    </select>
                  </label>
                </div>
                <div class="col-md">
                  <label class="field field-medium">
                    <span class="field-label">{{ entry_position }}</span>
                    <select class="field-entry" name="listaescolar_module[{{ key }}][position]">
                      {% for position in module.position %}
                        <option
                          value="{{ position.id }}"
                          {{ position.status }}
                        >
                          {{ position.name }}
                        </option>
                      {% endfor %}
                    </select>
                  </label>
                </div>
                <div class="col-md-width-auto">
                  <label class="field field-medium" style="width:126px;">
                    <span class="field-label">{{ entry_status }}</span>
                    <select class="field-entry" name="listaescolar_module[{{ key }}][status]">
                      {% for status in module.status %}
                        <option
                          value="{{ status.id }}"
                          {{ status.status }}
                        >
                          {{ status.name }}
                        </option>
                      {% endfor %}
                    </select>
                  </label>
                </div>
                <div class="col-md-width-auto">
                  <label class="field field-medium" style="width:64px;">
                    <span class="field-label">{{ entry_sort_order }}</span>
                    <input class="mask-number field-entry" type="text" name="listaescolar_module[{{ key }}][sort_order]" maxlength="2" value="{{ module.sort_order }}" size="3">
                  </label>
                </div>
                <div class="col-xs-12 col-md-width-auto">
                  <div
                    class="padding-medium cursor-pointer top-margin-medium js-remove-banner"
                    data-tooltip="{{ button_remove }}"
                    data-banner-id="{{ key }}"
                  >
                    <i class="fas fa-trash text-gray"></i>
                  </div>
                </div>
              </div>
            </div>
          {% endfor %}
        </div>
      </div>

    </div>
  </div>
</form>
{{footer}}
