Skip to content

Commit 2da6c3c

Browse files
committed
Beginnings of a Bootstrap rewrite of the Roller editor/admin UI, using Struts-Bootstrap plugin.
The main menu and edit weblog page are essentially complete.
1 parent 624ad3b commit 2da6c3c

31 files changed

+11081
-1529
lines changed

app/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,12 @@
261261
<version>2.3.16.3</version>
262262
</dependency>
263263

264+
<dependency>
265+
<groupId>com.jgeppert.struts2.bootstrap</groupId>
266+
<artifactId>struts2-bootstrap-plugin</artifactId>
267+
<version>2.0.3</version>
268+
</dependency>
269+
264270
<dependency>
265271
<groupId>xml-security</groupId>
266272
<artifactId>xmlsec</artifactId>

app/src/main/resources/ApplicationResources.properties

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -640,9 +640,9 @@ issued during the upgrade process:
640640
# ----------------------------------------------------------------------- Login
641641

642642
loginPage.title=Welcome to Roller
643-
loginPage.prompt=Please enter your username and password to login.
644-
loginPage.openIdPrompt=Please login via OpenID
645-
loginPage.openIdHybridPrompt=Or, login with your username and password
643+
loginPage.prompt=Please login
644+
loginPage.openIdPrompt=Login with OpenID
645+
loginPage.openIdHybridPrompt=Or with username
646646
loginPage.userName=Username
647647
loginPage.password=Password
648648
loginPage.openID=OpenID username
@@ -707,8 +707,8 @@ macro.weblog.noEntriesForCategory=No entries found for specified category
707707
mainPage.category=Category
708708
mainPage.searchWeblogs=Search for blogs
709709
mainPage.actions=Actions
710-
mainPage.loggedInAs=logged in as
711-
mainPage.currentWebsite=editing weblog
710+
mainPage.loggedInAs=Logged in as
711+
mainPage.currentWebsite=Editing weblog
712712
mainPage.mainMenu=Main Menu
713713

714714
# ------------------------------------------------------------------ Maintenance
@@ -1493,7 +1493,7 @@ weblogEdit.publishedEntries=Recent Entries
14931493
weblogEdit.post=Post to Weblog
14941494
weblogEdit.permaLink=Permalink
14951495
weblogEdit.published=Published
1496-
weblogEdit.pubTime=Pub&nbsp;Time&nbsp;
1496+
weblogEdit.pubTime=Publishing Time
14971497
weblogEdit.save=Save as Draft
14981498
weblogEdit.scheduled=Scheduled
14991499
weblogEdit.scheduledEntries=Scheduled Entries
@@ -1749,19 +1749,20 @@ activate your user account by clicking the link that is sent to you via e-mail.
17491749

17501750
# ---------------------------------------------------------------- Your Weblogs
17511751

1752-
yourWebsites.title=Main Menu
1753-
yourWebsites.actions=Actions
1752+
yourWebsites.title=Your Weblogs
1753+
yourWebsites.actions=Actions
17541754

1755-
yourWebsites.prompt.noBlog=You''ve got a user account, but no weblog. \
1755+
yourWebsites.prompt.noBlog=You have a user account, but no weblog. \
17561756
Would you like to
17571757
yourWebsites.createOne=create one?
17581758

1759-
yourWebsites.prompt.hasBlog=Select a weblog to edit, manage, or configure.
1759+
yourWebsites.prompt.hasBlog=Access your weblogs here or create a new one.
17601760

17611761
yourWebsites.accept=accept
17621762
yourWebsites.decline=decline
17631763

17641764
yourWebsites.resign=Resign
1765+
yourWebsites.youHave=You have
17651766
yourWebsites.permission=Permission
17661767
yourWebsites.confirmResignation=Are you sure you wish to resign from weblog [{0}]?
17671768
yourWebsites.weblog=Link

app/src/main/webapp/WEB-INF/jsps/core/Login.jsp

Lines changed: 105 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -18,150 +18,130 @@
1818

1919
<%-- Body of the login page, invoked from login.jsp --%>
2020
<%@ page import="org.apache.roller.weblogger.config.WebloggerConfig" %>
21-
<%@ page import="org.apache.roller.weblogger.config.AuthMethod" %>
2221
<%@ include file="/WEB-INF/jsps/taglibs-struts2.jsp" %>
2322

2423
<%!
25-
String securityCheckUrl = null;
26-
boolean cmaEnabled = "CMA".equals(WebloggerConfig.getAuthMethod());
24+
String securityCheckUrl = null;
25+
boolean cmaEnabled = "CMA".equals( WebloggerConfig.getAuthMethod() );
2726
%>
2827

2928
<%
30-
if (cmaEnabled) {
31-
securityCheckUrl = "/j_security_check";
32-
} else {
33-
securityCheckUrl = "/roller_j_security_check";
34-
}
29+
if (cmaEnabled) {
30+
securityCheckUrl = "/j_security_check";
31+
} else {
32+
securityCheckUrl = "/roller_j_security_check";
33+
}
3534
%>
3635

