caseroserver / src / main / resources / templates / casero / casero-license.html
casero-license.html
Raw
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.thymeleaf.org"
      layout:decorate="~{base}">

<head>
    <meta charset="UTF-8">
    <title>Casero licencia</title>
</head>

<body layout:fragment="content">


<div class="container">


    <div id="submitRow"></div>
    <div th:if="${licenses.isEmpty()}">
        <h5 class="center-align">No hay licencias que mostrar</h5>
    </div>
    <table id="tablaLicenses" class="leftTop responsive-table highlight centered" style="margin-top: 80px">
        <thead class="header z-depth-1">
        <tr>
            <th>No.</th>
            <th>Fecha</th>
            <th>Usuario</th>
            <th>Nombre</th>
            <th>Apellidos</th>
            <th>Código de licencia</th>
            <th>Estado</th>
            <th>Correo</th>
            <th>Teléfono</th>
            <th>Acciones</th>
        </tr>
        </thead>
        <tbody class="z-depth-1">
        <div style="visibility: hidden" id="loading"  class="progress">
            <div class="indeterminate" style="width: 70%"></div>
        </div>
        <div th:if="${not #lists.isEmpty(licenses)}">
            <tr th:each="lic : ${licenses}">
                <td th:text="${lic.getId()}"></td>
                <td th:text="${lic.getCreatedDate()}"></td>
                <td th:text="${lic.getUser()}"></td>
                <td th:text="${lic.getName()}"></td>
                <td th:text="${lic.getLastName()}"></td>
                <td>
                    <button class="waves-effect tooltipped too btn btn-small btn-floating white modal-trigger "
                            th:id="${lic.getLicenseCode()}" onclick="loadCodeLicense(this)" data-target="modalDesc"
                            data-position="botton" data-tooltip="Ver código">
                        <i class="material-icons tiny black-text">description</i>
                    </button>
                </td>
                <td th:if="${lic.getStatus().equals('pendiente')}">
                    <i class="material-icons small blue-grey-text" data-position="botton" data-tooltip="Pendiente">access_time</i>
                </td>
                <td th:if="${lic.getStatus().equals('distribuida')}">
                    <i class="material-icons tooltipped small green-text" data-position="botton" data-tooltip="Distribuida">forward</i>
                </td>
                <td th:text="${lic.getEmail()}"></td>
                <td th:text="${lic.getPhoneNumber()}"></td>
                <td class="col">
                    <div class="row inline">
                        <button class="sendLicense waves-effect tooltipped btn btn-small btn-floating white"
                                th:id="'sendLicense'+${lic.id}" type="submit"
                                data-position="botton" data-tooltip="Enviar licencia">
                            <i class="material-icons tiny light-blue-text">send</i>
                        </button>

                        <button class="deleteLicense waves-effect tooltipped btn btn-small btn-floating white modal-trigger"
                                th:id="'delete'+${lic.id}" type="submit"  data-target="modalDeleteLic"
                                data-position="botton" data-tooltip="Eliminar licencia">
                            <i class="material-icons tiny red-text">delete</i>
                        </button>
                    </div>
                </td>
            </tr>
        </div>
        <div th:id="modalDesc" id="modalDesc" class="modal">
            <div class="modal-content">
                <div class="row inline col s12">
                    <div class="col s11">
                        <div class="input-field">
                            <i class="material-icons black-text prefix tiny">description</i>
                            <input type="text" class="validate" id="code">
                            <label for="code">Código de licencia</label>
                        </div>
                    </div>
                    <div class="col s1">
                        <button onclick="copyCode()" class="waves-effect tooltipped too btn btn-small btn-floating white"
                                data-position="botton" data-tooltip="Copiar contenido">
                            <i class="material-icons black-text">content_copy</i>
                        </button>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button class="modal-close waves-effect btn-small"><i class="material-icons">check</i>Aceptar</button>
            </div>
        </div>


        <div th:id="modalDeleteLic" id="modalDeleteLic" class="modal">
            <div class="modal-content">
                <h4>Eliminar solicitud</h4>
                <p>¿ Desea eliminar la licencia seleccionada ?</p>
            </div>
            <div class="modal-footer">
                <button onclick="deleteLic()" class="modal-close waves-effect btn-small"><i class="material-icons">check</i>Aceptar</button>
                <button class="modal-close waves-effect red waves-red btn-small"><i class="material-icons">cancel</i>Cancelar
                </button>
            </div>
        </div>

        </tbody>
    </table>


</div>



<script type="text/javascript" th:src="@{/js/casero/casero_licenses.js}" src="../static/js/casero/casero_licenses.js"></script>

</body>
</html>