Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
0130deb2
Commit
0130deb2
authored
Oct 03, 2013
by
Matija Obreza
Browse files
Added a "User registration" blurp
parent
8f20d675
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/servlet/controller/HtmlController.java
View file @
0130deb2
...
...
@@ -53,16 +53,19 @@ public class HtmlController extends BaseController {
@Autowired
private
UserService
userService
;
@Autowired
private
CropService
cropService
;
@Autowired
private
ContentService
activityPostService
;
@Autowired
private
Validator
validator
;
@Autowired
private
ContentService
contentService
;
@Value
(
"${captcha.privateKey}"
)
private
String
captchaPrivateKey
;
...
...
@@ -92,6 +95,7 @@ public class HtmlController extends BaseController {
@RequestMapping
(
value
=
"registration"
)
public
String
registration
(
ModelMap
model
)
{
model
.
addAttribute
(
"captchaPublicKey"
,
captchaPublicKey
);
model
.
addAttribute
(
"blurp"
,
contentService
.
getGlobalArticle
(
"registration"
,
getLocale
()));
return
"/registration"
;
}
...
...
src/main/resources/content/language.properties
View file @
0130deb2
...
...
@@ -58,7 +58,9 @@ sample.js.error.delete=Error while deleting item!
sample.js.error.retrieve
=
Error while retrieving item!
sample.js.error.update
=
Error while removing item!
sample.message.confirm.password
=
Confirm Password
sample.message.registration
=
Registration
registration.page.title
=
Create a user account
registration.create-account
=
Create account
captcha.text
=
Captcha text
sample.message.email
=
E-mail
sample.message.user.group
=
User Group
sample.message.user.groups
=
User Groups
...
...
src/main/webapp/WEB-INF/jsp/registration.jsp
View file @
0130deb2
...
...
@@ -4,65 +4,81 @@
<html>
<head>
<title><spring:message
code=
"
sample.message.registration"
/></title>
<%@include
file=
"head-init.jsp"
%>
<title><spring:message
code=
"
registration.page.title"
/></title>
<%@include
file=
"head-init.jsp"
%>
<script
type=
"text/javascript"
src=
"/html/js/login.js"
></script>
<script
type=
"text/javascript"
src=
"/html/js/login.js"
></script>
</head>
<body>
<h1><spring:message
code=
"sample.message.registration"
/></h1>
<h1>
<spring:message
code=
"sample.message.registration"
/>
</h1>
<security:authorize
access=
"hasRole('ADMINISTRATOR')"
>
<a
href=
"
<c:url
value=
"/content/registration/edit"
/>
"
class=
"close"
>
<spring:message
code=
"edit"
/>
</a>
</security:authorize>
<c:if
test=
"
${
param
[
'error'
]
ne
null
}
"
>
<div
class=
"alert alert-error"
><spring:message
code=
"sample.error.wrong.credentials"
/></div>
</c:if>
<c:if
test=
"
${
param
[
'exist'
]
ne
null
}
"
>
<div
class=
"alert alert-error"
><spring:message
code=
"sample.error.user.exist"
/></div>
</c:if>
<form
method=
"POST"
action=
"new-user.html"
class=
"form-horizontal validate"
>
<div
class=
"control-group"
>
<label
for=
"email"
class=
"control-label"
><spring:message
code=
"sample.message.email"
/></label>
<div
class=
"controls"
>
<input
type=
"text"
id=
"email"
name=
"email"
class=
"span3 required email"
/>
</div>
</div>
<div
class=
"control-group"
>
<label
for=
"password"
class=
"control-label"
><spring:message
code=
"sample.message.password"
/></label>
<div
class=
"controls"
>
<input
type=
"password"
id=
"password"
name=
"password"
class=
"span3 required"
/>
</div>
</div>
<div
class=
"control-group"
>
<label
for=
"confirm_password"
class=
"control-label"
><spring:message
code=
"sample.message.confirm.password"
/></label>
<div
class=
"controls"
>
<input
type=
"password"
id=
"confirm_password"
name=
"confirm_password"
class=
"span3 required"
equalTo=
"#password"
/>
</div>
</div>
<div
class=
"control-group"
>
<label
for=
"name"
class=
"control-label"
><spring:message
code=
"sample.message.name"
/></label>
<div
class=
"controls"
>
<input
type=
"text"
id=
"name"
name=
"name"
class=
"span3 required"
/>
</div>
</div>
<div
class=
"control-group"
>
<div
class=
"controls"
>
<script
type=
"text/javascript"
src=
"http://api.recaptcha.net/challenge?k=${captchaPublicKey}"
>
</script>
<noscript>
<iframe
src=
"http://api.recaptcha.net/noscript?k=${captchaPublicKey}"
height=
"300"
width=
"500"
frameborder=
"0"
></iframe><br>
<textarea
name=
"recaptcha_challenge_field"
rows=
"3"
cols=
"40"
>
<%@include
file=
"/WEB-INF/jsp/content/include/blurp-display.jsp"
%>
<c:if
test=
"
${
param
[
'error'
]
ne
null
}
"
>
<div
class=
"alert alert-error"
>
<spring:message
code=
"sample.error.wrong.credentials"
/>
</div>
</c:if>
<c:if
test=
"
${
param
[
'exist'
]
ne
null
}
"
>
<div
class=
"alert alert-error"
>
<spring:message
code=
"sample.error.user.exist"
/>
</div>
</c:if>
<form
role=
"form"
method=
"POST"
action=
"new-user.html"
class=
"form-horizontal validate"
>
<div
class=
"form-group"
>
<label
for=
"email"
class=
"col-lg-2 control-label"
><spring:message
code=
"sample.message.email"
/></label>
<div
class=
"col-lg-3"
>
<input
type=
"text"
id=
"email"
name=
"email"
class=
"span3 required email form-control"
/>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"password"
class=
"col-lg-2 control-label"
><spring:message
code=
"sample.message.password"
/></label>
<div
class=
"col-lg-3"
>
<input
type=
"password"
id=
"password"
name=
"password"
class=
"span3 required form-control"
/>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"confirm_password"
class=
"col-lg-2 control-label"
><spring:message
code=
"sample.message.confirm.password"
/></label>
<div
class=
"col-lg-3"
>
<input
type=
"password"
id=
"confirm_password"
name=
"confirm_password"
class=
"span3 required form-control"
equalTo=
"#password"
/>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"name"
class=
"col-lg-2 control-label"
><spring:message
code=
"sample.message.name"
/></label>
<div
class=
"col-lg-3"
>
<input
type=
"text"
id=
"name"
name=
"name"
class=
"span3 required form-control"
/>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-lg-2 control-label"
><spring:message
code=
"captcha.text"
/></label>
<div
class=
"col-lg-3"
>
<script
type=
"text/javascript"
src=
"http://api.recaptcha.net/challenge?k=${captchaPublicKey}"
>
</script>
<noscript>
<iframe
src=
"http://api.recaptcha.net/noscript?k=${captchaPublicKey}"
height=
"300"
width=
"500"
frameborder=
"0"
></iframe>
<br>
<textarea
name=
"recaptcha_challenge_field"
rows=
"3"
cols=
"40"
>
</textarea>
<input
type=
"hidden"
name=
"recaptcha_response_field"
value=
"manual_challenge"
>
</noscript>
</div>
</div>
<div
class=
"form-actions clearfix"
>
<input
type=
"submit"
value=
"
<spring:message
code=
"sample.message.registration"
/>
"
class=
"btn btn-primary"
/>
<a
href=
"login_page"
id=
"registration"
class=
"btn"
>
Back
</a>
</div>
</form>
<input
type=
"hidden"
name=
"recaptcha_response_field"
value=
"manual_challenge"
>
</noscript>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"col-lg-offset-2 col-lg-10"
>
<input
type=
"submit"
value=
"
<spring:message
code=
"registration.create-account"
/>
"
class=
"btn btn-primary"
/>
<a
class=
"btn btn-default"
href=
"
<c:url
value=
"/"
/>
"
id=
"registration"
class=
"btn"
>
<spring:message
code=
"cancel"
/>
</a>
</div>
</div>
</form>
</body>
</html>
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
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 comment