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

Added a "User registration" blurp

parent 8f20d675
...@@ -53,16 +53,19 @@ public class HtmlController extends BaseController { ...@@ -53,16 +53,19 @@ public class HtmlController extends BaseController {
@Autowired @Autowired
private UserService userService; private UserService userService;
@Autowired @Autowired
private CropService cropService; private CropService cropService;
@Autowired @Autowired
private ContentService activityPostService; private ContentService activityPostService;
@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,65 +4,81 @@ ...@@ -4,65 +4,81 @@
<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>
<c:if test="${param['error'] ne null}"> <%@include file="/WEB-INF/jsp/content/include/blurp-display.jsp"%>
<div class="alert alert-error"><spring:message code="sample.error.wrong.credentials"/></div>
</c:if>
<c:if test="${param['exist'] ne null}"> <c:if test="${param['error'] ne null}">
<div class="alert alert-error"><spring:message code="sample.error.user.exist"/></div> <div class="alert alert-error">
</c:if> <spring:message code="sample.error.wrong.credentials" />
<form method="POST" action="new-user.html" class="form-horizontal validate"> </div>
<div class="control-group"> </c:if>
<label for="email" class="control-label"><spring:message code="sample.message.email"/></label> <c:if test="${param['exist'] ne null}">
<div class="controls"> <div class="alert alert-error">
<input type="text" id="email" name="email" class="span3 required email" /> <spring:message code="sample.error.user.exist" />
</div> </div>
</div> </c:if>
<div class="control-group"> <form role="form" method="POST" action="new-user.html" class="form-horizontal validate">
<label for="password" class="control-label"><spring:message code="sample.message.password"/></label> <div class="form-group">
<div class="controls"> <label for="email" class="col-lg-2 control-label"><spring:message code="sample.message.email" /></label>
<input type="password" id="password" name="password" class="span3 required" /> <div class="col-lg-3">
</div> <input type="text" id="email" name="email" class="span3 required email form-control" />
</div> </div>
<div class="control-group"> </div>
<label for="confirm_password" class="control-label"><spring:message code="sample.message.confirm.password"/></label> <div class="form-group">
<div class="controls"> <label for="password" class="col-lg-2 control-label"><spring:message code="sample.message.password" /></label>
<input type="password" id="confirm_password" name="confirm_password" class="span3 required" equalTo="#password" /> <div class="col-lg-3">
</div> <input type="password" id="password" name="password" class="span3 required form-control" />
</div> </div>
<div class="control-group"> </div>
<label for="name" class="control-label"><spring:message code="sample.message.name"/></label> <div class="form-group">
<div class="controls"> <label for="confirm_password" class="col-lg-2 control-label"><spring:message code="sample.message.confirm.password" /></label>
<input type="text" id="name" name="name" class="span3 required" /> <div class="col-lg-3">
</div> <input type="password" id="confirm_password" name="confirm_password" class="span3 required form-control" equalTo="#password" />
</div> </div>
<div class="control-group"> </div>
<div class="controls"> <div class="form-group">
<script type="text/javascript" <label for="name" class="col-lg-2 control-label"><spring:message code="sample.message.name" /></label>
src="http://api.recaptcha.net/challenge?k=${captchaPublicKey}"> <div class="col-lg-3">
</script> <input type="text" id="name" name="name" class="span3 required form-control" />
<noscript> </div>
<iframe src="http://api.recaptcha.net/noscript?k=${captchaPublicKey}" </div>
height="300" width="500" frameborder="0"></iframe><br> <div class="form-group">
<textarea name="recaptcha_challenge_field" rows="3" cols="40"> <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> </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-group">
<div class="form-actions clearfix"> <div class="col-lg-offset-2 col-lg-10">
<input type="submit" value="<spring:message code="sample.message.registration"/>" class="btn btn-primary" /> <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 href="login_page" id="registration" class="btn">Back</a> </a>
</div> </div>
</form> </div>
</form>
</body> </body>
</html> </html>
\ No newline at end of file
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