{{ header }}
<div class="background-white bottom-margin-large">
  <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-dark text-x-large">{{ 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-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-task-save">
						<span>{{ button_save }}</span>
					</button>
        </div>
      </div>
      {% if error_warning %}
        <div class="warning full-width">{{ error_warning }}</div>
      {% endif %}
      <div class="col-xs-12">
        <div class="flex js-tabs" id="tab-info"></div>
      </div>
    </div>
  </div>
</div>
<div class="container-fluid">
  <div id="tabs_container" class="container-fluid js-table" data-tabs-id="tab-info">

    {% for keyTasks, task in tasks %}
      <div class="row no-space-xs hidden js-error-control" data-tab="{{ Type_TaskTypeGroup.getNickFromValue(task.group) }}">
        <div class="col-xs-12">
          <div class="content-box bottom-padding-large">
            <span class="text-x-large text-dark">{{ Type_TaskTypeGroup.getNickFromValue(task.group) }}</span>
          </div>
            {% for key, task_info in task.task %}
              <div class="content-box visible-block background-white shadow-small bottom-margin-small {% if task_info.warning %}border-error{% endif %}">
                <div class="row middle-xs no-space-xs padding-medium">
                  <div class="col-xs-12 col-sm-7 col-md">
                    <div class="content-box row middle-xs x-small-space-xs nowrap-xs js-identify-id" data-task-id="{{ task_info.task_id }}" data-task-type="{{ task_info.type }}">
                      <span class="text-small text-dark col-xs">{{ task_info.description }}</span>
                    </div>
                  </div>
                  <div class="col-xs-6 col-sm col-md-2">
                    <div class="content-box flex end-xs">
                      {% if task_info.status.module and task_info.status.option is defined %}
                        <select name="config_task[{{ task_info.task_id }}]['status']" class="field-entry field-entry-medium js-identify-status">
                          {% for key, status in Type_Status.getEnumList() %}
                            <option value="{{ key }}" {{ ftr_geral.isSelected(key, task_info.status.option, Type_Status.Tp_Desabilitado) }} >
                              {{ status }}
                            </option>
                          {% endfor %}
                        </select>
                      {% elseif task_info.status.module %}
                        <span class="text-x-small horizontal-padding-small vertical-padding-x-small rounded-large visible-inline-block background-success text-success js-identify-status" data-task-status="1">Habilitado</span>
                      {% else %}
                        <span class="text-x-small horizontal-padding-small vertical-padding-x-small rounded-large visible-inline-block background-error text-error js-identify-status" data-task-status="0">Desabilitado</span>
                      {% endif %}
                    </div>
                  </div>
                  <div class="col-xs-6 col-sm-2 col-md-2">
                    <div class="content-box horizontal-padding-small">
                      {% if task_info.date_last_acting %}
                        <span class="text-small text-gray visible-block">Última Execução</span>
                        <span class="text-small text-dark">{{ task_info.date_last_acting }}</span>
                      {% endif %}
                    </div>
                  </div>
                  <div class="col-xs-12 col-sm col-md-2">
                    <div class="content-box">
                      {% if task_info.predefined_execution == Type_PreConfigTask.Tp_PreConfigTask_Manual %}
                      <select name="config_task[{{ task_info.task_id }}]['time_execution']" data-task-control-id="{{ task_info.task_id }}" class="field-entry field-entry-medium js-identify-time">
                        {% for key, type_task_config in Type_TaskConfigTime.getEnumList() %}
                          {% if key >= task_info.time_default %}
                          <option value="{{ key }}" {{ ftr_geral.isSelected(key, task_info.time_execution, Type_TaskConfigTime.Tp_30) }} >
                            Executar de {{ type_task_config }}
                          </option>
                          {% endif %}
                        {% endfor %}
                      </select>
                      {% else %}
                        <div class="content-box">
                          {% if task_info.predefined_execution %}
                            <span class="text-small text-dark">Executar às: {{ task_info.predefined_execution }}h </span>
                          {% endif %}
                        </div>
                      {% endif %}

                    </div>
                  </div>
                </div>
                {% if task_info.warning %}
                <div class="background-error vertical-padding-small horizontal-padding-medium top-border-error">
                  <span class="text-small text-error col-xs">{{ task_info.warning }}</span>
                </div>
                {% endif %}
              </div>
            {% endfor %}
        </div>
      </div>
    {% endfor %}

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