{{ header }}
<div class="background-white bottom-margin-large" data-info='{ "modules": {{ modules|json_encode() }}, "languagesJS": {{ languageForJS|json_encode() }}, "layouts": {{ layouts|json_encode() }}, "error_limit": {{ error_limit|json_encode() }}, "error_grid_limit": {{ error_grid_limit|json_encode() }}, "error_sort_order": {{ error_sort_order|json_encode() }}, "positions": {{ positions|json_encode() }}, "special_actions": {{ special_actions|json_encode() }} }'>
  <div class="container-fluid">
    <div class="row no-space-xs middle-xs">
      <div class="col-xs-12 col-sm col-md">
        <div class="content-box vertical-padding-large">
          <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>
      <div class="col-xs-12 col-sm-width-auto col-md-width-auto">
        <div class="content-box vertical-padding-x-large flex flex-row middle-xs">
          <a href="{{ cancel }}" class="btn-default btn-medium btn-outline right-margin-small">
						<span>{{ button_cancel }}</span>
					</a>
					<button type="button" class="btn-default btn-medium btn-primary js-submit-main-form">
						<span>{{ button_save }}</span>
					</button>
        </div>
      </div>
      <div class="col-xs-12">
        <div class="flex js-tabs" id="tab-info"></div>
      </div>
      {% if error_warning %}
        <div class="col-xs-12">
          <div class="warning text-error">{{ error_warning }}</div>
        </div>
      {% endif %}
    </div>
  </div>
</div>