37-
<s:if test="authMethod == 'OPENID' || authMethod == 'DB_OPENID'">
38-
39-
<p><s:text name="loginPage.openIdPrompt" /></p>
40-
41-
<form method="post" id="loginOpenIDForm"
42-
action="/roller/roller_j_openid_security_check"
43-
onsubmit="saveOpenidIdentifier(this)">
44-
<!-- action="<c:url value='roller_j_openid_security_check'/>" -->
45-
<table width="80%">
46-
<tr>
47-
<td width="20%" align="right"><s:text name="loginPage.openID" /></td>
48-
<td width="80%">
49-
<input type="text" name="openid_identifier" id="openid_identifier" class="f_openid_identifier" size="40" maxlength="255" style="width: 35%"/>
50-
</td>
51-
</tr>
52-
<tr>
53-
<td width="20%"></td>
54-
<td width="80%">
55-
<input type="submit" name="submit" id="submit" value="<s:text name='loginPage.loginOpenID'/>" />
56-
</td>
57-
</tr>
58-
</table>
59-
</form>
60-
</s:if>
61-
62-
<s:if test="authMethod != 'OPENID'">
63-
64-
<s:if test="authMethod == 'DB_OPENID'">
65-
<p><s:text name="loginPage.openIdHybridPrompt" /></p>
36+
<div class="container">
37+
38+
<s:if test="authMethod == 'OPENID' || authMethod == 'DB_OPENID'">
39+
40+
<form method="post" id="loginOpenIDForm" class="form-signin"
41+
action="/roller/roller_j_openid_security_check" onsubmit="saveOpenidIdentifier(this)">
42+
43+
<h2 class="form-signin-heading"><s:text name="loginPage.openIdPrompt"/></h2>
44+
45+
<label for="openid_identifier" class="sr-only"><s:text name="loginPage.openID"/></label>
46+
<input class="form-control" type="text" name="openid_identifier" id="openid_identifier"/>
47+
48+
<button type="submit" name="submit" id="submit" class="btn btn-lg btn-primary btn-block"
49+
value="<s:text name='loginPage.loginOpenID'/>"></button>
50+
51+
</form>
52+
6653
</s:if>
67-
68-
<s:else>
69-
<p><s:text name="loginPage.prompt" /></p>
70-
</s:else>
71-
72-
<form method="post" id="loginForm"
73-
action="<c:url value="<%= securityCheckUrl %>"/>"
74-
onsubmit="saveUsername(this)">
75-
76-
<table width="80%">
77-
78-
<tr>
79-
<td width="20%" align="right"><s:text name="loginPage.userName" /></td>
80-
<td width="80%">
81-
<input type="text" name="j_username" id="j_username" size="25" />
82-
</td>
83-
</tr>
84-
85-
<tr>
86-
<td width="20%" align="right"><s:text name="loginPage.password" /></td>
87-
<td width="80%">
88-
<input type="password" name="j_password" id="j_password" size="20" />
89-
</td>
90-
</tr>
54+
55+
<s:if test="authMethod != 'OPENID'">
56+
57+
58+
<form method="post" id="loginForm" class="form-signin"
59+
action="<c:url value="<%= securityCheckUrl %>"/>"
60+
onsubmit="saveUsername(this)">
61+
62+
<s:if test="authMethod == 'DB_OPENID'">
63+
<h2 class="form-signin-heading"><s:text name="loginPage.openIdHybridPrompt"/></h2>
64+
</s:if>
65+
66+
<s:else>
67+
<h2 class="form-signin-heading"><s:text name="loginPage.prompt"/></h2>
68+
</s:else>
69+
70+
<label for="j_username" class="sr-only"> <s:text name="loginPage.userName"/> </label>
71+
<input type="text" class="form-control" name="j_username" id="j_username" placeholder="Username"/>
72+
73+
<label for="j_password" class="sr-only"> <s:text name="loginPage.password"/> </label>
74+
<input type="password" class="form-control" name="j_password" id="j_password" placeholder="Password"/>
9175

9276
<c:if test="${rememberMeEnabled}">
93-
<tr>
94-
<td width="20%"></td>
95-
<td width="80%">
96-
<input type="checkbox" name="_spring_security_remember_me" id="_spring_security_remember_me" />
97-
<label for="rememberMe">
98-
<s:text name="loginPage.rememberMe" />
99-
</label>
100-
</td>
101-
</tr>
77+
<label>
78+
<input type="checkbox" name="_spring_security_remember_me" id="_spring_security_remember_me"/>
79+
<s:text name="loginPage.rememberMe"/>
80+
</label>
10281
</c:if>
10382

