Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b8b364df
authored
Oct 27, 2017
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kiosk adduser view fixes
1 parent
8441bf57
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
38 deletions
code/moya-web/WebContent/admin/adduser/login.xhtml
code/moya-web/WebContent/admin/adduser/update.xhtml
code/moya-web/WebContent/resources/cditools/login/login.xhtml
code/moya-web/WebContent/resources/templates/adduser/css/style.css
code/moya-web/WebContent/resources/templates/adduser/template.xhtml
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/user/AuthView.java
code/moya-web/WebContent/admin/adduser/login.xhtml
View file @
b8b364d
<!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"
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"
<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"
>
xmlns:tools=
"http://java.sun.com/jsf/composite/cditools"
>
<h:body>
<h:body>
<ui:composition
template=
"/resources/templates/#{sessionHandler.adduserfullscreen}/template.xhtml"
>
<ui:composition
template=
"/resources/templates/#{sessionHandler.adduserfullscreen}/template.xhtml"
>
<f:metadata>
<f:metadata>
<f:event
type=
"preRenderView"
listener=
"#{authView.executeAdduserViewLogin}"
/>
<f:event
type=
"preRenderView"
listener=
"#{authView.executeAdduserViewLogin}"
/>
<f:viewParam
name=
"loginError"
value=
"#{authView.loginError}"
/>
</f:metadata>
</f:metadata>
<ui:define
name=
"topbar"
>
<ui:define
name=
"topbar"
>
<h:link
styleClass=
"userbackbutton"
outcome=
"/admin/adduser/index"
>
<h:link
styleClass=
"userbackbutton"
outcome=
"/admin/adduser/index"
>
...
@@ -22,7 +24,11 @@
...
@@ -22,7 +24,11 @@
</h:panelGroup>
</h:panelGroup>
<h:panelGroup>
<h:panelGroup>
<login:login
/>
<h:panelGroup
rendered=
"#{authView.loginError}"
>
<h2>
Kirjautuminen epäonnistu.
</h2>
<p>
Tarkista käyttäjätunnus ja salasana
</p>
</h:panelGroup>
<login:login
onError=
"/admin/adduser/login?loginError=true&faces-redirect=true"
/>
</h:panelGroup>
</h:panelGroup>
</h:panelGrid>
</h:panelGrid>
</ui:define>
</ui:define>
...
...
code/moya-web/WebContent/admin/adduser/update.xhtml
View file @
b8b364d
<!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"
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"
>
<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>
<h:body>
<ui:composition
template=
"/resources/templates/#{sessionHandler.adduserfullscreen}/template.xhtml"
>
<ui:composition
template=
"/resources/templates/#{sessionHandler.adduserfullscreen}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.user.create"
/>
<ui:param
name=
"thispage"
value=
"page.user.create"
/>
<f:metadata>
<f:metadata>
<f:viewParam
name=
"userid"
value=
"#{userView.userid}"
/>
<f:viewParam
name=
"userid"
value=
"#{userView.userid}"
/>
<f:event
type=
"preRenderView"
listener=
"#{userView.initView}"
/>
<f:event
type=
"preRenderView"
listener=
"#{userView.initView}"
/>
<f:event
type=
"preRenderView"
listener=
"#{userView.setCaptureForwardUrl('/admin/adduser/update')}"
/>
<f:event
type=
"preRenderView"
listener=
"#{userView.setCaptureForwardUrl('/admin/adduser/update')}"
/>
</f:metadata>
</f:metadata>
<ui:define
name=
"topbar"
>
<ui:define
name=
"topbar"
>
<h:form>
<h:form
id=
"readyform"
>
<h:commandLink
styleClass=
"userbackbutton"
action=
"#{userView.incomingPhotoReady}"
value=
"Valmis"
>
<h:commandLink
id=
"pictureReady"
styleClass=
"userbackbutton"
action=
"#{userView.incomingPhotoReady}"
value=
"Valmis"
>
<div>
#{i18n['adduser.back']}
</div>
<div>
#{i18n['adduser.back']}
</div>
</h:commandLink>
</h:commandLink>
</h:form>
</h:form>
...
@@ -22,32 +24,31 @@
...
@@ -22,32 +24,31 @@
</ui:define>
</ui:define>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<div
style=
"text-align: center;"
>
<div
style=
"text-align: center; margin-top: 10em;"
>
<div
style=
"display: none; font-size:5em;"
id=
"pictureTakenConfirm"
>
Kuva otettu
</div>
<h:form
styleClass=
"captureForm"
>
<h:form
styleClass=
"captureForm"
>
<h:panelGrid
columns=
"2"
>
<h:panelGrid
columns=
"2"
>
<h:panelGroup>
<h:panelGroup
style=
"vertical-align:top"
>
<h1>
#{i18n["adduser.update"]}
</h1>
<h1>
#{i18n["adduser.update"]}
</h1>
<br
/>
<br/>
<br
/>
<br/>
<a
class=
"touchItem"
href=
"javascript:dophoto(PF('pc'));"
>
<a
class=
"touchItem"
href=
"javascript:dophoto(PF('pc'));"
>
<div>
#{i18n["adduser.takePhoto"]}
</div>
<div>
#{i18n["adduser.takePhoto"]}
</div>
</a>
</a>
</h:panelGroup>
</h:panelGroup>
<h:panelGroup
style=
"vertical-align:top"
>
<h:panelGroup>
<div
id=
"webcamcontainer"
>
<div
id=
"webcamcontainer"
>
<p:photoCam
widgetVar=
"pc"
listener=
"#{userView.oncapture}"
/>
<p:photoCam
widgetVar=
"pc"
listener=
"#{userView.oncapture}"
/>
<p:commandButton
type=
"button"
value=
"Capture"
onclick=
"PF('pc').capture()"
/>
<!--p:commandButton type="button" value="Capture" onclick="PF('pc').capture()" -->
<div
id=
"count"
/>
<div
id=
"borderstuff"
style=
"border-style:solid; border-width: 2px; border-color:red; position:relative; height: 205px; width:150px; top: -225px; right:-85px"
>
</div>
<div
id=
"count"
style=
"padding: 95px 0 0 150px; top: -400px; position:relative;"
/>
<!-- <p:commandButton type="button" value="Capture" onclick="dophoto(pc)" />
<!-- <p:commandButton type="button" value="Capture" onclick="dophoto(pc)" />
-->
-->
</div>
</div>
...
@@ -56,22 +57,22 @@
...
@@ -56,22 +57,22 @@
</h:form>
</h:form>
</div>
</div>
<div
style=
""
>
<div
style=
"
display: none;
"
>
<h:form
id=
"incomingpictureform"
>
<h:form
id=
"incomingpictureform"
>
<h:commandLink
rendered=
"#{!empty userView.selectedUser.currentImage}"
style=
"margin: 0 auto; font-size: 3em;"
action=
"#{userView.incomingPhotoReady}"
value=
"Valmis"
/>
<br
/>
<p:fragment
rendered=
"#{!empty userView.selectedUser.currentImage}"
>
<p:fragment
rendered=
"#{!empty userView.selectedUser.currentImage}"
>
<p:graphicImage
value=
"/dydata/userimage/#{userView.selectedUser.currentImage.id}.img"
alt=
"image"
/>
<p:graphicImage
value=
"/dydata/userimage/#{userView.selectedUser.currentImage.id}.img"
alt=
"image"
/>
</p:fragment>
</p:fragment>
<h:commandLink
rendered=
"#{!empty userView.selectedUser.currentImage}"
style=
"margin: 0 auto; font-size: 3em;"
action=
"#{userView.incomingPhotoReady}"
value=
"Valmis"
/>
<br/>
</h:form>
</h:form>
</div>
</div>
<script>
<script
type=
"text/javascript"
>
function
dophoto
(
pc
)
{
function
dophoto
(
pc
)
{
docount
(
5
,
pc
);
docount
(
3
,
pc
);
}
}
function
docount
(
count
,
pc
)
{
function
docount
(
count
,
pc
)
{
...
@@ -80,28 +81,36 @@
...
@@ -80,28 +81,36 @@
$
(
'#count'
).
css
(
"font-size"
,
"28pt"
);
$
(
'#count'
).
css
(
"font-size"
,
"28pt"
);
$
(
'#count'
).
animate
({
$
(
'#count'
).
animate
({
opacity
:
0
,
opacity
:
0
,
fontSize
:
0
fontSize
:
0
},
1500
,
function
()
{
},
1500
,
function
()
{
if
(
count
>
1
)
if
(
count
>
1
)
docount
(
count
-
1
,
pc
);
docount
(
count
-
1
,
pc
);
if
(
count
==
1
)
{
if
(
count
==
1
)
{
pc
.
capture
();
pc
.
capture
();
$
(
'#pictureTakenConfirm'
).
show
();
window
.
setTimeout
(
function
()
{
$
(
'#readyform\\:pictureReady'
).
trigger
(
'click'
);
},
1500
);
}
}
});
});
}
}
</script>
</script>
<style>
<style
type=
"text/css"
>
#count
{
#count
{
font-size
:
25pt
;
font-size
:
25pt
;
text-align
:
center
;
text-align
:
center
;
width
:
30px
;
width
:
30px
;
postition
:
relative
;
postition
:
relative
;
top
:
-5em
;
top
:
-5em
;
background
:
none
;
background
:
none
;
}
}
</style>
td
{
vertical-align
:
top
;
}
</style>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
...
...
code/moya-web/WebContent/resources/cditools/login/login.xhtml
View file @
b8b364d
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
<p:password
id=
"gridPwd"
value=
"#{authView.password}"
/>
<p:password
id=
"gridPwd"
value=
"#{authView.password}"
/>
</h:panelGrid>
</h:panelGrid>
<p:commandButton
update=
"messages"
id=
"gridsubmit"
actionListener=
"#{authView.executeLogin(cc.attrs.on
e
rror)}"
ajax=
"false"
value=
"#{i18n['login.submit']}"
/>
<p:commandButton
update=
"messages"
id=
"gridsubmit"
actionListener=
"#{authView.executeLogin(cc.attrs.on
E
rror)}"
ajax=
"false"
value=
"#{i18n['login.submit']}"
/>
</c:otherwise>
</c:otherwise>
</c:choose>
</c:choose>
...
...
code/moya-web/WebContent/resources/templates/adduser/css/style.css
View file @
b8b364d
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
body
{
body
{
margin
:
0em
;
margin
:
0em
;
font-size
:
62.5%
;
background-color
:
#fff
;
background-color
:
#fff
;
font-family
:
verdana
,
arial
,
sans-serif
;
font-family
:
verdana
,
arial
,
sans-serif
;
padding
:
1em
;
padding
:
1em
;
...
...
code/moya-web/WebContent/resources/templates/adduser/template.xhtml
View file @
b8b364d
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
</div>
</div>
<script>
<script
type=
"text/javascript"
>
$
(
function
(){
$
(
function
(){
$
(
window
).
resize
(
function
()
{
$
(
window
).
resize
(
function
()
{
...
...
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/user/AuthView.java
View file @
b8b364d
...
@@ -127,10 +127,16 @@ public class AuthView extends GenericCDIView {
...
@@ -127,10 +127,16 @@ public class AuthView extends GenericCDIView {
doLogin
(
onError
);
doLogin
(
onError
);
}
}
public
void
setLoginError
(
boolean
loginError
)
{
this
.
loginError
=
loginError
;
}
private
boolean
loginError
=
false
;
private
boolean
loginError
=
false
;
public
boolean
isLoginError
()
{
public
boolean
isLoginError
()
{
return
loginError
;
return
loginError
;
}
}
private
void
doLogin
(
String
onError
)
{
private
void
doLogin
(
String
onError
)
{
// bootStrapBean.saneDefaults();
// bootStrapBean.saneDefaults();
...
@@ -183,6 +189,10 @@ public class AuthView extends GenericCDIView {
...
@@ -183,6 +189,10 @@ public class AuthView extends GenericCDIView {
request
.
logout
();
request
.
logout
();
request
.
getSession
().
invalidate
();
request
.
getSession
().
invalidate
();
//navihandler.forward("/frontpage?faces-redirect=true");
//navihandler.forward("/frontpage?faces-redirect=true");
if
(
onError
!=
null
)
{
logger
.
warn
(
"Redirecting to error"
,
onError
);
navihandler
.
forward
(
onError
);
}
}
catch
(
ServletException
e
)
{
}
catch
(
ServletException
e
)
{
logger
.
warn
(
"Error while trying to relogin as anonymous"
,
e
);
logger
.
warn
(
"Error while trying to relogin as anonymous"
,
e
);
}
}
...
@@ -195,7 +205,7 @@ public class AuthView extends GenericCDIView {
...
@@ -195,7 +205,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/login"
);
//
doLogin("/admin/adduser/login");
}
}
public
String
executeLoginAction
()
{
public
String
executeLoginAction
()
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment