Skip to content

Commit 2ebf9be

Browse files
committed
update ui
1 parent 5ab6b9e commit 2ebf9be

File tree

16 files changed

+342
-243
lines changed

16 files changed

+342
-243
lines changed
Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
11
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
22
<%@ taglib prefix="sec"
3-
uri="http://www.springframework.org/security/tags"%>
3+
uri="http://www.springframework.org/security/tags"%>
44
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
55
<html>
66

77
<head>
8-
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
8+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
99
<title><spring:message code="label.pages.home.title"></spring:message></title>
1010
</head>
1111
<body>
12-
<div class="container">
13-
<div class="span12">
14-
<sec:authorize ifNotGranted="WRITE_PRIVILEGE">
15-
<spring:message code="message.unauth"></spring:message>
16-
</sec:authorize>
17-
<sec:authorize ifAnyGranted="WRITE_PRIVILEGE">
18-
<H1>
19-
<spring:message code="label.pages.admin.message"></spring:message>
20-
</H1>
21-
</sec:authorize>
22-
<a href="<c:url value="/j_spring_security_logout" />"><spring:message
23-
code="label.pages.logout"></spring:message></a> <a
24-
href="<c:url value="/home.html" />"><spring:message
25-
code="label.pages.home.title"></spring:message></a>
26-
</div>
27-
</div>
12+
<nav class="navbar navbar-default">
13+
<div class="container-fluid">
14+
<div class="navbar-header">
15+
<a class="navbar-brand"href="<c:url value="/home.html" />"><spring:message code="label.pages.home.title"></spring:message></a>
16+
</div>
17+
<ul class="nav navbar-nav navbar-right">
18+
<li><a href="<c:url value="/j_spring_security_logout" />"><spring:message code="label.pages.logout"></spring:message></a> </li>
19+
</ul>
20+
</div>
21+
</nav>
22+
23+
<div class="container">
24+
<sec:authorize ifNotGranted="WRITE_PRIVILEGE">
25+
<spring:message code="message.unauth"></spring:message>
26+
</sec:authorize>
27+
<sec:authorize ifAnyGranted="WRITE_PRIVILEGE">
28+
<h1>
29+
<spring:message code="label.pages.admin.message"></spring:message>
30+
</h1>
31+
</sec:authorize>
32+
</div>
2833
</body>
29-
</html>
34+
</html>
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,37 @@
11
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
22
<%@ taglib prefix="sec"
3-
uri="http://www.springframework.org/security/tags"%>
3+
uri="http://www.springframework.org/security/tags"%>
44
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
55
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
66
<fmt:setBundle basename="messages" />
77
<%@ page session="true"%>
88
<html>
99
<head>
10-
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
11-
<title><spring:message
10+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
11+
<title><spring:message
1212
code="label.badUser.title"></spring:message></title>
1313
</head>
1414
<body>
15-
<h1>
16-
<div class="alert alert-error">
17-
${param.message}
15+
<div class="container">
16+
<h1 class="alert alert-danger">
17+
${param.message}
1818
</h1>
1919
<br>
20-
<a href="<c:url value="/registration.html" />"><spring:message
20+
<a class="btn btn-default" href="<c:url value="/registration.html" />"><spring:message
2121
code="label.form.loginSignUp"></spring:message></a>
2222

2323
<c:if test="${param.expired}">
2424
<br>
2525
<h1>${label.form.resendRegistrationToken}</h1>
2626
<button onclick="resendToken()">
27-
<spring:message code="label.form.resendRegistrationToken"></spring:message>
27+
<spring:message code="label.form.resendRegistrationToken"></spring:message>
2828
</button>
2929