104-
<tr>
105-
<td width="20%"></td>
106-
<td width="80%">
107-
<input type="submit" name="login" id="login" value="<s:text name='loginPage.login' />" />
108-
<input type="reset" name="reset" id="reset" value="<s:text name='loginPage.reset' />"
109-
onclick="document.getElementById('j_username').focus()" />
110-
</td>
111-
</tr>
83+
<button class="btn btn-lg btn-primary btn-block" type="submit" name="login" id="login">
84+
<s:text name='loginPage.login'/>
85+
</button>
11286

113-
</table>
114-
</form>
115-
</s:if>
87+
<button class="btn btn-lg btn-primary btn-block" type="reset" name="reset" id="reset"
88+
onclick="document.getElementById('j_username').focus()">
89+
<s:text name='loginPage.reset'/>
90+
</button>
91+
92+
</form>
93+
</s:if>
94+
95+
</div>
11696

11797
<script>
118-
<s:if test="authMethod == 'OPENID' || authMethod == 'DB_OPENID'">
119-
function focusToOpenidForm() {
120-
return (document.getElementById && document.getElementById("j_username") === null) ||
121-
getCookie("favorite_authentication_method") !== "username";
122-
}
123-
124-
if (document.getElementById) {
125-
if (document.getElementById && getCookie("openid_identifier") !== null) {
126-
document.getElementById("openid_identifier").value = getCookie("openid_identifier");
98+
<s:if test="authMethod == 'OPENID' || authMethod == 'DB_OPENID'">
99+
function focusToOpenidForm() {
100+
return (document.getElementById && document.getElementById("j_username") === null) ||
101+
getCookie("favorite_authentication_method") !== "username";
102+
}
103+
104+
if (document.getElementById) {
105+
if (document.getElementById && getCookie("openid_identifier") !== null) {
106+
document.getElementById("openid_identifier").value = getCookie("openid_identifier");
107+
}
108+
if (focusToOpenidForm()) {
109+
document.getElementById("openid_identifier").focus();
110+
}
127111
}
128-
if (focusToOpenidForm()) {
129-
document.getElementById("openid_identifier").focus();
112+
113+
function saveOpenidIdentifier(theForm) {
114+
var expires = new Date();
115+
expires.setTime(expires.getTime() + 24 * 30 * 60 * 60 * 1000); // sets it for approx 30 days.
116+
setCookie("openid_identifier", theForm.openid_identifier.value, expires);
117+
setCookie("favorite_authentication_method", "openid");
130118
}
131-
}
132-
133-
function saveOpenidIdentifier(theForm) {
134-
var expires = new Date();
135-
expires.setTime(expires.getTime() + 24 * 30 * 60 * 60 * 1000); // sets it for approx 30 days.
136-
setCookie("openid_identifier",theForm.openid_identifier.value,expires);
137-
setCookie("favorite_authentication_method", "openid");
138-
}
139-
</s:if>
140-
141-
<s:if test="authMethod != 'OPENID'">
142-
function focusToUsernamePasswordForm() {
143-
return (document.getElementById && document.getElementById("openid_identifier") === null) ||
144-
getCookie("favorite_authentication_method") === "username";
145-
}
146-
147-
if (document.getElementById) {
148-
if (getCookie("username") != null) {
149-
if (document.getElementById) {
150-
document.getElementById("j_username").value = getCookie("username");
151-
if (focusToUsernamePasswordForm()) {
152-
document.getElementById("j_password").focus();
119+
</s:if>
120+
121+
<s:if test="authMethod != 'OPENID'">
122+
function focusToUsernamePasswordForm() {
123+
return (document.getElementById && document.getElementById("openid_identifier") === null) ||
124+
getCookie("favorite_authentication_method") === "username";
125+
}
126+
127+
if (document.getElementById) {
128+
if (getCookie("username") != null) {
129+
if (document.getElementById) {
130+
document.getElementById("j_username").value = getCookie("username");
131+
if (focusToUsernamePasswordForm()) {
132+
document.getElementById("j_password").focus();
133+
}
153134
}
135+
} else if (focusToUsernamePasswordForm()) {
136+
document.getElementById("j_username").focus();
154137
}
155-
} else if (focusToUsernamePasswordForm()) {
156-
document.getElementById("j_username").focus();
157138
}
158-
}
159-
160-
function saveUsername(theForm) {
161-
var expires = new Date();
162-
expires.setTime(expires.getTime() + 24 * 30 * 60 * 60 * 1000); // sets it for approx 30 days.
163-
setCookie("username",theForm.j_username.value,expires);
164-
setCookie("favorite_authentication_method", "username");
165-
}
166-
</s:if>
139+
140+
function saveUsername(theForm) {
141+
var expires = new Date();
142+
expires.setTime(expires.getTime() + 24 * 30 * 60 * 60 * 1000); // sets it for approx 30 days.
143+
setCookie("username", theForm.j_username.value, expires);
144+
setCookie("favorite_authentication_method", "username");
145+
}
146+
</s:if>
167147
</script>

0 commit comments

Comments
 (0)