<div th:fragment="alta" class="flex-shrink-0">
    <h1>Alta de empleados de la empresa</h1>
    <div class="container">

        <div class="row">
            <div class="col-md-offset-2 col-md-8">
                <form method="post" action="#" th:action="${empleadoForm.id != 0} ? @{/empleado/edit/submit} : @{/empleado/new/submit}"
                      th:object="${empleadoForm}">
                    <h1 th:text="${empleadoForm.id != 0} ? 'Editar empleado' : 'Nuevo empleado'">Nuevo empleado</h1>
                    <div class="form-group"
                         th:classappend="${#fields.hasErrors('id')} ? 'has-error'">
                        <label for="id">ID</label> <input type="text"
                                                          class="form-control" id="id" placeholder="1"
                                                          th:field="*{id}"
                                                          th:attrappend="readonly=${empleadoForm.id != 0} ? 'readonly' : null">
                        <span th:if="${#fields.hasErrors('id')}" th:errors="*{id}"
                              class="help-block" id="id-error">Errores</span>
                    </div>

                    <div class="form-group">
                        <label for="nombre">Nombre</label> <input type="text"
                                                                  class="form-control" id="nombre" placeholder="Nombre"
                                                                  th:field="*{nombre}" />
                    </div>
                    <div class="form-group">
                        <label for="email">Email</label>
                        <input type="email" class="form-control" id="email"
                               placeholder="emple@openwebinars.net" th:field="*{email}" />
                    </div>
                    <div class="form-group">
                        <label for="telefono">Teléfono</label> <input type="tel"
                                                                      class="form-control" id="telefono" placeholder="954000000" th:field="*{telefono}" />

                    </div>
                    <button type="submit" class="btn btn-default">Enviar</button>
                </form>
            </div>
        </div>
    </div>
    <!-- /.container -->

</div>