Mejoras en el login, y mock para pantallas de componente profile.
This commit is contained in:
@@ -12,18 +12,17 @@
|
||||
</h:head>
|
||||
<h:outputScript>
|
||||
function handleLoginRequest(xhr, status, args) {
|
||||
$('#loginSpin').slideUp();
|
||||
|
||||
if(args.validationFailed || !args.loggedIn) {
|
||||
PF('dlgLogin').jq.effect("shake", {times:5}, 100);
|
||||
//PF('Login').attr("disabled", false);
|
||||
}
|
||||
else {
|
||||
PF('dlgLogin').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function showSpinner() {
|
||||
$('#loginSpin').slideDown();
|
||||
function startLogin() {
|
||||
//PF('Login').attr("disabled", true);
|
||||
}
|
||||
</h:outputScript>
|
||||
<h:body>
|
||||
@@ -34,12 +33,20 @@
|
||||
</div>
|
||||
<hr />
|
||||
<div id="menuDiv">
|
||||
<p:growl id="messages" sticky="true" showDetail="true" life="3000" />
|
||||
|
||||
<h:form id="frmLogin">
|
||||
<i id="loginSpin" class="pi pi-spin pi-spinner hide" style="font-size: 3em"></i>
|
||||
<p:growl id="messages" sticky="false" showDetail="true" life="3000" />
|
||||
<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>
|
||||
|
||||
<p:dialog header="Acceder al sistema" widgetVar="dlgLogin" resizable="false">
|
||||
<f:facet name="complete">
|
||||
<h:outputText value="" />
|
||||
</f:facet>
|
||||
</p:ajaxStatus>
|
||||
|
||||
<h:form id="frmLogin">
|
||||
|
||||
<p:dialog header="Acceder al sistema" widgetVar="dlgLogin" resizable="false" modal="true" closeOnEscape="true">
|
||||
<h:panelGrid columns="2" cellpadding="5">
|
||||
<h:outputLabel for="username" value="Username:" />
|
||||
<p:inputText id="username" value="#{loginView.username}" />
|
||||
@@ -48,9 +55,7 @@
|
||||
<p:password id="password" value="#{loginView.password}" />
|
||||
|
||||
<f:facet name="footer">
|
||||
<p:commandButton value="Login" update="messages, frmMenu" icon="pi pi-user" action="#{loginView.login}" onstart="showSpinner()"
|
||||
oncomplete="handleLoginRequest(xhr, status, args)">
|
||||
</p:commandButton>
|
||||
<p:commandButton value="Login" update="frmMenu, messages" icon="pi pi-sign-in" action="#{loginView.login}" onstart="startLogin()" oncomplete="handleLoginRequest(xhr, status, args)"/>
|
||||
<p:commandButton value="Cancel" icon="pi pi-ban" onclick="PF('dlgLogin').hide();" />
|
||||
</f:facet>
|
||||
</h:panelGrid>
|
||||
|
||||
Reference in New Issue
Block a user