{{ 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 href="{{ cancel }}" class="btn-default btn-medium btn-outline right-margin-small">
              <span>Cancelar</span></a>
            <button class="btn-default btn-medium btn-primary js-submit-main-form">
              <span>Salvar</span>
            </button>
          </div>
          {% if error_warning %}
          <div class="warning full-width top-margin-medium">{{ error_warning }}</div>
          {% endif %}
          {% if success %}
          <div class="success full-width top-margin-medium">{{ success }}</div>
          {% endif %}
        </div>
      </div>
    </div>
  </div>
</header>
<div class="container-fluid">
  <form action="{{ action }}" method="post" class="row js-main-form">
    <div class="col-xs-12 col-md-8">
      <div class="content-box">
        <div class="content-box background-white padding-large shadow-small">
          <label class="field field-medium bottom-margin-medium">
            <span class="field-label">
              <span class="required">*</span> {{ entry_username }}
            </span>
            <input class="field-entry" type="text" name="username" value="{{ username }}" size="50"
              maxlength="240" />
            {% if error_username %}
            <span class="error">{{ error_username }}</span>
            {% endif %}
          </label>
          <label class="field field-medium bottom-margin-medium">
            <span class="field-label">
              <span class="required">*</span> {{ entry_firstname }}
            </span>
            <input class="field-entry" type="text" name="firstname" value="{{ firstname }}" />
            {% if error_firstname %}
            <span class="error">{{ error_firstname }}</span>
            {% endif %}
          </label>
          <label class="field field-medium bottom-margin-medium">
            <span class="field-label">
              <span class="required">*</span> {{ entry_lastname }}
            </span>
            <input class="field-entry" type="text" name="lastname" value="{{ lastname }}" />
            {% if error_lastname %}
            <span class="error">{{ error_lastname }}</span>
            {% endif %}
          </label>
          <label class="field field-medium bottom-margin-medium">
            <span class="field-label">{{ entry_email }}</span>
            <input class="field-entry" type="text" name="email" value="{{ email }}" />
          </label>
          <label class="field field-medium bottom-margin-medium">
            <span class="field-label">{{ entry_user_group }}</span>
              <select name="user_group_id" class="field-entry">
                {% for user_group in user_groups %}
                  <option value="{{user_group.user_group_id}}" {% if user_group.user_group_id == user_group_id %}selected{% endif %}>{{ user_group.name }}</option>
                {% endfor %}
              </select>
          </label>
          <label class="field field-medium bottom-margin-medium">
            <span class="field-label">{{ entry_password }}</span>
            <input class="field-entry" type="password" name="password" value="{{ password }}" />
            {% if error_password %}
              <span class="error">{{ error_password }}</span>
            {% endif %}
          </label>
          <label class="field field-medium bottom-margin-medium">
            <span class="field-label">{{ entry_confirm }}</span>
            <input class="field-entry" type="password" name="confirm" value="{{ confirm }}" />
            {% if error_confirm %}
            <span class="error">{{ error_confirm }}</span>
            {% endif %}
          </label>
        </div>
      </div>
    </div>
    <div class="col-xs-12 col-md-4">
      <div class="content-box background-white padding-large shadow-small">
        <label class="field field-medium bottom-margin-medium">
          <span class="field-label">{{ entry_status }}</span>
          <select name="status" class="field-entry">
            <option value="1" {{ status ? 'selected' : '' }}>{{ text_enabled }}</option>
            <option value="0" {{ not status ? 'selected' : '' }}>{{ text_disabled }}</option>
            </option>
          </select>
        </label>
      </div>
    </div>
  </form>
</div>
{{ footer }}