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 {
@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";
}
......
......@@ -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
......
......@@ -4,63 +4,79 @@
<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>
<%@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>
<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>
<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" />
<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="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 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="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 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="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 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="control-group">
<div class="controls">
<script type="text/javascript"
src="http://api.recaptcha.net/challenge?k=${captchaPublicKey}">
<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>
<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">
<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 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>
......
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