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
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: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:tools="http://java.sun.com/jsf/composite/cditools">
<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:tools="http://java.sun.com/jsf/composite/cditools">
<h:body>
<ui:composition template="/layout/#{sessionHandler.adduserfullscreen}/template.xhtml">
<f:metadata>
<f:metadata>
<f:event type="preRenderView" listener="#{authView.executeAdduserViewLogin}" />
</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">
<h1>#{i18n['login.login']}</h1>
<login:login />
<h:panelGrid columns="2">
<h:panelGroup>
<h1>#{i18n['login.login']}</h1>
</h:panelGroup>
<h:panelGroup>
<login:login />
</h:panelGroup>
</h:panelGrid>
</ui:define>
</ui:composition>
......
......@@ -8,19 +8,25 @@
<f:metadata>
<f:event type="preRenderView" listener="#{userView.initCreateView}" />
</f:metadata>
<ui:define name="content">
<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">
<ui:define name="topbar">
<h:link styleClass="userbackbutton" outcome="/admin/adduser/start">
<div>#{i18n['adduser.back']}</div>
</h:commandLink>
</h:form>
</h:link>
</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:composition>
......
......@@ -6,26 +6,28 @@
<ui:composition template="/layout/#{sessionHandler.adduserfullscreen}/template.xhtml">
<ui:define name="content">
<h:form>
<div style="text-align: center;">
<h1>#{i18n["adduser.welcome"]}</h1>
<br /> <br /> <br /> <br />
<div style="width: 300px; margin: 0 auto;">
<h:link styleClass="touchItem" outcome="/admin/adduser/newuser" >
<div>
#{i18n['adduser.newuser']}
</div>
</h:link>
<span style="width: 6em;">&nbsb;</span>
<h:link styleClass="touchItem" outcome="/admin/adduser/login" >
<div>
#{i18n['adduser.update']}
</div>
</h:link>
</div>
<h:form>
<div>
<h:panelGrid columns="2">
<h:panelGroup>
<h1>#{i18n["adduser.welcome"]}</h1>
</h:panelGroup>
<h:panelGroup>
<div style="width: 300px; margin: 0 auto;">
<h:link styleClass="touchItem" outcome="/admin/adduser/newuser">
<div>#{i18n['adduser.newuser']}</div>
</h:link>
<span style="width: 6em;"> &nbsb;
</span>
<h:link styleClass="touchItem" outcome="/admin/adduser/login">
<div>#{i18n['adduser.update']}</div>
</h:link>
</div>
</h:panelGroup>
</h:panelGrid>
</div>
</h:form>
</h:form>
</ui:define>
</ui:composition>
......
......@@ -10,31 +10,37 @@
<f:event type="preRenderView" listener="#{userView.initView}" />
</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">
<div style="text-align: center;">
<h:panelGrid columns="2">
<h:panelGroup>
<h1>#{i18n["adduser.update"]}</h1>
<h:form styleClass="captureForm">
<h:panelGrid columns="2">
<div id="webcamcontainer">
<h:form styleClass="captureForm">
<div id="count" />
<p:photoCam widgetVar="pc" listener="#{userView.oncapture}" update="@all" />
<p:commandButton type="button" value="Capture" onclick="dophoto(pc)" />
<h:panelGroup>
<h1>#{i18n["adduser.update"]}</h1>
<br />
<br />
<a class="touchItem" href="javascript:dophoto(pc);">
<div>#{i18n["adduser.takePhoto"]}</div>
</a>
</h:panelGroup>
</h:form>
</div>
</h:panelGroup>
<h:panelGroup styleClass="top">
<h2>#{i18n['user.thisIsCurrentImage']}</h2>
<h:outputText rendered="#{empty userView.user.currentImage}" value="#{i18n['user.noCurrentImage']}" />
<ui:fragment rendered="#{!empty userView.user.currentImage}">
<img width="300" src="#{request.contextPath}/dydata/userimage/#{userView.user.currentImage.id}.img" alt="image" />
</ui:fragment>
</h:panelGroup>
</h:panelGrid>
<h:panelGroup>
<div id="webcamcontainer">
<div id="count" />
<p:photoCam widgetVar="pc" listener="#{userView.oncapture}" update="@all" />
<!-- <p:commandButton type="button" value="Capture" onclick="dophoto(pc)" />
-->
</div>
</h:panelGroup>
</h:panelGrid>
</h:form>
</div>
......@@ -66,6 +72,9 @@
font-size: 25pt;
text-align: center;
width: 30px;
postition: relative;
top: -5em;
background: none;
}
</style>
</ui:define>
......
......@@ -28,43 +28,45 @@
<h:body>
<h:outputScript library="primefaces" name="jquery/jquery.js" />
<div class="container top">
<ui:insert name="topbar" />
</div>
<div class="container clearfix">
<div id="content">
<div id="content" class="boxcenter">
<ui:insert name="content" />
</div>
</div>
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://jolez.pingtimeout.net/piwik/"
: "http://jolez.pingtimeout.net/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL
+ "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>
<script>
$(function(){
$(window).resize(function() {
onResize(); });
<noscript>
<p>
<img src="http://jolez.pingtimeout.net/piwik/piwik.php?idsite=5"
style="border: 0" alt="" />
</p>
</noscript>
<!-- End Piwik Tracking Code -->
function onResize() {
$('.boxcenter').css({
position:'absolute',
left: ($(window).width()
- $('.boxcenter').outerWidth())/2,
top: ($(window).height()
- $('.boxcenter').outerHeight())/2
});
}
// To initially run the function:
onResize();
});
</script>
</h:body>
</f:view>
......
......@@ -3,7 +3,7 @@
"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"
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>
......@@ -16,21 +16,20 @@
<c:choose>
<c:when test="#{not empty cc.attrs.isOneliner}">
<h:inputText styleClass="form" id="linelogin" value="#{authView.login}" />
<h:inputSecret styleClass="form" id="linepwd" value="#{authView.password}" />
<h:commandButton styleClass="button" id="onelinesubmit" action="#{authView.executeLoginAction}" value="#{i18n['login.submit']}" />
<p:inputText styleClass="form" id="linelogin" value="#{authView.login}" />
<p:password styleClass="form" id="linepwd" value="#{authView.password}" />
<p:commandButton styleClass="button" id="onelinesubmit" action="#{authView.executeLoginAction}" value="#{i18n['login.submit']}" />
</c:when>
<c:otherwise>
<h:panelGrid columns="2">
<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:inputSecret id="gridPwd" value="#{authView.password}" />
<p:password id="gridPwd" value="#{authView.password}" />
</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:choose>
......
......@@ -41,6 +41,27 @@
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 {
float: none;
display: inline-block;
......@@ -50,13 +71,21 @@
height: 128px;
border: 1px solid black;
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 {
color: black !important;
}
a.touchItem {
a.touchItem, a.userbackbutton {
color: white !important;
font-weight: bold;
......@@ -108,14 +137,32 @@ a.shopItem div {
clip: rect(0, 72px, 72px, 0);
}
a.shopItem:hover,a.touchItem:hover {
background: rgba(255, 255, 255, 0.2);
a.shopItem:hover,a.touchItem:hover, a.userbackbutton:hover {
background: blue;
}
a.shopItem:active,a.touchItem:active {
a.shopItem:active,a.touchItem:active, a.userbackbutton:hover {
background: red;
}
.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 {
font-size: 62.5%;
background-color: #fff;
font-family: verdana, arial, sans-serif;
padding: 1em;
} /*Font-size: 1.0em = 10px when browser default size is 16px*/
#main {
clear: both;
......@@ -32,8 +33,3 @@ body {
width: 800px;
margin: 0 auto;
}
table td {
vertical-align: top;
}
\ No newline at end of file
......@@ -35,7 +35,10 @@ actionlog.time = Time
actionlog.user = User
adduser.back = Back
adduser.newphoto = Take new photo
adduser.newuser = Create new user
adduser.takePhoto = Take photo
adduser.tostart = Back to start
adduser.update = Update profile picture
adduser.welcome = Welcome
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
actionlog.user = Tekij\u00E4
adduser.back = Takaisin
adduser.newphoto = Ota uusi kuva
adduser.newuser = Luo uusi k\u00E4ytt\u00E4j\u00E4tunnus
adduser.takePhoto = Ota kuva
adduser.tostart = Takaisin alkuun
adduser.update = P\u00E4ivit\u00E4 profiilin kuva
adduser.welcome = Tervetuloa
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 {
public void executeAdduserViewLogin() {
navihandler.saveNavigation("/admin/adduser/update");
doLogin("/admin/adduser/loginerror");
doLogin("/admin/adduser/login");
}
public String executeLoginAction() {
......
......@@ -104,6 +104,7 @@ public class UserView extends GenericCDIView {
byte[] data = captureEvent.getData();
UserImage img = userbean.uploadImage(user, "image/png", data, "userimage.png", "Uploaded image");
user = userbean.getEventUser(img.getUser());
super.navihandler.forward("/admin/adduser/capturesuccess");
}
@Produces
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!