<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 between-xs middle-xs">
              <span class="text-x-large text-dark">{{ tab_general }}</span>
            </div>
          </div>
        </div>

        <div class="container-fluid">
          <div class="row">
            <div class="col-xs-12 col-md-8">
              <div class="background-white padding-large shadow-small">
                <label class="field field-medium">
                  <span class="field-label">{{ entry_message }}</span>
                  <textarea class="field-entry" name="pickup_message">{{ pickup_message }}</textarea>
                </label>
              </div>
            </div>
            <div class="col-xs-12 col-md-4">
              <div class="background-white padding-large shadow-small">
                <label class="field field-medium">
                  <span class="field-label">{{ entry_status }}</span>
                  <select class="field-entry" name="pickup_status">
                    {% for key, status in Type_Status.getEnumList() %}
                      <option value="{{ key }}" {{ ftr_geral.isSelected(key, pickup_status) }}>{{ status }}</option>
                    {% endfor %}
                  </select>
                </label>
                <label class="field field-medium">
                  <span class="field-label top-padding-large">{{ entry_geo_zone }}</span>
                  <select class="field-entry" name="pickup_geo_zone_id">
                    <option value="0">{{ text_all_zones }}</option>
                    {% for geo_zone in geo_zones %}
                      <option value="{{ geo_zone['geo_zone_id'] }}" {{ geo_zone.geo_zone_id == pickup_geo_zone_id ? 'selected' : '' }} >
                        {{ geo_zone['name'] }}
                      </option>
                    {% endfor %}
                  </select>
                </label>
                <label class="field field-medium">
                  <span class="field-label top-padding-large">{{ entry_sort_order }}</span>
                  <input class="field-entry mask-number2" type="text" name="pickup_sort_order" value="{{ pickup_sort_order }}" size="1">
                </label>
              </div>
            </div>
          </div>
        </div>
      </div>

      <div class="row hidden" data-tab="{{ tab_endereco }}">
        <div class="col-xs-12">
          <div class="content-box">
            <div class="flex between-xs middle-xs">
              <span class="text-x-large text-dark">{{ tab_endereco }}</span>
            </div>
          </div>
        </div>
        <div class="col-xs-12 col-md-6">
          <div class="content-box background-white shadow-small padding-large js-address">
                <label class="field field-medium top-margin-medium">
                  <span class="field-label">
                    {{ text_postcode }}
                    <span class="vertical-middle">
                      <img class="js-postcode-loading hidden" src="../assets/img/loading-black.svg" width="14" height="14"/>
                    </span>
                  </span>
                  <input class="field-entry {{ (error_postcode) ? 'border-error' : '' }} mask-cep js-postcode-search" type="text" name="postcode" value="{{ postcode[:5] }}-{{ postcode[5:] }}" placeholder="{{ text_postcode_placeholder }}" maxlength="96" required>
                  {{ (error_postcode) ? '<span class="text-error text-small text-left top-margin-x-small visible-block">' ~ error_postcode ~ '</span>' : '' }}
                </label>
                <a href="#" class="text-small visible-inline-block top-padding-small js-postcode-address">Não sei meu cep</a>
                <div class="js-postcode-content {{ (postcode_visible == false) ? ' hidden' : '' }}">
                  <div class="row small-space-xs top-margin-small">
                    <div class="col-xs-8">
                      <label class="field field-medium">
                        <span class="field-label">
                          <span class="required">*
                          </span>
                          {{ text_street }}
                        </span>
                        <input class="field-entry address_1 {{ (error_address_1) ? 'border-error' : '' }}" id="address_1" type="text" name="address_1"
                          value="{{ address_1 }}" placeholder="{{ text_street_placeholder }}" maxlength="70" required
                          {{ (postcode_readonly and error_address_1 == false) ? 'readonly' : '' }}>
                        <input type="hidden" class="tipo_logradouro" name="tipo_logradouro" value="{{ tipo_logradouro }}">
                        <input type="hidden" class="logradouro" name="logradouro" value="{{ logradouro }}">
                        <input type="hidden" class="city" name="city" value="{{ city }}">
                        {{ (error_address_1) ? '<span class="text-error text-small text-left top-margin-x-small visible-block">' ~ error_address_1 ~ '</span>' : '' }}
                      </label>
                    </div>
                    <div class="col-xs-4">
                      <label class="field field-medium">
                        <span class="field-label">
                          <span class="required">*</span>
                          {{ text_number }}
                        </span>
                        <input class="field-entry {{ (error_numero) ? 'border-error' : '' }} mask-int" id="numero" type="text" name="numero"
                          value="{{ numero }}" placeholder="{{ text_number_placeholder }}" maxlength="6" required>
                        {{ (error_numero) ? '<span class="text-error text-small text-left top-margin-x-small visible-block">' ~ error_numero ~ '</span>' : '' }}
                      </label>
                    </div>
                  </div>
                  <label class="field field-medium top-margin-medium">
                    <span class="field-label">
                      <span class="required">*</span>
                      {{ text_neighborhood }}
                    </span>
                    <input class="field-entry address_2 {{ (error_address_2) ? 'border-error' : '' }}" id="address_2" type="text" name="address_2"
                      value="{{ address_2 }}" placeholder="{{ text_neighborhood_placeholder }}" required
                      {{ (postcode_readonly and error_address_2 == false) ? 'readonly' : '' }}>
                    {{ (error_address_2) ? '<span class="text-error text-small text-left top-margin-x-small visible-block">' ~ error_address_2 ~ '</span>' : '' }}
                  </label>
                  <label class="field field-medium top-margin-medium">
                    <span class="field-label">{{ text_complement }}</span>
                    <input class="field-entry {{ (error_complemento) ? 'border-error' : '' }}" id="complemento" type="text" name="complemento" value="{{ complemento }}" placeholder="{{ text_complement_placeholder }}" maxlength="60">
                    {{ (error_complemento) ? '<span class="text-error text-small text-left top-margin-x-small visible-block">' ~ error_complemento ~ '</span>' : '' }}
                  </label>
                  <div class="row small-space-xs top-margin-medium">
                    <div class="col-xs-6">
                      <label class="field field-medium">
                        <span class="field-label">
                          <span class="required">*</span>
                          {{ text_zone }}
                        </span>

                        <select data-codigo-municipio="{{ codigo_municipio }}" class="js-city-search field-entry zone_id {{ (error_zone) ? 'border-error' : '' }}" id="zone_id" name="zone_id" required {{ (postcode_readonly and error_zone == false) ? 'readonly' : '' }} >
                          {% for state in states %}
                            <option value="{{ state.zone_id }}" {{ (zone_id == state.zone_id) ? 'selected="selected"' : '' }}>{{ state.name }}
                            </option>
                          {% endfor %}
                        </select>
                        <input type="hidden" name="country_id" value="{{ country_id }}">
                        {{ (error_zone) ? '<span class="text-error text-small text-left top-margin-x-small visible-block">' ~ error_zone ~ '</span>' : '' }}
                      </label>
                    </div>
                    <div class="col-xs-6">
                      <label class="field field-medium">
                        <span class="field-label">
                          <span class="required">*</span>
                          {{ text_city }}
                        </span>

                        <select class="field-entry codigo_municipio codigo-municipio {{ (error_city) ? 'border-error' : '' }}" id="codigo_municipio" name="codigo_municipio"
                          required {{ (postcode_readonly and error_city == false) ? 'readonly' : '' }}></select>
                        {{ (error_city) ? '<span class="text-error text-small text-left top-margin-x-small visible-block">' ~ error_city ~ '</span>' : '' }}
                      </label>
                    </div>
                  </div>
                </div>
          </div>
        </div>
      </div>

    </div>
</form>

{{ footer }}