edit.jsp 2.86 KB
Newer Older
Matija Obreza's avatar
Matija Obreza committed
1 2 3
<!DOCTYPE html>

<%@include file="/WEB-INF/jsp/init.jsp"%>
Matija Obreza's avatar
Matija Obreza committed
4
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
Matija Obreza's avatar
Matija Obreza committed
5 6 7

<html>
<head>
Matija Obreza's avatar
Matija Obreza committed
8
<title><spring:message code="userprofile.update.title" /></title>
Matija Obreza's avatar
Matija Obreza committed
9 10 11
</head>
<body>
	<h1>
Matija Obreza's avatar
Matija Obreza committed
12
		<spring:message code="userprofile.update.title" />
Matija Obreza's avatar
Matija Obreza committed
13 14
	</h1>

Aleksandr Sharaban's avatar
Aleksandr Sharaban committed
15 16 17
	<c:if test="${not empty emailError}">
		<div class="alert alert-danger">${emailError}</div>
	</c:if>
18
	<form role="form" class="form-horizontal validate" action="<c:url value="/profile/${user.uuid}/update" />" method="post">
Matija Obreza's avatar
Matija Obreza committed
19 20 21
		<div class="form-group">
			<label for="name" class="col-lg-2 control-label"><spring:message code="registration.full-name" /></label>
			<div class="col-lg-3">
Matija Obreza's avatar
Matija Obreza committed
22
				<form:input id="name" name="name" class="span3 form-control" path="user.name" />
Matija Obreza's avatar
Matija Obreza committed
23 24 25 26 27
			</div>
		</div>
		<div class="form-group">
			<label for="email" class="col-lg-2 control-label"><spring:message code="registration.email" /></label>
			<div class="col-lg-3">
Matija Obreza's avatar
Matija Obreza committed
28
				<form:input id="email" name="email" class="span3 form-control" path="user.email" />
Matija Obreza's avatar
Matija Obreza committed
29 30
			</div>
		</div>
Matija Obreza's avatar
Matija Obreza committed
31 32 33 34

		<div class="form-group">
			<label for="password" class="col-lg-2 control-label"><spring:message code="registration.password" /></label>
			<div class="col-lg-3">
35
				<input type="password" id="password" name="pwd1" class="span3 form-control" autocomplete="off" />
Matija Obreza's avatar
Matija Obreza committed
36 37 38 39 40
			</div>
		</div>
		<div class="form-group">
			<label for="confirm_password" class="col-lg-2 control-label"><spring:message code="registration.confirm-password" /></label>
			<div class="col-lg-3">
41
				<input type="password" id="confirm_password" name="pwd2" class="span3 required form-control" autocomplete="off" equalTo="#pwd1" />
Matija Obreza's avatar
Matija Obreza committed
42 43 44 45 46 47
			</div>
		</div>


		<div class="form-group">
			<div class="col-lg-offset-2 col-lg-10">
48
				<input type="submit" value="<spring:message code="save"/>" class="btn btn-primary" /> <a class="btn btn-default" href="<c:url value="/profile/${user.uuid}" />" class="btn"> <spring:message code="cancel" />
Matija Obreza's avatar
Matija Obreza committed
49 50 51
				</a>
			</div>
		</div>
Nick Martynenko's avatar
CSRF  
Nick Martynenko committed
52 53
        <!-- CSRF protection -->
        <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
Matija Obreza's avatar
Matija Obreza committed
54
	</form>
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
	
	<security:authorize access="hasRole('ADMINISTRATOR')">
	<h1>
		<spring:message code="user.roles" />
	</h1>
	<form role="form" class="form-horizontal validate" action="<c:url value="/profile/${user.uuid}/update-roles" />" method="post">
        <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
		<c:forEach items="${availableRoles}" var="role">
		<div class="form-group">
			<div class="col-lg-12">
				<label><input type="checkbox" name="role" value="${role}" ${user.hasRole(role) ? 'checked="true"' : ''} /> ${role}</label>
			</div>
		</div>
		</c:forEach>
		<div class="form-group">
			<div class="col-lg-offset-2 col-lg-10">
				<input type="submit" value="<spring:message code="save"/>" class="btn btn-primary" />
			</div>
		</div>
	</form>
	</security:authorize>
Matija Obreza's avatar
Matija Obreza committed
76 77
</body>
</html>