r178 - in trunk/src/main: java/org/chorem/bow java/org/chorem/bow/action webapp webapp/WEB-INF/decorators webapp/css webapp/jsp webapp/jsp/inc webapp/template webapp/template/xhtml
Author: vbriand Date: 2011-01-27 16:51:12 +0100 (Thu, 27 Jan 2011) New Revision: 178 Url: http://chorem.org/repositories/revision/bow/178 Log: Overloaded the default template of Struts2 ("xhtml") in order to remove the generated "<table>"s Added: trunk/src/main/webapp/template/ trunk/src/main/webapp/template/xhtml/ trunk/src/main/webapp/template/xhtml/controlheader-core.ftl trunk/src/main/webapp/template/xhtml/form-close.ftl trunk/src/main/webapp/template/xhtml/form.ftl trunk/src/main/webapp/template/xhtml/password.ftl trunk/src/main/webapp/template/xhtml/submit-close.ftl trunk/src/main/webapp/template/xhtml/submit.ftl trunk/src/main/webapp/template/xhtml/text.ftl Modified: trunk/src/main/java/org/chorem/bow/ trunk/src/main/java/org/chorem/bow/action/LoginAction.java trunk/src/main/webapp/WEB-INF/decorators/main.jsp trunk/src/main/webapp/css/bookmark.css trunk/src/main/webapp/css/connexion.css trunk/src/main/webapp/css/global.css trunk/src/main/webapp/jsp/inc/rightMenu.jsp trunk/src/main/webapp/jsp/login.jsp trunk/src/main/webapp/jsp/preferences.jsp Property changes on: trunk/src/main/java/org/chorem/bow ___________________________________________________________________ Added: svn:ignore + .ControllerServlet.java Modified: trunk/src/main/java/org/chorem/bow/action/LoginAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/LoginAction.java 2011-01-27 09:31:16 UTC (rev 177) +++ trunk/src/main/java/org/chorem/bow/action/LoginAction.java 2011-01-27 15:51:12 UTC (rev 178) @@ -90,15 +90,15 @@ } return null; } - + public String execute() { if (email != null) { email = email.trim(); - + if (password != null) { String md5 = StringUtil.encodeMD5(password); User user; - + try { user = checkLogin(email, md5); } catch (NoSuchAlgorithmException e) { Modified: trunk/src/main/webapp/WEB-INF/decorators/main.jsp =================================================================== --- trunk/src/main/webapp/WEB-INF/decorators/main.jsp 2011-01-27 09:31:16 UTC (rev 177) +++ trunk/src/main/webapp/WEB-INF/decorators/main.jsp 2011-01-27 15:51:12 UTC (rev 178) @@ -8,6 +8,7 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Bow : <decorator:title default="Bow" /></title> + <decorator:head /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <meta name="description" content="Bookmarks on the web" /> <s:url id="temporaryXml" action="temporaryXml" /> @@ -20,7 +21,6 @@ <link href="${globalCSS}" rel="stylesheet" type="text/css" media="all" /> <s:url id="bookmarkJS" value="/js/bookmark.js" /> <script type="text/javascript" src="${bookmarkJS}"></script> - <decorator:head /> </head> <body id="page-home"> <div id="wrap"> Modified: trunk/src/main/webapp/css/bookmark.css =================================================================== --- trunk/src/main/webapp/css/bookmark.css 2011-01-27 09:31:16 UTC (rev 177) +++ trunk/src/main/webapp/css/bookmark.css 2011-01-27 15:51:12 UTC (rev 178) @@ -488,10 +488,4 @@ #bookmarkForm label{ margin-top:12px; font-style:normal; -} - -#bookmarkForm input[type="text"]{ - width:100%; - margin-top:10px; - margin-left:10px; } \ No newline at end of file Modified: trunk/src/main/webapp/css/connexion.css =================================================================== --- trunk/src/main/webapp/css/connexion.css 2011-01-27 09:31:16 UTC (rev 177) +++ trunk/src/main/webapp/css/connexion.css 2011-01-27 15:51:12 UTC (rev 178) @@ -52,7 +52,7 @@ margin-top: 25px; } -#page { +#page{ width:100%; margin:0 auto; clear:both; @@ -78,12 +78,12 @@ color:#804561; width:225px; position:relative; - margin:15px 15px -20px 0px; + margin:15px 15px 10px 0px; } -#formFrame form table td label{ +#formFrame form p{ color:#804561; - font-size:16px; + font-size:14px; font-weight:bold; padding:10px 0; } @@ -137,9 +137,9 @@ } #forgotPassword{ - margin-top:50px; + margin-top:30px; } #register{ - margin-top:35px; + margin-top:20px; } \ No newline at end of file Modified: trunk/src/main/webapp/css/global.css =================================================================== --- trunk/src/main/webapp/css/global.css 2011-01-27 09:31:16 UTC (rev 177) +++ trunk/src/main/webapp/css/global.css 2011-01-27 15:51:12 UTC (rev 178) @@ -108,3 +108,9 @@ text-align:center; line-height:50px; } + +.errorMessage{ + font-weight:normal; + font-size:12px; + color:red; +} \ No newline at end of file Modified: trunk/src/main/webapp/jsp/inc/rightMenu.jsp =================================================================== --- trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2011-01-27 09:31:16 UTC (rev 177) +++ trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2011-01-27 15:51:12 UTC (rev 178) @@ -87,10 +87,10 @@ <div id="add" class="clearfix"> <h2><s:text name="bow.rightMenu.bookmark.addModify" /></h2> <s:form id="bookmarkForm" action="%{#request.formAction}"> - <s:textfield key="bow.rightMenu.bookmark.link" name="link" value="%{#request.link}" labelSeparator="" /> - <s:textfield key="bow.rightMenu.bookmark.alias" name="alias" value="%{#request.alias}" labelSeparator="" /> - <s:textfield key="bow.rightMenu.bookmark.name" name="name" value="%{#request.name}" labelSeparator="" /> - <s:textfield key="bow.rightMenu.bookmark.tags" name="tags" value="%{#request.tags}" labelSeparator="" /> + <s:textfield key="bow.rightMenu.bookmark.link" name="link" value="%{#request.link}" labelSeparator="" /><br /> + <s:textfield key="bow.rightMenu.bookmark.alias" name="alias" value="%{#request.alias}" labelSeparator="" /><br /> + <s:textfield key="bow.rightMenu.bookmark.name" name="name" value="%{#request.name}" labelSeparator="" /><br /> + <s:textfield key="bow.rightMenu.bookmark.tags" name="tags" value="%{#request.tags}" labelSeparator="" /><br /><br /> <s:submit key="bow.rightMenu.bookmark.submit" /> </s:form> </div> @@ -106,8 +106,7 @@ <div class="recherche"> <s:form action="search"> <div class="input"> - <label for="searchLine"><s:text name="bow.rightMenu.search" /></label> - <input type="text" name="searchLine" id="searchLine" /> + <s:textfield key="bow.rightMenu.search" name="searchLine" labelSeparator="" /> <s:submit key="bow.rightMenu.find.submit" theme="simple" /> </div> </s:form> @@ -115,8 +114,7 @@ <div class="recherche"> <s:form action="fullText"> <div class="input"> - <label for="fullTextLine"><s:text name="bow.rightMenu.fullTextSearch" /></label> - <input type="text" name="fullTextLine" id="fullTextLine" /> + <s:textfield key="bow.rightMenu.fullTextSearch" name="fullTextLine" labelSeparator="" /> <s:submit key="bow.rightMenu.find.submit" theme="simple" /> </div> </s:form> Modified: trunk/src/main/webapp/jsp/login.jsp =================================================================== --- trunk/src/main/webapp/jsp/login.jsp 2011-01-27 09:31:16 UTC (rev 177) +++ trunk/src/main/webapp/jsp/login.jsp 2011-01-27 15:51:12 UTC (rev 178) @@ -17,9 +17,11 @@ <div id="formFrame"> <h1><s:text name="bow.login.title" /></h1> <s:form action="login"> + <p> <s:textfield key="bow.login.email" name="email" labelposition="top" labelSeparator=" :" /><br /><br /> <s:password key="bow.login.password" name="password" labelposition="top" labelSeparator=" :" /><br /><br /> <s:submit key="bow.login.submit" /> + </p> </s:form> <s:a action="register_input" id="registerLink"><s:text name="bow.register.title" /></s:a><br /> <s:a action="forgotPassword_input" id="forgotPwd"><s:text name="bow.forgotpwd.title" /></s:a> Modified: trunk/src/main/webapp/jsp/preferences.jsp =================================================================== --- trunk/src/main/webapp/jsp/preferences.jsp 2011-01-27 09:31:16 UTC (rev 177) +++ trunk/src/main/webapp/jsp/preferences.jsp 2011-01-27 15:51:12 UTC (rev 178) @@ -51,22 +51,22 @@ <div class="formFrame"> <h3><s:text name="bow.preferences.userInfo" /></h3> <p> - <s:textfield key="bow.login.email" name="email" cssStyle="margin-bottom: 2px" /><br /><br /> - <s:password key="bow.preferences.currentPassword" name="currentPassword" /> - <s:password key="bow.preferences.newPassword" name="newPassword" /> - <s:password key="bow.preferences.confirmNewPassword" name="confirmNewPassword" /> - <s:url id="generateToken" action="generateToken" /> - <s:a href="%{generateToken}" id="regenPermToken"><s:text name="bow.preferences.regenPermToken" /></s:a> + <s:textfield key="bow.login.email" name="email" labelposition="top" /><br /> + <s:password key="bow.preferences.currentPassword" name="currentPassword" labelposition="top" /><br /> + <s:password key="bow.preferences.newPassword" name="newPassword" labelposition="top" /><br /> + <s:password key="bow.preferences.confirmNewPassword" name="confirmNewPassword" labelposition="top" /><br /> + <s:url id="regenPermToken" action="regenPermToken" /> + <s:a href="%{regenPermToken}" id="regenPermToken"><s:text name="bow.preferences.regenPermToken" /></s:a> </p> </div> <div class="formFrame"> <h3><s:text name="bow.preferences.siteLook" /></h3> <p> - <s:textfield key="bow.preferences.colors" name="colors" /><br /> - <s:textfield key="bow.preferences.tagsNb" name="tagsNb" /><br /> - <s:textfield key="bow.preferences.bookmarksHomePage" name="bookmarksHomePage" /><br /> - <s:textfield key="bow.preferences.searchEngineUrlSuggestions" name="searchEngineUrlSuggestions" /><br /> - <s:textfield key="bow.preferences.searchEngineUrlResults" name="searchEngineUrlResults" /> + <s:textfield key="bow.preferences.colors" name="colors" labelposition="top" /><br /> + <s:textfield key="bow.preferences.tagsNb" name="tagsNb" labelposition="top" /><br /> + <s:textfield key="bow.preferences.bookmarksHomePage" name="bookmarksHomePage" labelposition="top" /><br /> + <s:textfield key="bow.preferences.searchEngineUrlSuggestions" name="searchEngineUrlSuggestions" labelposition="top" /><br /> + <s:textfield key="bow.preferences.searchEngineUrlResults" name="searchEngineUrlResults" labelposition="top" /><br /> <s:submit key="bow.preferences.submit" /> <br /><br /> <s:url id="home" action="home" /> Added: trunk/src/main/webapp/template/xhtml/controlheader-core.ftl =================================================================== --- trunk/src/main/webapp/template/xhtml/controlheader-core.ftl (rev 0) +++ trunk/src/main/webapp/template/xhtml/controlheader-core.ftl 2011-01-27 15:51:12 UTC (rev 178) @@ -0,0 +1,66 @@ +<#-- +/* + * $Id: controlheader-core.ftl 720258 2008-11-24 19:05:16Z musachy $ + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#-- + Only show message if errors are available. + This will be done if ActionSupport is used. +--> +<#assign hasFieldErrors = parameters.name?? && fieldErrors?? && fieldErrors[parameters.name]??/> +<#if hasFieldErrors> +<#list fieldErrors[parameters.name] as error> + + <span class="errorMessage">${error?html}</span><#t/> + <#if parameters.labelposition?default("") == 'top'> + <br /> + </#if> + +</#list> +</#if> +<#-- + if the label position is top, + then give the label it's own row in the table +--> +<#if parameters.label??> + <label <#t/> +<#if parameters.id??> + for="${parameters.id?html}" <#t/> +</#if> +<#if hasFieldErrors> + class="errorLabel"<#t/> +<#else> + class="label"<#t/> +</#if> + ><#t/> +<#if parameters.required?default(false) && parameters.requiredposition?default("right") != 'right'> + <span class="required">*</span><#t/> +</#if> +${parameters.label?html}<#t/> +<#if parameters.required?default(false) && parameters.requiredposition?default("right") == 'right'> + <span class="required">*</span><#t/> +</#if> +${parameters.labelseparator?default(":")?html}<#t/> +<#include "/${parameters.templateDir}/xhtml/tooltip.ftl" /> +</label><#t/> +</#if> +<#if parameters.labelposition?default("") == 'top'> + <br /> +</#if> \ No newline at end of file Added: trunk/src/main/webapp/template/xhtml/form-close.ftl =================================================================== --- trunk/src/main/webapp/template/xhtml/form-close.ftl (rev 0) +++ trunk/src/main/webapp/template/xhtml/form-close.ftl 2011-01-27 15:51:12 UTC (rev 178) @@ -0,0 +1,34 @@ +<#-- +/* + * $Id: form-close.ftl 590812 2007-10-31 20:32:54Z apetrelli $ + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/simple/form-close.ftl" /> +<#include "/${parameters.templateDir}/xhtml/form-close-validate.ftl" /> +<#if parameters.focusElement?if_exists != ""> +<script type="text/javascript"> + StrutsUtils.addOnLoad(function() { + var element = document.getElementById("${parameters.focusElement?html}"); + if(element) { + element.focus(); + } + }); +</script> +</#if> Added: trunk/src/main/webapp/template/xhtml/form.ftl =================================================================== --- trunk/src/main/webapp/template/xhtml/form.ftl (rev 0) +++ trunk/src/main/webapp/template/xhtml/form.ftl 2011-01-27 15:51:12 UTC (rev 178) @@ -0,0 +1,32 @@ +<#-- +/* + * $Id: form.ftl 720258 2008-11-24 19:05:16Z musachy $ + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/xhtml/form-validate.ftl" /> +<#include "/${parameters.templateDir}/simple/form-common.ftl" /> +<#if (parameters.validate?default(false))> + onreset="${parameters.onreset?default('clearErrorMessages(this);clearErrorLabels(this);')}" +<#else> + <#if parameters.onreset??> + onreset="${parameters.onreset?html}" + </#if> +</#if> +> Added: trunk/src/main/webapp/template/xhtml/password.ftl =================================================================== --- trunk/src/main/webapp/template/xhtml/password.ftl (rev 0) +++ trunk/src/main/webapp/template/xhtml/password.ftl 2011-01-27 15:51:12 UTC (rev 178) @@ -0,0 +1,24 @@ +<#-- +/* + * $Id: password.ftl 590812 2007-10-31 20:32:54Z apetrelli $ + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/xhtml/controlheader-core.ftl" /> +<#include "/${parameters.templateDir}/simple/password.ftl" /> Added: trunk/src/main/webapp/template/xhtml/submit-close.ftl =================================================================== --- trunk/src/main/webapp/template/xhtml/submit-close.ftl (rev 0) +++ trunk/src/main/webapp/template/xhtml/submit-close.ftl 2011-01-27 15:51:12 UTC (rev 178) @@ -0,0 +1 @@ +<#include "/${parameters.templateDir}/simple/submit-close.ftl" /> Added: trunk/src/main/webapp/template/xhtml/submit.ftl =================================================================== --- trunk/src/main/webapp/template/xhtml/submit.ftl (rev 0) +++ trunk/src/main/webapp/template/xhtml/submit.ftl 2011-01-27 15:51:12 UTC (rev 178) @@ -0,0 +1,23 @@ +<#-- +/* + * $Id: submit.ftl 720258 2008-11-24 19:05:16Z musachy $ + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/simple/submit.ftl" /> Added: trunk/src/main/webapp/template/xhtml/text.ftl =================================================================== --- trunk/src/main/webapp/template/xhtml/text.ftl (rev 0) +++ trunk/src/main/webapp/template/xhtml/text.ftl 2011-01-27 15:51:12 UTC (rev 178) @@ -0,0 +1,24 @@ +<#-- +/* + * $Id: text.ftl 590812 2007-10-31 20:32:54Z apetrelli $ + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--> +<#include "/${parameters.templateDir}/xhtml/controlheader-core.ftl" /> +<#include "/${parameters.templateDir}/simple/text.ftl" />
participants (1)
-
vbriand@users.chorem.org