89 lines
3.5 KiB
HTML
89 lines
3.5 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
|
|
xmlns:p="http://primefaces.org/ui">
|
|
|
|
<h:head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
<title>MyHealth Online Services</title>
|
|
<h:outputStylesheet name="primeicons/primeicons.css" library="primefaces" />
|
|
<h:outputStylesheet library="css" name="estilos.css" />
|
|
</h:head>
|
|
<h:outputScript>
|
|
function handleLoginRequest(xhr, status, args) {
|
|
if(args.validationFailed || !args.loggedIn) {
|
|
PF('dlgLogin').jq.effect("shake", {times:5}, 100);
|
|
PF('btnLogin').enable();
|
|
}
|
|
else {
|
|
PF('btnLogin').enable();
|
|
PF('dlgLogin').hide();
|
|
}
|
|
}
|
|
|
|
function startLogin() {
|
|
PF('btnLogin').disable();
|
|
}
|
|
</h:outputScript>
|
|
<h:body>
|
|
<p:growl id="messages" globalOnly="true" sticky="false" showDetail="true" life="15000" />
|
|
<div id="layout">
|
|
<div id="top" class="top">
|
|
<h:graphicImage library="images" name="logo-small.png" />
|
|
</div>
|
|
<hr />
|
|
<div id="menuDiv">
|
|
<p:ajaxStatus style="width:32px; height:32px; position:fixed; right:32px; bottom:32px">
|
|
<f:facet name="start">
|
|
<i id="loginSpin" class="pi pi-spin pi-spinner" style="font-size: 3em"></i>
|
|
</f:facet>
|
|
|
|
<f:facet name="error">Se ha producido un error!</f:facet>
|
|
</p:ajaxStatus>
|
|
|
|
<h:form id="frmLogin">
|
|
<p:dialog header="Acceder al sistema" width="350px" widgetVar="dlgLogin" resizable="false" modal="true" closeOnEscape="true">
|
|
<div class="ui-g ui-fluid">
|
|
<div class="ui-g-12">
|
|
<h:outputLabel for="username" value="Usuario:" />
|
|
<p:inputText id="username" value="#{loginView.username}" placeholder="Escriba su código CIP o NP" />
|
|
</div>
|
|
<div class="ui-g-12">
|
|
|
|
<h:outputLabel for="password" value="Contraseña:" />
|
|
<p:password id="password" value="#{loginView.password}" placeholder="Contraseña" />
|
|
</div>
|
|
<div class="ui-g-6">
|
|
<p:commandButton widgetVar="btnLogin" value="Login" update="messages" icon="pi pi-sign-in" action="#{loginView.login}" onstart="startLogin()"
|
|
oncomplete="handleLoginRequest(xhr, status, args)" />
|
|
</div>
|
|
<div class="ui-g-6">
|
|
<p:commandButton value="Cancel" icon="pi pi-ban" onclick="PF('dlgLogin').hide();" />
|
|
</div>
|
|
</div>
|
|
</p:dialog>
|
|
</h:form>
|
|
<h:form id="frmMenu">
|
|
<p:menubar model="#{menuView.model}">
|
|
<f:facet name="options">
|
|
<ui:fragment rendered="#{home.logedIn}">
|
|
<h:outputText value="logeado como #{home.userName} (#{home.userType}) " />
|
|
<p:commandButton value="Logout" icon="pi pi-sign-out" action="#{loginView.logout}" />
|
|
</ui:fragment>
|
|
<ui:fragment rendered="#{not home.logedIn}">
|
|
<h:outputText value="hola, invitado " />
|
|
<p:commandButton value="login" icon="pi pi-sign-in" onclick="PF('dlgLogin').show();" title="login" />
|
|
<p:button value="Registrarse" icon="pi pi-user-plus" outcome="/profile/RegisterUser" />
|
|
</ui:fragment>
|
|
</f:facet>
|
|
</p:menubar>
|
|
</h:form>
|
|
</div>
|
|
<div id="content">
|
|
<ui:insert name="content">Content</ui:insert>
|
|
</div>
|
|
</div>
|
|
</h:body>
|
|
</html>
|