version number visible

This commit is contained in:
Jörg Henke
2021-01-16 15:50:48 +01:00
parent ec68448200
commit 71bb01e05c
7 changed files with 151 additions and 98 deletions

View File

@ -1,17 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="bin/main" path="src/jooq/java">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/main" path="src/main/java">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/main" path="src/jooq/java">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src/main/webapp"/>
<classpathentry kind="src" output="bin/main" path="src/main/resources">
<attributes>
<attribute name="gradle_scope" value="main"/>
@ -36,6 +37,5 @@
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src/main/webapp"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>

View File

@ -11,6 +11,10 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="src/jooq/java"/>
<wb-resource deploy-path="/" source-path="src/main/webapp"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/jooq/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/webapp"/>
</wb-module>

View File

@ -22,7 +22,7 @@ apply plugin: 'eclipse'
apply plugin: 'nu.studer.jooq'
group = 'jottyfan'
version = '1.1.2'
version = '1.1.3'
description = """timetrack"""
@ -108,6 +108,9 @@ jooq {
war {
archiveName 'timetrack.war'
manifest {
attributes('Implementation-Version': project.version)
}
}
// removes the task dependency from compileJava to generateTimetrackJooqSchemaSource
project.tasks.getByName('compileJava').dependsOn -= 'generateTimetrackJooqSchemaSource'

View File

@ -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;

View File

@ -1,7 +1,6 @@
<!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>
@ -37,31 +36,31 @@
</b:panel>
</b:accordion>
</b:panel>
<b:panel title="Login" rendered="#{sessionBean.hasNoLogin}" styleClass="loginpanel">
<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="Username" />
<h:outputText value="Benutzer" />
</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" />
<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="#{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" />

View File

@ -1,5 +1,5 @@
<!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" />
</h:head>
@ -13,7 +13,7 @@
<div>
<b:messages />
</div>
<div class="body">
<div class="main">
<ui:insert name="main" />
</div>
<div class="navigation">

View File

@ -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;
}