version number visible
This commit is contained in:
		| @@ -1,5 +1,8 @@ | ||||
| package de.jottyfan.timetrack.modules; | ||||
|  | ||||
| import java.io.InputStream; | ||||
| import java.util.Properties; | ||||
|  | ||||
| import javax.enterprise.context.RequestScoped; | ||||
| import javax.faces.application.FacesMessage; | ||||
| import javax.faces.context.FacesContext; | ||||
| @@ -59,6 +62,25 @@ public class SessionControl { | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * get the version from the mainfest file | ||||
| 	 *  | ||||
| 	 * @return the version | ||||
| 	 */ | ||||
| 	public String getVersion() { | ||||
| 		FacesContext facesContext = FacesContext.getCurrentInstance(); | ||||
| 		try (InputStream is = facesContext.getExternalContext().getResourceAsStream("META-INF/MANIFEST.MF")){ | ||||
| 			// from servletcontext | ||||
| 			Properties attributes = new Properties(); | ||||
| 			attributes.load(is); | ||||
| 			return attributes.getProperty("Implementation-Version", "no Implementation-Version attribute found in MANIFEST"); | ||||
| 		} catch (Exception e) { | ||||
| 			FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, "error on loading the version from the Manifest file", e.getMessage()); | ||||
| 			FacesContext.getCurrentInstance().addMessage(null, msg); | ||||
| 			return "?"; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * @return the secretNew1 | ||||
| 	 */ | ||||
| @@ -67,8 +89,7 @@ public class SessionControl { | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * @param secretNew1 | ||||
| 	 *          the secretNew1 to set | ||||
| 	 * @param secretNew1 the secretNew1 to set | ||||
| 	 */ | ||||
| 	public void setSecretNew1(String secretNew1) { | ||||
| 		this.secretNew1 = secretNew1; | ||||
| @@ -82,8 +103,7 @@ public class SessionControl { | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * @param secretNew2 | ||||
| 	 *          the secretNew2 to set | ||||
| 	 * @param secretNew2 the secretNew2 to set | ||||
| 	 */ | ||||
| 	public void setSecretNew2(String secretNew2) { | ||||
| 		this.secretNew2 = secretNew2; | ||||
|   | ||||
| @@ -1,73 +1,72 @@ | ||||
| <!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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" | ||||
|   xmlns:my="http://xmlns.jcp.org/jsf/composite/my" xmlns:b="http://bootsfaces.net/ui"> | ||||
| <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:my="http://xmlns.jcp.org/jsf/composite/my" xmlns:b="http://bootsfaces.net/ui"> | ||||
| <h:head> | ||||
| </h:head> | ||||
| <h:body> | ||||
|   <ui:composition template="/pages/template.xhtml"> | ||||
|     <ui:define name="top"> | ||||
|       <b:messages /> | ||||
|     </ui:define> | ||||
|     <ui:define name="main"> | ||||
|       <b:panel title="Einstellungen" collapsed="true" rendered="#{sessionBean.hasLogin}"> | ||||
|         <b:accordion expandedPanels="layout"> | ||||
|           <b:panel id="layout" title="Layout"> | ||||
|             <b:form> | ||||
|               <b:selectOneMenu value="#{themeBean.currentTheme}"> | ||||
|                 <f:selectItems value="#{themeBean.validThemes}" var="t" itemValue="#{t}" itemLabel="#{t}" /> | ||||
|               </b:selectOneMenu> | ||||
|               <b:commandButton action="#{doneControl.toStart}" value="ändern" iconAwesome="pencil" look="warning" /> | ||||
|             </b:form> | ||||
|           </b:panel> | ||||
|           <b:panel id="password" title="Passwort"> | ||||
|             <b:form> | ||||
|               <b:inputSecret value="#{sessionControl.secretNew1}" required="true" requiredMessage="Das Feld Passwort muss ausgefüllt werden."> | ||||
|                 <f:facet name="prepend"> | ||||
|                   <h:outputText value="Passwort" /> | ||||
|                 </f:facet> | ||||
|               </b:inputSecret> | ||||
|               <b:inputSecret value="#{sessionControl.secretNew2}" required="true" requiredMessage="Das Feld Passwort nochmal muss ausgefüllt werden."> | ||||
|                 <f:facet name="prepend"> | ||||
|                   <h:outputText value="Passwort nochmal" /> | ||||
|                 </f:facet> | ||||
|               </b:inputSecret> | ||||
|               <b:commandButton action="#{sessionControl.doChangePassword}" value="übernehmen" look="warning" /> | ||||
|             </b:form> | ||||
|           </b:panel> | ||||
|         </b:accordion> | ||||
|       </b:panel> | ||||
|       <b:panel title="Login" rendered="#{sessionBean.hasNoLogin}" styleClass="loginpanel"> | ||||
|         <b:form> | ||||
|           <b:selectOneMenu value="#{sessionBean.username}"> | ||||
|             <f:facet name="prepend"> | ||||
|               <h:outputText value="Username" /> | ||||
|             </f:facet> | ||||
|             <f:selectItem itemValue="henkej" itemLabel="Jörg Henke" /> | ||||
|             <f:selectItem itemValue="piontekm" itemLabel="Michael Piontek" /> | ||||
|           </b:selectOneMenu> | ||||
|           <b:inputSecret value="#{sessionBean.secret}"> | ||||
|             <f:facet name="prepend"> | ||||
|               <h:outputText value="Passwort" /> | ||||
|             </f:facet> | ||||
|           </b:inputSecret> | ||||
|           <b:commandButton action="#{sessionControl.doLogin}" value="Login" look="primary" /> | ||||
|         </b:form> | ||||
|       </b:panel> | ||||
|     </ui:define> | ||||
|     <ui:define name="navigation"> | ||||
|       <b:form rendered="#{sessionBean.hasLogin}"> | ||||
|         <b:buttonGroup> | ||||
|           <b:commandButton action="#{noteControl.toList}" value="#{noteControl.amount} Notizen verwalten" look="primary" iconAwesome="comments-o" | ||||
|             rendered="#{sessionBean.hasPrivilege('write_note')}" /> | ||||
|           <b:commandButton action="#{contactControl.toList}" value="#{contactControl.amount} Kontakte verwalten" look="primary" iconAwesome="group" | ||||
|             rendered="#{sessionBean.hasPrivilege('write_contact')}" /> | ||||
|           <b:commandButton action="#{doneControl.toList}" value="Arbeitszeit verwalten" look="primary" iconAwesome="clock-o" rendered="#{sessionBean.hasPrivilege('write_done')}" /> | ||||
|           <b:commandButton action="#{doneControl.toRead}" value="Arbeitszeiten anzeigen" look="primary" iconAwesome="clock-o" rendered="#{sessionBean.hasPrivilege('read_done')}" /> | ||||
|           <b:commandButton action="#{sessionControl.doLogout}" value="abmelden" look="danger" iconAwesome="sign-out" /> | ||||
|         </b:buttonGroup> | ||||
|       </b:form> | ||||
|     </ui:define> | ||||
|   </ui:composition> | ||||
| 		<ui:composition template="/pages/template.xhtml"> | ||||
| 				<ui:define name="top"> | ||||
| 						<b:messages /> | ||||
| 				</ui:define> | ||||
| 				<ui:define name="main"> | ||||
| 						<b:panel title="Einstellungen" collapsed="true" rendered="#{sessionBean.hasLogin}"> | ||||
| 								<b:accordion expandedPanels="layout"> | ||||
| 										<b:panel id="layout" title="Layout"> | ||||
| 												<b:form> | ||||
| 														<b:selectOneMenu value="#{themeBean.currentTheme}"> | ||||
| 																<f:selectItems value="#{themeBean.validThemes}" var="t" itemValue="#{t}" itemLabel="#{t}" /> | ||||
| 														</b:selectOneMenu> | ||||
| 														<b:commandButton action="#{doneControl.toStart}" value="ändern" iconAwesome="pencil" look="warning" /> | ||||
| 												</b:form> | ||||
| 										</b:panel> | ||||
| 										<b:panel id="password" title="Passwort"> | ||||
| 												<b:form> | ||||
| 														<b:inputSecret value="#{sessionControl.secretNew1}" required="true" requiredMessage="Das Feld Passwort muss ausgefüllt werden."> | ||||
| 																<f:facet name="prepend"> | ||||
| 																		<h:outputText value="Passwort" /> | ||||
| 																</f:facet> | ||||
| 														</b:inputSecret> | ||||
| 														<b:inputSecret value="#{sessionControl.secretNew2}" required="true" requiredMessage="Das Feld Passwort nochmal muss ausgefüllt werden."> | ||||
| 																<f:facet name="prepend"> | ||||
| 																		<h:outputText value="Passwort nochmal" /> | ||||
| 																</f:facet> | ||||
| 														</b:inputSecret> | ||||
| 														<b:commandButton action="#{sessionControl.doChangePassword}" value="übernehmen" look="warning" /> | ||||
| 												</b:form> | ||||
| 										</b:panel> | ||||
| 								</b:accordion> | ||||
| 						</b:panel> | ||||
| 						<b:panel title="Anmeldung" collapsible="false" styleClass="loginpanel" rendered="#{sessionBean.hasNoLogin}"> | ||||
| 								<b:form> | ||||
| 										<b:selectOneMenu value="#{sessionBean.username}"> | ||||
| 												<f:facet name="prepend"> | ||||
| 														<h:outputText value="Benutzer" /> | ||||
| 												</f:facet> | ||||
| 												<f:selectItem itemValue="henkej" itemLabel="Jörg Henke" /> | ||||
| 										</b:selectOneMenu> | ||||
| 										<b:inputSecret value="#{sessionBean.secret}"> | ||||
| 												<f:facet name="prepend"> | ||||
| 														<h:outputText value="Passwort" /> | ||||
| 												</f:facet> | ||||
| 										</b:inputSecret> | ||||
| 										<h:panelGrid columns="2" columnClasses="left,right" style="width: 100%"> | ||||
| 												<h:outputText value="Version: #{sessionControl.version}" styleClass="version" /> | ||||
| 												<b:commandButton action="#{sessionControl.doLogin}" value="Anmelden" look="primary" style="width: 100%" /> | ||||
| 										</h:panelGrid> | ||||
| 								</b:form> | ||||
| 						</b:panel> | ||||
| 				</ui:define> | ||||
| 				<ui:define name="navigation"> | ||||
| 						<b:form rendered="#{sessionBean.hasLogin}"> | ||||
| 								<b:buttonGroup> | ||||
| 										<b:commandButton action="#{noteControl.toList}" value="#{noteControl.amount} Notizen verwalten" look="primary" iconAwesome="comments-o" rendered="#{sessionBean.hasPrivilege('write_note')}" /> | ||||
| 										<b:commandButton action="#{contactControl.toList}" value="#{contactControl.amount} Kontakte verwalten" look="primary" iconAwesome="group" rendered="#{sessionBean.hasPrivilege('write_contact')}" /> | ||||
| 										<b:commandButton action="#{doneControl.toList}" value="Arbeitszeit verwalten" look="primary" iconAwesome="clock-o" rendered="#{sessionBean.hasPrivilege('write_done')}" /> | ||||
| 										<b:commandButton action="#{doneControl.toRead}" value="Arbeitszeiten anzeigen" look="primary" iconAwesome="clock-o" rendered="#{sessionBean.hasPrivilege('read_done')}" /> | ||||
| 										<b:commandButton action="#{sessionControl.doLogout}" value="abmelden" look="danger" iconAwesome="sign-out" /> | ||||
| 								</b:buttonGroup> | ||||
| 						</b:form> | ||||
| 				</ui:define> | ||||
| 		</ui:composition> | ||||
| </h:body> | ||||
| </html> | ||||
| @@ -1,24 +1,24 @@ | ||||
| <!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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:my="http://xmlns.jcp.org/jsf/composite/my" xmlns:b="http://bootsfaces.net/ui"> | ||||
| <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:my="http://xmlns.jcp.org/jsf/composite/my" xmlns:b="http://bootsfaces.net/ui" style="height: 100%; width: 100%"> | ||||
| <h:head> | ||||
|   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||||
| 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||||
| </h:head> | ||||
| <h:body styleClass="body"> | ||||
|   <h:outputStylesheet name="css/style.css" /> | ||||
|   <h:outputScript library="bsf" name="jq/jquery.js" target="head" /> | ||||
|   <div class="page"> | ||||
|     <div class="top"> | ||||
|       <ui:insert name="top" /> | ||||
|     </div> | ||||
|     <div> | ||||
|       <b:messages /> | ||||
|     </div> | ||||
|     <div class="body"> | ||||
|       <ui:insert name="main" /> | ||||
|     </div> | ||||
|     <div class="navigation"> | ||||
|       <ui:insert name="navigation" /> | ||||
|     </div> | ||||
|   </div> | ||||
| 		<h:outputStylesheet name="css/style.css" /> | ||||
| 		<h:outputScript library="bsf" name="jq/jquery.js" target="head" /> | ||||
| 		<div class="page"> | ||||
| 				<div class="top"> | ||||
| 						<ui:insert name="top" /> | ||||
| 				</div> | ||||
| 				<div> | ||||
| 						<b:messages /> | ||||
| 				</div> | ||||
| 				<div class="main"> | ||||
| 						<ui:insert name="main" /> | ||||
| 				</div> | ||||
| 				<div class="navigation"> | ||||
| 						<ui:insert name="navigation" /> | ||||
| 				</div> | ||||
| 		</div> | ||||
| </h:body> | ||||
| </html> | ||||
|   | ||||
| @@ -1,3 +1,16 @@ | ||||
| .body { | ||||
| 	height: 100%; | ||||
| 	width: 100%; | ||||
| 	overflow: auto; | ||||
| } | ||||
|  | ||||
| .page { | ||||
| 	height: 100%; | ||||
| 	width: 100%; | ||||
| 	background-image: linear-gradient(to bottom, #fff 0%, #ccc 20%) | ||||
| 		!important; | ||||
| } | ||||
|  | ||||
| .emph { | ||||
| 	border-radius: 3px !important; | ||||
| 	border: 1px solid #3070b0 !important; | ||||
| @@ -23,11 +36,13 @@ | ||||
| } | ||||
|  | ||||
| .successWell { | ||||
| 	background-image: linear-gradient(to bottom, #ceeaca 0%, #f7fff7 100%) !important; | ||||
| 	background-image: linear-gradient(to bottom, #ceeaca 0%, #f7fff7 100%) | ||||
| 		!important; | ||||
| } | ||||
|  | ||||
| .dangerWell { | ||||
| 	background-image: linear-gradient(to bottom, #eacaca 0%, #fff7f7 100%) !important; | ||||
| 	background-image: linear-gradient(to bottom, #eacaca 0%, #fff7f7 100%) | ||||
| 		!important; | ||||
| } | ||||
|  | ||||
| .WP2 { | ||||
| @@ -45,3 +60,15 @@ | ||||
| 	background-color: #e396ff !important; | ||||
| } | ||||
|  | ||||
| .left { | ||||
| 	text-align: left; | ||||
| } | ||||
|  | ||||
| .right { | ||||
| 	text-align: right; | ||||
| } | ||||
|  | ||||
| .version { | ||||
| 	font-size: small; | ||||
| 	color: silver; | ||||
| } | ||||
		Reference in New Issue
	
	Block a user