Commit b7c3026e by Petri Jarvisalo

userview

1 parent 0daf2748
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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:c="http://java.sun.com/jsp/jstl/core" xmlns:p="http://primefaces.org/ui" xmlns:shop="http://java.sun.com/jsf/composite/cditools/shop" xmlns:tools="http://java.sun.com/jsf/composite/cditools">
<h:body>
<ui:composition template="/layout/#{sessionHandler.adduserfullscreen}/template.xhtml">
<f:metadata>
<f:viewParam name="userid" value="#{userView.userid}" />
<f:event type="preRenderView" listener="#{userView.initView}" />
</f:metadata>
<ui:define name="topbar">
<h:link styleClass="userbackbutton" outcome="/admin/adduser/update">
<div>#{i18n['adduser.back']}</div>
</h:link>
</ui:define>
<ui:define name="content">
<h:form>
<div>
<h:panelGrid columns="2">
<h:panelGroup>
<h1>#{i18n["adduser.update"]}</h1>
<br />
<br />
<h:link styleClass="touchItem" outcome="/admin/adduser/update">
<div>#{i18n['adduser.newphoto']}</div>
</h:link>
<h:link styleClass="touchItem" outcome="/admin/adduser/start">
<div>#{i18n['adduser.tostart']}</div>
</h:link>
</h:panelGroup>
<h:panelGroup>
<h:outputText rendered="#{empty userView.user.currentImage}" value="#{i18n['user.noCurrentImage']}" />
<ui:fragment rendered="#{!empty userView.user.currentImage}">
<img style="width: 300px;" src="#{request.contextPath}/dydata/userimage/#{userView.user.currentImage.id}.img" alt="image" />
</ui:fragment>
</h:panelGroup>
</h:panelGrid>
</div>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
<!DOCTYPE html <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <html xmlns="http://www.w3.org/1999/xhtml" xmlns:login="http://java.sun.com/jsf/composite/cditools/login" 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:c="http://java.sun.com/jsp/jstl/core" xmlns:p="http://primefaces.org/ui" xmlns:users="http://java.sun.com/jsf/composite/cditools/user"
xmlns:login="http://java.sun.com/jsf/composite/cditools/login" xmlns:tools="http://java.sun.com/jsf/composite/cditools">
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:c="http://java.sun.com/jsp/jstl/core" xmlns:p="http://primefaces.org/ui" xmlns:users="http://java.sun.com/jsf/composite/cditools/user" xmlns:tools="http://java.sun.com/jsf/composite/cditools">
<h:body> <h:body>
<ui:composition template="/layout/#{sessionHandler.adduserfullscreen}/template.xhtml"> <ui:composition template="/layout/#{sessionHandler.adduserfullscreen}/template.xhtml">
<f:metadata> <f:metadata>
<f:event type="preRenderView" listener="#{authView.executeAdduserViewLogin}" /> <f:event type="preRenderView" listener="#{authView.executeAdduserViewLogin}" />
</f:metadata> </f:metadata>
<ui:define name="topbar">
<h:link styleClass="userbackbutton" outcome="/admin/adduser/start">
<div>#{i18n['adduser.back']}</div>
</h:link>
</ui:define>
<ui:define name="content"> <ui:define name="content">
<h1>#{i18n['login.login']}</h1> <h:panelGrid columns="2">
<h:panelGroup>
<login:login /> <h1>#{i18n['login.login']}</h1>
</h:panelGroup>
<h:panelGroup>
<login:login />
</h:panelGroup>
</h:panelGrid>
</ui:define> </ui:define>
</ui:composition> </ui:composition>
......
...@@ -8,19 +8,25 @@ ...@@ -8,19 +8,25 @@
<f:metadata> <f:metadata>
<f:event type="preRenderView" listener="#{userView.initCreateView}" /> <f:event type="preRenderView" listener="#{userView.initCreateView}" />
</f:metadata> </f:metadata>
<ui:define name="topbar">
<ui:define name="content"> <h:link styleClass="userbackbutton" outcome="/admin/adduser/start">
<div style="text-align: center;">
<h1>#{i18n["adduser.newuser"]}</h1>
<div style="width: 400px; text-align: left; margin: 0 auto;">
<users:create creating="true" commitaction="#{userView.createUserAdduserView()}" commitvalue="#{i18n['user.create']}" />
</div>
</div>
<h:form>
<h:commandLink styleClass="userbackbutton" action="/admin/adduser/start">
<div>#{i18n['adduser.back']}</div> <div>#{i18n['adduser.back']}</div>
</h:commandLink> </h:link>
</h:form> </ui:define>
<ui:define name="content">
<h:panelGrid columns="2">
<h:panelGroup>
<h1>#{i18n["adduser.newuser"]}</h1>
</h:panelGroup>
<h:panelGroup>
<div style="text-align: left;">
<users:create creating="true" commitaction="#{userView.createUserAdduserView()}" commitvalue="#{i18n['user.create']}" />
</div>
</h:panelGroup>
</h:panelGrid>
</ui:define> </ui:define>
</ui:composition> </ui:composition>
......
...@@ -6,26 +6,28 @@ ...@@ -6,26 +6,28 @@
<ui:composition template="/layout/#{sessionHandler.adduserfullscreen}/template.xhtml"> <ui:composition template="/layout/#{sessionHandler.adduserfullscreen}/template.xhtml">
<ui:define name="content"> <ui:define name="content">
<h:form> <h:form>
<div style="text-align: center;"> <div>
<h:panelGrid columns="2">
<h1>#{i18n["adduser.welcome"]}</h1> <h:panelGroup>
<br /> <br /> <br /> <br /> <h1>#{i18n["adduser.welcome"]}</h1>
<div style="width: 300px; margin: 0 auto;"> </h:panelGroup>
<h:link styleClass="touchItem" outcome="/admin/adduser/newuser" > <h:panelGroup>
<div> <div style="width: 300px; margin: 0 auto;">
#{i18n['adduser.newuser']} <h:link styleClass="touchItem" outcome="/admin/adduser/newuser">
</div> <div>#{i18n['adduser.newuser']}</div>
</h:link> </h:link>
<span style="width: 6em;">&nbsb;</span> <span style="width: 6em;"> &nbsb;
<h:link styleClass="touchItem" outcome="/admin/adduser/login" > </span>
<div> <h:link styleClass="touchItem" outcome="/admin/adduser/login">
#{i18n['adduser.update']} <div>#{i18n['adduser.update']}</div>
</div> </h:link>
</h:link> </div>
</div> </h:panelGroup>
</h:panelGrid>
</div> </div>
</h:form> </h:form>
</ui:define> </ui:define>
</ui:composition> </ui:composition>
......
...@@ -10,31 +10,37 @@ ...@@ -10,31 +10,37 @@
<f:event type="preRenderView" listener="#{userView.initView}" /> <f:event type="preRenderView" listener="#{userView.initView}" />
</f:metadata> </f:metadata>
<ui:define name="topbar">
<h:link styleClass="userbackbutton" outcome="/admin/adduser/start">
<div>#{i18n['adduser.back']}</div>
</h:link>
</ui:define>
<ui:define name="content"> <ui:define name="content">
<div style="text-align: center;"> <div style="text-align: center;">
<h:panelGrid columns="2"> <h:form styleClass="captureForm">
<h:panelGroup> <h:panelGrid columns="2">
<h1>#{i18n["adduser.update"]}</h1>
<div id="webcamcontainer"> <h:panelGroup>
<h:form styleClass="captureForm"> <h1>#{i18n["adduser.update"]}</h1>
<div id="count" /> <br />
<p:photoCam widgetVar="pc" listener="#{userView.oncapture}" update="@all" /> <br />
<p:commandButton type="button" value="Capture" onclick="dophoto(pc)" /> <a class="touchItem" href="javascript:dophoto(pc);">
<div>#{i18n["adduser.takePhoto"]}</div>
</a>
</h:panelGroup>
</h:form> <h:panelGroup>
</div> <div id="webcamcontainer">
</h:panelGroup>
<div id="count" />
<h:panelGroup styleClass="top"> <p:photoCam widgetVar="pc" listener="#{userView.oncapture}" update="@all" />
<h2>#{i18n['user.thisIsCurrentImage']}</h2> <!-- <p:commandButton type="button" value="Capture" onclick="dophoto(pc)" />
<h:outputText rendered="#{empty userView.user.currentImage}" value="#{i18n['user.noCurrentImage']}" /> -->
<ui:fragment rendered="#{!empty userView.user.currentImage}"> </div>
<img width="300" src="#{request.contextPath}/dydata/userimage/#{userView.user.currentImage.id}.img" alt="image" /> </h:panelGroup>
</ui:fragment> </h:panelGrid>
</h:panelGroup> </h:form>
</h:panelGrid>
</div> </div>
...@@ -66,6 +72,9 @@ ...@@ -66,6 +72,9 @@
font-size: 25pt; font-size: 25pt;
text-align: center; text-align: center;
width: 30px; width: 30px;
postition: relative;
top: -5em;
background: none;
} }
</style> </style>
</ui:define> </ui:define>
......
...@@ -28,43 +28,45 @@ ...@@ -28,43 +28,45 @@
<h:body> <h:body>
<h:outputScript library="primefaces" name="jquery/jquery.js" />
<div class="container top"> <div class="container top">
<ui:insert name="topbar" /> <ui:insert name="topbar" />
</div> </div>
<div class="container clearfix"> <div class="container clearfix">
<div id="content"> <div id="content" class="boxcenter">
<ui:insert name="content" /> <ui:insert name="content" />
</div> </div>
</div> </div>
<!-- Piwik --> <script>
<script type="text/javascript"> $(function(){
var pkBaseURL = (("https:" == document.location.protocol) ? "https://jolez.pingtimeout.net/piwik/"
: "http://jolez.pingtimeout.net/piwik/"); $(window).resize(function() {
document.write(unescape("%3Cscript src='" + pkBaseURL onResize(); });
+ "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 5);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch (err) {
}
</script>
<noscript> function onResize() {
<p> $('.boxcenter').css({
<img src="http://jolez.pingtimeout.net/piwik/piwik.php?idsite=5" position:'absolute',
style="border: 0" alt="" /> left: ($(window).width()
</p> - $('.boxcenter').outerWidth())/2,
</noscript> top: ($(window).height()
<!-- End Piwik Tracking Code --> - $('.boxcenter').outerHeight())/2
});
}
// To initially run the function:
onResize();
});
</script>
</h:body> </h:body>
</f:view> </f:view>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:p="http://primefaces.org/ui"
> >
<composite:interface> <composite:interface>
...@@ -16,21 +16,20 @@ ...@@ -16,21 +16,20 @@
<c:choose> <c:choose>
<c:when test="#{not empty cc.attrs.isOneliner}"> <c:when test="#{not empty cc.attrs.isOneliner}">
<h:inputText styleClass="form" id="linelogin" value="#{authView.login}" /> <p:inputText styleClass="form" id="linelogin" value="#{authView.login}" />
<h:inputSecret styleClass="form" id="linepwd" value="#{authView.password}" /> <p:password styleClass="form" id="linepwd" value="#{authView.password}" />
<h:commandButton styleClass="button" id="onelinesubmit" action="#{authView.executeLoginAction}" value="#{i18n['login.submit']}" /> <p:commandButton styleClass="button" id="onelinesubmit" action="#{authView.executeLoginAction}" value="#{i18n['login.submit']}" />
</c:when> </c:when>
<c:otherwise> <c:otherwise>
<h:panelGrid columns="2"> <h:panelGrid columns="2">
<h:outputLabel for="gridLogin" value="#{i18n['login.username']}" /> <h:outputLabel for="gridLogin" value="#{i18n['login.username']}" />
<h:inputText id="gridLogin" value="#{authView.login}" /> <p:inputText id="gridLogin" value="#{authView.login}" />
<h:outputLabel for="gridPwd" value="#{i18n['login.password']}" /> <h:outputLabel for="gridPwd" value="#{i18n['login.password']}" />
<h:inputSecret id="gridPwd" value="#{authView.password}" /> <p:password id="gridPwd" value="#{authView.password}" />
</h:panelGrid> </h:panelGrid>
<h:commandButton id="gridsubmit" actionListener="#{authView.executeLogin()}" value="#{i18n['login.submit']}" /> <p:commandButton id="gridsubmit" actionListener="#{authView.executeLogin()}" value="#{i18n['login.submit']}" />
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
......
...@@ -41,6 +41,27 @@ ...@@ -41,6 +41,27 @@
margin: 2px; margin: 2px;
} }
.userbackbutton {
border: 1px solid black;
margin: 2px;
}
a.userbackbutton div {
position: absolute;
width: 10em;
padding: 1.2em 0;
text-align: center;
background: rgb(135,224,253); /* Old browsers */
background: -moz-linear-gradient(top, rgba(135,224,253,1) 0%, rgba(83,203,241,1) 40%, rgba(5,171,224,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(135,224,253,1)), color-stop(40%,rgba(83,203,241,1)), color-stop(100%,rgba(5,171,224,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(135,224,253,1) 0%,rgba(83,203,241,1) 40%,rgba(5,171,224,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(135,224,253,1) 0%,rgba(83,203,241,1) 40%,rgba(5,171,224,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(135,224,253,1) 0%,rgba(83,203,241,1) 40%,rgba(5,171,224,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(135,224,253,1) 0%,rgba(83,203,241,1) 40%,rgba(5,171,224,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#87e0fd', endColorstr='#05abe0',GradientType=0 ); /* IE6-9 */
border: 1px solid black;
}
.touchItem { .touchItem {
float: none; float: none;
display: inline-block; display: inline-block;
...@@ -50,13 +71,21 @@ ...@@ -50,13 +71,21 @@
height: 128px; height: 128px;
border: 1px solid black; border: 1px solid black;
margin: 2px; margin: 2px;
background: rgb(135,224,253); /* Old browsers */
background: -moz-linear-gradient(top, rgba(135,224,253,1) 0%, rgba(83,203,241,1) 40%, rgba(5,171,224,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(135,224,253,1)), color-stop(40%,rgba(83,203,241,1)), color-stop(100%,rgba(5,171,224,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(135,224,253,1) 0%,rgba(83,203,241,1) 40%,rgba(5,171,224,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(135,224,253,1) 0%,rgba(83,203,241,1) 40%,rgba(5,171,224,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(135,224,253,1) 0%,rgba(83,203,241,1) 40%,rgba(5,171,224,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(135,224,253,1) 0%,rgba(83,203,241,1) 40%,rgba(5,171,224,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#87e0fd', endColorstr='#05abe0',GradientType=0 ); /* IE6-9 */
} }
a.shopItem { a.shopItem {
color: black !important; color: black !important;
} }
a.touchItem { a.touchItem, a.userbackbutton {
color: white !important; color: white !important;
font-weight: bold; font-weight: bold;
...@@ -108,14 +137,32 @@ a.shopItem div { ...@@ -108,14 +137,32 @@ a.shopItem div {
clip: rect(0, 72px, 72px, 0); clip: rect(0, 72px, 72px, 0);
} }
a.shopItem:hover,a.touchItem:hover { a.shopItem:hover,a.touchItem:hover, a.userbackbutton:hover {
background: rgba(255, 255, 255, 0.2); background: blue;
} }
a.shopItem:active,a.touchItem:active { a.shopItem:active,a.touchItem:active, a.userbackbutton:hover {
background: red; background: red;
} }
.top { .top {
vertical-align: top; vertical-align: top;
}
.boxcenter {
text-align: center;
/* Firefox */
display: -moz-box;
-moz-box-orient: horizontal;
-moz-box-pack: center;
-moz-box-align: center;
/* Safari and Chrome */
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-pack: center;
-webkit-box-align: center;
/* W3C */
display: box;
box-orient: horizontal;
box-pack: center;
box-align: center;
} }
\ No newline at end of file
...@@ -8,6 +8,7 @@ body { ...@@ -8,6 +8,7 @@ body {
font-size: 62.5%; font-size: 62.5%;
background-color: #fff; background-color: #fff;
font-family: verdana, arial, sans-serif; font-family: verdana, arial, sans-serif;
padding: 1em;
} /*Font-size: 1.0em = 10px when browser default size is 16px*/ } /*Font-size: 1.0em = 10px when browser default size is 16px*/
#main { #main {
clear: both; clear: both;
...@@ -32,8 +33,3 @@ body { ...@@ -32,8 +33,3 @@ body {
width: 800px; width: 800px;
margin: 0 auto; margin: 0 auto;
} }
table td {
vertical-align: top;
}
\ No newline at end of file
...@@ -35,7 +35,10 @@ actionlog.time = Time ...@@ -35,7 +35,10 @@ actionlog.time = Time
actionlog.user = User actionlog.user = User
adduser.back = Back adduser.back = Back
adduser.newphoto = Take new photo
adduser.newuser = Create new user adduser.newuser = Create new user
adduser.takePhoto = Take photo
adduser.tostart = Back to start
adduser.update = Update profile picture adduser.update = Update profile picture
adduser.welcome = Welcome adduser.welcome = Welcome
adduser.welcometext = Here you can add new user or update your current user profile image. Please select desired action below. adduser.welcometext = Here you can add new user or update your current user profile image. Please select desired action below.
......
...@@ -35,7 +35,10 @@ actionlog.time = Aika ...@@ -35,7 +35,10 @@ actionlog.time = Aika
actionlog.user = Tekij\u00E4 actionlog.user = Tekij\u00E4
adduser.back = Takaisin adduser.back = Takaisin
adduser.newphoto = Ota uusi kuva
adduser.newuser = Luo uusi k\u00E4ytt\u00E4j\u00E4tunnus adduser.newuser = Luo uusi k\u00E4ytt\u00E4j\u00E4tunnus
adduser.takePhoto = Ota kuva
adduser.tostart = Takaisin alkuun
adduser.update = P\u00E4ivit\u00E4 profiilin kuva adduser.update = P\u00E4ivit\u00E4 profiilin kuva
adduser.welcome = Tervetuloa adduser.welcome = Tervetuloa
adduser.welcometext = Voit luoda t\u00E4ss\u00E4 k\u00E4tev\u00E4sti uuden tunnuksen tai vaihtaa nykyisen tunnuksen profiilikuvan uudempaan. adduser.welcometext = Voit luoda t\u00E4ss\u00E4 k\u00E4tev\u00E4sti uuden tunnuksen tai vaihtaa nykyisen tunnuksen profiilikuvan uudempaan.
......
...@@ -109,7 +109,7 @@ public class AuthView extends GenericCDIView { ...@@ -109,7 +109,7 @@ public class AuthView extends GenericCDIView {
public void executeAdduserViewLogin() { public void executeAdduserViewLogin() {
navihandler.saveNavigation("/admin/adduser/update"); navihandler.saveNavigation("/admin/adduser/update");
doLogin("/admin/adduser/loginerror"); doLogin("/admin/adduser/login");
} }
public String executeLoginAction() { public String executeLoginAction() {
......
...@@ -104,6 +104,7 @@ public class UserView extends GenericCDIView { ...@@ -104,6 +104,7 @@ public class UserView extends GenericCDIView {
byte[] data = captureEvent.getData(); byte[] data = captureEvent.getData();
UserImage img = userbean.uploadImage(user, "image/png", data, "userimage.png", "Uploaded image"); UserImage img = userbean.uploadImage(user, "image/png", data, "userimage.png", "Uploaded image");
user = userbean.getEventUser(img.getUser()); user = userbean.getEventUser(img.getUser());
super.navihandler.forward("/admin/adduser/capturesuccess");
} }
@Produces @Produces
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!