{{ 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 class="text-x-small text-gray text-decoration-none" href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a>
              {% endfor %}
            </div>
          </div>
          <div class="flex flex-row middle-xs">
            <a class="btn-default btn-medium btn-outline right-margin-small" href="{{ cancel }}">
              <span>{{ button_cancel }}</span>
            </a>
            <button class="btn-default btn-primary btn-medium js-submit-main-form">
              <span>{{ button_save }}</span>
            </button>
          </div>
        </div>
        {% if error_warning %}
          <div class="warning">{{ error_warning }}</div>
        {% endif %}
      </div>
    </div>
  </div>
</header>
<div class="container-fluid">
  <div class="row">
    <div class="col-xs-12 col-md-8">
      <div class="content-box visible-block text-decoration-none background-white shadow-small padding-large">
        {% for language in languages %}
          <form action="{{ action }}" method="post" class="js-main-form">
            <div class="row">
              <div class="col-xs-12">
                <label class="field field-medium">
                  <span class="field-label required">{{ entry_name }}</span>
                  <input
                    class="field-entry"
                    type="text"
                    name="order_status[{{ language.language_id }}][name]"
                    value="{{ order_status[language.language_id] is defined ? order_status[language.language_id]['name'] : '' }}"
                  />
                  {% if error_name[language.language_id] is defined %}
                    <span class="text-error text-x-small">{{ error_name[language.language_id] }}</span>
                  {% endif %}
                </label>
              </div>
            </div>
            <div class="row">
              <div class="col-xs-12">
                <label class="field field-medium">
                  <span class="field-label">{{ entry_order_status }}</span>
                  <select class="field-entry order-status-type" name="order_status[{{ language.language_id }}][type]">
                    {% for status in status_order %}
                      <option value="{{ status.key }}" {{ status.selected }}>{{ status.value }}</option>
                    {% endfor %}
                  </select>
                </label>
              </div>
            </div>
            <div class="row">
              <div class="col-xs-12">
                <label class="field field-medium">
                  <span class="field-label">{{ entry_nofity }}</span>
                  <select class="field-entry" name="order_status[{{ language.language_id }}][client_notify]">
                    {% for status_list in status_lists %}
                      <option value="{{ status_list.value }}" {{ status_list.choice }}>{{ status_list.description }}</option>
                    {% endfor %}
                  </select>
                </label>
              </div>
            </div>
            <div class="row order-cancel">
              <div class="col-xs-12">
                <label class="field field-medium">
                  <span class="field-label">{{ entry_order_status_server }}</span>
                  <select class="field-entry" name="order_status[{{ language.language_id }}][order_futuraserver_status]">
                    <option value="null">{{ entry_status_default }}</option>
                    {% for status_sim_nao in status_sim_nao_list %}
                      <option value="{{ status_sim_nao.value }}" {{ status_sim_nao.choice }}>{{ status_sim_nao.description }}</option>
                    {% endfor %}
                  </select>
                </label>
              </div>
            </div>

            <div class="row">
              <div class="col-xs-12">
                <label class="field field-medium">
                  <span class="field-label">{{ entry_tracking }}</span>
                  <select class="field-entry" name="order_status[{{ language.language_id }}][tracking]">
                    {% for status_tracking in status_trackings %}
                      <option value="{{ status_tracking.value }}" {{ status_tracking.choice }}>{{ status_tracking.description }}</option>
                    {% endfor %}
                  </select>
                </label>
              </div>
            </div>

          </form>
        {% endfor %}
      </div>
    </div>
  </div>
</div>
<script>
	$(document).ready(function(){
		if ($(".order-status-type").val() != {{ Type_OrderStatus.Tp_Negativa }}){
			$(".order-cancel").hide();
		}
		$(".order-status-type").change(function(){
			if ($(this).val() != {{ Type_OrderStatus.Tp_Negativa }}){
				$(".order-cancel").hide();
			} else {
				$(".order-cancel").show();
			}
		});
  });
</script>
{{ footer }}
