Commit 0130deb2 authored by Matija Obreza's avatar Matija Obreza
Browse files

Added a "User registration" blurp

parent 8f20d675
...@@ -63,6 +63,9 @@ public class HtmlController extends BaseController { ...@@ -63,6 +63,9 @@ public class HtmlController extends BaseController {
@Autowired @Autowired
private Validator validator; private Validator validator;
@Autowired
private ContentService contentService;
@Value("${captcha.privateKey}") @Value("${captcha.privateKey}")
private String captchaPrivateKey; private String captchaPrivateKey;
...@@ -92,6 +95,7 @@ public class HtmlController extends BaseController { ...@@ -92,6 +95,7 @@ public class HtmlController extends BaseController {
@RequestMapping(value = "registration") @RequestMapping(value = "registration")
public String registration(ModelMap model) { public String registration(ModelMap model) {
model.addAttribute("captchaPublicKey", captchaPublicKey); model.addAttribute("captchaPublicKey", captchaPublicKey);
model.addAttribute("blurp", contentService.getGlobalArticle("registration", getLocale()));
return "/registration"; return "/registration";
} }
......
...@@ -58,7 +58,9 @@ sample.js.error.delete=Error while deleting item! ...@@ -58,7 +58,9 @@ sample.js.error.delete=Error while deleting item!
sample.js.error.retrieve=Error while retrieving item! sample.js.error.retrieve=Error while retrieving item!
sample.js.error.update=Error while removing item! sample.js.error.update=Error while removing item!
sample.message.confirm.password=Confirm Password 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.email=E-mail
sample.message.user.group=User Group sample.message.user.group=User Group
sample.message.user.groups=User Groups sample.message.user.groups=User Groups
......
...@@ -4,63 +4,79 @@ ...@@ -4,63 +4,79 @@
<html> <html>
<head> <head>
<title><spring:message code="sample.message.registration"/></title> <title><spring:message code="registration.page.title" /></title>
<%@include file="head-init.jsp"%> <%@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> </head>
<body> <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>
<%@include file="/WEB-INF/jsp/content/include/blurp-display.jsp"%>
<c:if test="${param['error'] ne null}"> <c:if test="${param['error'] ne null}">
<div class="alert alert-error"><spring:message code="sample.error.wrong.credentials"/></div> <div class="alert alert-error">
<spring:message code="sample.error.wrong.credentials" />
</div>
</c:if> </c:if>
<c:if test="${param['exist'] ne null}"> <c:if test="${param['exist'] ne null}">
<div class="alert alert-error"><spring:message code="sample.error.user.exist"/></div> <div class="alert alert-error">
<spring:message code="sample.error.user.exist" />
</div>
</c:if> </c:if>
<form method="POST" action="new-user.html" class="form-horizontal validate"> <form role="form" method="POST" action="new-user.html" class="form-horizontal validate">
<div class="control-group"> <div class="form-group">
<label for="email" class="control-label"><spring:message code="sample.message.email"/></label> <label for="email" class="col-lg-2 control-label"><spring:message code="sample.message.email" /></label>
<div class="controls"> <div class="col-lg-3">
<input type="text" id="email" name="email" class="span3 required email" /> <input type="text" id="email" name="email" class="span3 required email form-control" />
</div> </div>
</div> </div>
<div class="control-group"> <div class="form-group">
<label for="password" class="control-label"><spring:message code="sample.message.password"/></label> <label for="password" class="col-lg-2 control-label"><spring:message code="sample.message.password" /></label>
<div class="controls"> <div class="col-lg-3">
<input type="password" id="password" name="password" class="span3 required" /> <input type="password" id="password" name="password" class="span3 required form-control" />
</div> </div>
</div> </div>
<div class="control-group"> <div class="form-group">
<label for="confirm_password" class="control-label"><spring:message code="sample.message.confirm.password"/></label> <label for="confirm_password" class="col-lg-2 control-label"><spring:message code="sample.message.confirm.password" /></label>
<div class="controls"> <div class="col-lg-3">
<input type="password" id="confirm_password" name="confirm_password" class="span3 required" equalTo="#password" /> <input type="password" id="confirm_password" name="confirm_password" class="span3 required form-control" equalTo="#password" />
</div> </div>
</div> </div>
<div class="control-group"> <div class="form-group">
<label for="name" class="control-label"><spring:message code="sample.message.name"/></label> <label for="name" class="col-lg-2 control-label"><spring:message code="sample.message.name" /></label>
<div class="controls"> <div class="col-lg-3">
<input type="text" id="name" name="name" class="span3 required" /> <input type="text" id="name" name="name" class="span3 required form-control" />
</div> </div>
</div> </div>
<div class="control-group"> <div class="form-group">
<div class="controls"> <label class="col-lg-2 control-label"><spring:message code="captcha.text" /></label>
<script type="text/javascript" <div class="col-lg-3">
src="http://api.recaptcha.net/challenge?k=${captchaPublicKey}"> <script type="text/javascript" src="http://api.recaptcha.net/challenge?k=${captchaPublicKey}">
</script> </script>
<noscript> <noscript>
<iframe src="http://api.recaptcha.net/noscript?k=${captchaPublicKey}" <iframe src="http://api.recaptcha.net/noscript?k=${captchaPublicKey}" height="300" width="500" frameborder="0"></iframe>
height="300" width="500" frameborder="0"></iframe><br> <br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"> <textarea name="recaptcha_challenge_field" rows="3" cols="40">
</textarea> </textarea>
<input type="hidden" name="recaptcha_response_field" <input type="hidden" name="recaptcha_response_field" value="manual_challenge">
value="manual_challenge">
</noscript> </noscript>
</div> </div>
</div> </div>
<div class="form-actions clearfix"> <div class="form-group">
<input type="submit" value="<spring:message code="sample.message.registration"/>" class="btn btn-primary" /> <div class="col-lg-offset-2 col-lg-10">
<a href="login_page" id="registration" class="btn">Back</a> <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> </div>
</form> </form>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment