48 lines
2 KiB
HTML
48 lines
2 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:h="http://xmlns.jcp.org/jsf/html"
|
|
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
|
|
xmlns:f="http://xmlns.jcp.org/jsf/core">
|
|
|
|
<ui:composition template="/templates/template_page.xhtml">
|
|
<ui:param name="pageTitle" value="Sign In"/>
|
|
<ui:define name="panel-top">
|
|
<section>
|
|
<ui:fragment rendered="#{loggedIn.id == null}">
|
|
<h1>Logga in</h1>
|
|
<p>Skriv ditt användarnamn</p>
|
|
</ui:fragment>
|
|
|
|
<ui:fragment rendered="#{loggedIn.id != null}">
|
|
<h:form>
|
|
<h1>Välkommen, #{userBean.users.getUser(loggedIn.id).name}!</h1>
|
|
<p>Du är redan inloggad.
|
|
Vill du<h:commandLink action="#{signIn.logout}">logga ut</h:commandLink>?</p>
|
|
</h:form>
|
|
</ui:fragment>
|
|
</section>
|
|
</ui:define>
|
|
|
|
<ui:define name="panel-main">
|
|
<ui:fragment rendered="#{loggedIn.id == null}">
|
|
<section>
|
|
<h:form>
|
|
<h:panelGrid columns="2" styleClass="form-grid" columnClasses="form-column-label,form-column-input">
|
|
<h:outputLabel for="username">Användarnamn</h:outputLabel>
|
|
<h:inputText id="username" value="#{signIn.username}"/>
|
|
|
|
<h:outputLabel for="password">Password</h:outputLabel>
|
|
<h:inputSecret id="password" value="#{signIn.password}"/> <!--anroppar user bean-->
|
|
|
|
<h:outputText value=""/>
|
|
<h:commandButton value="Submit" action="#{signIn.submit}"/> <!--anroppar usermanager-->
|
|
</h:panelGrid>
|
|
</h:form>
|
|
</section>
|
|
</ui:fragment>
|
|
</ui:define>
|
|
|
|
</ui:composition>
|
|
</html>
|