30-
3130
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
3231
<script type="text/javascript">
3332
function resendToken(){
34-
$.get("<c:url value="/user/resendRegistrationToken"><c:param name="token" value="${param.token}"/></c:url>", function(data){
35-
window.location.href = "<c:url value="/login.html"></c:url>" + "?message=" + data.message;
33+
$.get("<c:url value="/user/resendRegistrationToken"><c:param name="token" value="${param.token}"/></c:url>", function(data){
34+
window.location.href = "<c:url value="/login.html"></c:url>" + "?message=" + data.message;
3635
})
3736
.fail(function(data) {
3837
if(data.responseJSON.error.indexOf("MailError") > -1)
@@ -50,5 +49,6 @@ $(document).ajaxStart(function() {
5049
});
5150
</script>
5251
</c:if>
52+
</div>
5353
</body>
5454
</html>
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<!DOCTYPE html>
2+
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
3+
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
4+
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
5+
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
6+
<%@ taglib prefix="sec"
7+
uri="http://www.springframework.org/security/tags"%>
8+
<%@ page session="false"%>
9+
<html>
10+
<head>
11+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
12+
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
13+
<title><spring:message code="message.changePassword"></spring:message></title>
14+
</head>
15+
<body>
16+
<nav class="navbar navbar-default">
17+
<div class="container-fluid">
18+
<div class="navbar-header">
19+
<a class="navbar-brand"href="#"><spring:message code="label.pages.home.title"></spring:message></a>
20+
</div>
21+
<ul class="nav navbar-nav navbar-right">
22+
<li><a href="<c:url value="/j_spring_security_logout" />"><spring:message code="label.pages.logout"></spring:message></a> </li>
23+
</ul>
24+
</div>
25+
</nav>
26+
<div class="container">
27+
<div class="row">
28+
<div id="errormsg" class="alert alert-danger" style="display:none"></div>
29+
<h1> <spring:message code="message.changePassword"></spring:message> </h1>
30+
<div >
31+
<br>
32+
33+
<label class="col-sm-2"><spring:message code="label.user.oldPassword"></spring:message></label>
34+
<span class="col-sm-5"><input class="form-control" id="oldpass" name="oldpassword" type="password" value="" /></span>
35+
<span class="col-sm-5"></span>
36+
<br><br>
37+
<label class="col-sm-2"><spring:message code="label.user.newPassword"></spring:message></label>
38+
<span class="col-sm-5"><input class="form-control" id="pass" name="password" type="password" value="" /></span>
39+
<span class="col-sm-5"></span>
40+
<br><br>
41+
<label class="col-sm-2"><spring:message code="label.user.confirmPass"></spring:message></label>
42+
<span class="col-sm-5"><input class="form-control" id="passConfirm" type="password" value="" /></span>
43+
<span id="error" class="alert alert-danger" style="display:none"><spring:message code="PasswordMatches.user"></spring:message></span>
44+
45+
<br><br>
46+
<button class="btn btn-primary" type="submit" onclick="savePass()">
47+
<spring:message code="message.changePassword"></spring:message>
48+
</button>
49+
</div>
50+
51+
</div>
52+
</div>
53+
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
54+
<script type="text/javascript">
55+
function savePass(){
56+
var pass = $("#pass").val();
57+
var valid = pass == $("#passConfirm").val();
58+
if(!valid) {
59+
$("#error").show();
60+
return;
61+
}
62+
$.post("<c:url value="/user/updatePassword"></c:url>",{password: pass, oldpassword: $("#oldpass").val()} ,function(data){
63+
window.location.href = "<c:url value="/console.html"></c:url>" + "?message="+data.message;
64+
})
65+
.fail(function(data) {
66+
$("#errormsg").show().html(data.responseJSON.message);
67+
});
68+
}
69+
</script>
70+
</body>
71+
72+
</html>
Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,42 @@
11
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
22
<%@ taglib prefix="sec"
3-
uri="http://www.springframework.org/security/tags"%>
3+
uri="http://www.springframework.org/security/tags"%>
44
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
55
<html>
66
<head>
7-
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
7+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
88
</head>
99
<body>
10-
<div class="container">
11-
<div class="span12">
12-
<h1>This is the landing page for the admin</h1>
13-
<sec:authorize access="hasRole('READ_PRIVILEGE')">
14-
This text is only visible to a user
15-
<br />
16-
</sec:authorize>
17-
<sec:authorize access="hasRole('WRITE_PRIVILEGE')">
18-
This text is only visible to an admin
19-
<br />
20-
</sec:authorize>
21-
<a href="<c:url value="/j_spring_security_logout" />"><spring:message
22-
code="label.pages.logout"></spring:message></a> <a
23-
href="<c:url value="/admin.html" />"><spring:message
24-
code="label.pages.admin"></spring:message></a>
25-
</div>
26-
</div>
10+
<nav class="navbar navbar-default">
11+
<div class="container-fluid">
12+
<div class="navbar-header">
13+
<a class="navbar-brand"href="<c:url value="/home.html" />"><spring:message code="label.pages.home.title"></spring:message></a>
14+
</div>
15+
<ul class="nav navbar-nav navbar-right">
16+
<li><a href="<c:url value="/j_spring_security_logout" />"><spring:message code="label.pages.logout"></spring:message></a> </li>
17+
</ul>
18+
</div>
19+
</nav>
20+
21+
<div class="container">
22+
<c:if test="${param.message != null}">
23+
<div class="alert alert-info">
24+
${param.message}
25+
</div>
26+
</c:if>
27+
<h1>This is the landing page for the admin</h1>
28+
<sec:authorize access="hasRole('READ_PRIVILEGE')">
29+
This text is only visible to a user
30+
<br />
31+
</sec:authorize>
32+
<sec:authorize access="hasRole('WRITE_PRIVILEGE')">
33+
This text is only visible to an admin
34+
<br />
35+
</sec:authorize>
36+
<a class="btn btn-default" href="<c:url value="/changePassword.html" />"><spring:message code="message.changePassword"></spring:message></a>
37+
38+
<a class="btn btn-default" href="<c:url value="/admin.html" />"><spring:message code="label.pages.admin"></spring:message></a>
39+
</div>
2740
</body>
2841

2942
</html>

spring-security-login-and-registration/src/main/webapp/WEB-INF/view/emailError.jsp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@
22
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
33
<html>
44
<head>
5-
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
5+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
66
<title><spring:message code="label.pages.home.title"></spring:message></title>
77
</head>
88
<body>
9-
<div class="container">
10-
<div class="span12">
11-
<h1 class="alert alert-error">
12-
<spring:message code="message.email.config.error"></spring:message>
13-
</h1>
14-
15-
</div>
16-
</div>
9+
<div class="container">
10+
<h1 class="alert alert-danger">
11+
<spring:message code="message.email.config.error"></spring:message>
12+
</h1>
13+
14+
</div>
1715
</body>
1816

19-
</html>
17+
</html>
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
22
<%@ taglib prefix="sec"
3-
uri="http://www.springframework.org/security/tags"%>
3+
uri="http://www.springframework.org/security/tags"%>
44
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
55
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
66
<fmt:setBundle basename="messages" />
77
<%@ page session="true"%>
88

99
<html>
1010
<head>
11-
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
12-
<title><spring:message code="label.pages.home.title"></spring:message></title>
11+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
12+
<title><spring:message code="label.pages.home.title"></spring:message></title>
1313
</head>
1414
<body>
15-
<h1>
15+
<div class="container">
16+
<h1 class="alert alert-info">
1617
<spring:message code="auth.message.expired"></spring:message>
1718
</h1>
1819
<br>
19-
<a href="<c:url value="/registration.html" />"><spring:message
20+
<a class="btn btn-default" href="<c:url value="registration.html" />"><spring:message
2021
code="label.form.loginSignUp"></spring:message></a>
21-
22+
</div>
2223
</body>
2324
</html>

spring-security-login-and-registration/src/main/webapp/WEB-INF/view/forgetPassword.jsp

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,30 @@
44
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
55
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
66
<%@ taglib prefix="sec"
7-
uri="http://www.springframework.org/security/tags"%>
7+
uri="http://www.springframework.org/security/tags"%>
88
<%@ page session="false"%>
99
<html>
1010
<head>
11-
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
11+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
1212
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
1313
<title><spring:message code="message.resetPassword"></spring:message></title>
1414
</head>
1515
<body>
1616
<div class="container">
17-
<div class="span12">
18-
<h1>
19-
<spring:message code="message.resetPassword"></spring:message>
20-
</h1>
21-
<div>
22-
<br>
23-
24-
<tr>
25-
<td><label><spring:message code="label.user.email"></spring:message></label></td>
26-
<td><input id="email" name="email" type="email" value="" /></td>
27-
</tr>
28-
29-
<button class="btn btn-primary" type="submit" onclick="resetPass()">
30-
<spring:message code="message.resetPassword"></spring:message>
31-
</button>
17+
<h1><spring:message code="message.resetPassword"></spring:message></h1>
18+
<br>
19+
<div class="row">
20+
<label class="col-sm-1"><spring:message code="label.user.email"></spring:message></label>
21+
<span class="col-sm-5"><input class="form-control" id="email" name="email" type="email" value="" /></span>
22+
<button class="btn btn-primary" type="submit" onclick="resetPass()"><spring:message code="message.resetPassword"></spring:message></button>
3223
</div>
3324

3425
<br>
35-
<a href="<c:url value="/registration.html" />"><spring:message code="label.form.loginSignUp"></spring:message></a>
36-
<br>
37-
<a href="<c:url value="login.html" />"><spring:message code="label.form.loginLink"></spring:message></a>
26+
<a class="btn btn-default" href="<c:url value="registration.html" />"><spring:message code="label.form.loginSignUp"></spring:message></a>
27+
<br><br>
28+
<a class="btn btn-default" href="<c:url value="login.html" />"><spring:message code="label.form.loginLink"></spring:message></a>
3829

3930
</div>
40-
</div>
41-
4231
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
4332
<script type="text/javascript">
4433
function resetPass(){

spring-security-login-and-registration/src/main/webapp/WEB-INF/view/home.jsp

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,26 @@
44
<html>
55

66
<head>
7-
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
7+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
88
<title><spring:message code="label.pages.home.title"></spring:message></title>
99
</head>
1010
<body>
11-
<div class="container">
12-
<div class="span12">
13-
<h1>
14-
<spring:message code="label.pages.home.message"></spring:message>
15-
</h1>
16-
<a href="<c:url value="/j_spring_security_logout" />"><spring:message
17-
code="label.pages.logout"></spring:message></a>
18-
</div>
19-
</div>
11+
<nav class="navbar navbar-default">
12+
<div class="container-fluid">
13+
<div class="navbar-header">
14+
<a class="navbar-brand"href="#"><spring:message code="label.pages.home.title"></spring:message></a>
15+
</div>
16+
<ul class="nav navbar-nav navbar-right">
17+
<li><a href="<c:url value="/j_spring_security_logout" />"><spring:message code="label.pages.logout"></spring:message></a> </li>
18+
</ul>
19+
</div>
20+
</nav>
21+
<div class="container">
22+
<h1>
23+
<spring:message code="label.pages.home.message"></spring:message>
24+
</h1>
25+
</div>
2026
</body>
2127

2228
</html>
29+

0 commit comments

Comments
 (0)