roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r530542 - in /roller/trunk: src/org/apache/roller/ui/core/struts2/ src/org/apache/roller/ui/core/util/struts2/ web/WEB-INF/jsps/core/struts2/ web/roller-ui/styles/
Date Thu, 19 Apr 2007 20:54:26 GMT
Author: agilliland
Date: Thu Apr 19 13:54:25 2007
New Revision: 530542

URL: http://svn.apache.org/viewvc?view=rev&rev=530542
Log:
fix up the final few issues with sruts2 core actions.

1. fixed handling for preview image and weblog url preview on create weblog form.

2. made user name field uneditable on profile update form.



Modified:
    roller/trunk/src/org/apache/roller/ui/core/struts2/ProfileForm.java
    roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java
    roller/trunk/web/WEB-INF/jsps/core/struts2/CreateWeblogForm.jsp
    roller/trunk/web/WEB-INF/jsps/core/struts2/ProfileForm.jsp
    roller/trunk/web/roller-ui/styles/roller.css

Modified: roller/trunk/src/org/apache/roller/ui/core/struts2/ProfileForm.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/core/struts2/ProfileForm.java?view=diff&rev=530542&r1=530541&r2=530542
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/struts2/ProfileForm.java (original)
+++ roller/trunk/src/org/apache/roller/ui/core/struts2/ProfileForm.java Thu Apr 19 13:54:25
2007
@@ -124,17 +124,6 @@
     
     // TODO: replace with struts2 validation
     private void myValidate() {
-        String allowed = RollerConfig.getProperty("username.allowedChars");
-        if(allowed == null || allowed.trim().length() == 0) {
-            allowed = RegisterForm.DEFAULT_ALLOWED_CHARS;
-        }
-        String safe = CharSetUtils.keep(getBean().getUserName(), allowed);
-        
-        if (StringUtils.isEmpty(getBean().getUserName())) {
-            addError("error.add.user.missingUserName");
-        } else if (!safe.equals(getBean().getUserName()) ) {
-            addError("error.add.user.badUserName");
-        }
         
         if (StringUtils.isEmpty(getBean().getEmailAddress())) {
             addError("error.add.user.missingEmailAddress");

Modified: roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java?view=diff&rev=530542&r1=530541&r2=530542
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java (original)
+++ roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java Thu Apr 19 13:54:25
2007
@@ -72,6 +72,14 @@
     }
     
     
+    public String getSiteURL() {
+        return RollerRuntimeConfig.getRelativeContextURL();
+    }
+    
+    public String getAbsoluteSiteURL() {
+        return RollerRuntimeConfig.getAbsoluteContextURL();
+    }
+    
     public String getProp(String key) {
         // first try static config
         String value = RollerConfig.getProperty(key);

Modified: roller/trunk/web/WEB-INF/jsps/core/struts2/CreateWeblogForm.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/core/struts2/CreateWeblogForm.jsp?view=diff&rev=530542&r1=530541&r2=530542
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/core/struts2/CreateWeblogForm.jsp (original)
+++ roller/trunk/web/WEB-INF/jsps/core/struts2/CreateWeblogForm.jsp Thu Apr 19 13:54:25 2007
@@ -20,7 +20,7 @@
 <script type="text/javascript">
 <!--
 function previewImage(theme) {
-    document.preview.src="/themes/" + theme + "/sm-theme-" + theme + ".png";
+    document.preview.src="<s:property value="siteURL" />/themes/" + theme + "/sm-theme-"
+ theme + ".png";
 }
 function handlePreview(handle) {
     previewSpan = document.getElementById("handlePreview");
@@ -61,7 +61,7 @@
         <s:textfield name="bean.handle" size="30" maxlength="30" onkeyup="handlePreview(this)"
/><br />
         <span style="text-size:70%">
             <s:text name="createWebsite.weblogUrl" />:&nbsp;
-            <%-- <c:out value="${model.absoluteURL}" /> --%>/<span id="handlePreview"
style="color:red">handle</span>
+            <s:property value="absoluteSiteURL" />/<span id="handlePreview" style="color:red"><s:if
test="bean.handle != null"><s:property value="bean.handle"/></s:if><s:else>handle</s:else></span>
         </span>
     </td>
     <td class="description"><s:text name="createWebsite.tip.handle" /></td>
@@ -95,7 +95,16 @@
         <s:select name="bean.theme" size="1" list="themes" listKey="id" listValue="name"
onchange="previewImage(this[selectedIndex].value)"/>
        <br />
        <br />
-       <img name="preview" src='/themes/<s:property value="themes[0].id"/>/sm-theme-<s:property
value="themes[0].id"/>.png' />
+       <img name="preview" src='' />
+       <!-- initialize preview image at page load -->
+       <script type="text/javascript">
+           <s:if test="bean.theme == null">
+               previewImage('<s:property value="themes[0].id"/>');
+           </s:if>
+           <s:else>
+               previewImage('<s:property value="bean.theme"/>');
+           </s:else>
+       </script>
     </td>
     <td class="description"><s:text name="createWebsite.tip.theme" /></td>
 </tr>
@@ -107,3 +116,6 @@
 <s:submit key="createWebsite.button.cancel" action="createWeblog!cancel" />
     
 </s:form>
+
+
+    
\ No newline at end of file

Modified: roller/trunk/web/WEB-INF/jsps/core/struts2/ProfileForm.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/core/struts2/ProfileForm.jsp?view=diff&rev=530542&r1=530541&r2=530542
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/core/struts2/ProfileForm.jsp (original)
+++ roller/trunk/web/WEB-INF/jsps/core/struts2/ProfileForm.jsp Thu Apr 19 13:54:25 2007
@@ -20,12 +20,13 @@
 <p class="subtitle"><s:text name="yourProfile.description" /></p>
 
 <s:form action="profile!save">
-           
+    <s:hidden name="bean.userName" />
+    
 <table class="formtable">
 
 <tr>
     <td class="label"><label for="userName" /><s:text name="userSettings.username"
/></label></td>
-    <td class="field"><s:textfield name="bean.userName" readonly="true" /></td>
+    <td class="field"><span class="fixedAttr"><s:property value="bean.userName"/></span></td>
     <td class="description"><s:text name="yourProfile.tip.userName" /></td>
 </tr>
 

Modified: roller/trunk/web/roller-ui/styles/roller.css
URL: http://svn.apache.org/viewvc/roller/trunk/web/roller-ui/styles/roller.css?view=diff&rev=530542&r1=530541&r2=530542
==============================================================================
--- roller/trunk/web/roller-ui/styles/roller.css (original)
+++ roller/trunk/web/roller-ui/styles/roller.css Thu Apr 19 13:54:25 2007
@@ -289,6 +289,11 @@
 table.rollertable td.center {
     text-align: center;
 }
+td.field span.fixedAttr {
+  font-style: italic;
+  font-weight: bold;
+  color: red;
+}
 .rollertable_even td {
     border: 1px solid #ccc;
     background: #EEEEEE;
@@ -675,28 +680,28 @@
     margin-bottom: 5px;
 }
 
-/* tag autocomplete */
-
-div.autocomplete {
-  position:absolute;
-  width:250px;
-  background-color:white;
-  border:1px solid #888;
-  margin:0px;
-  padding:0px;
-}
-div.autocomplete ul {
-  list-style-type:none;
-  margin:0px;
-  padding:0px;
-}
-div.autocomplete ul li.selected { background-color: #ffb;}
-
-div.autocomplete ul li {
-  list-style-type:none;
-  display:block;
-  margin:0;
-  padding:2px;
-  cursor:pointer;
-}
+/* tag autocomplete */
+
+div.autocomplete {
+  position:absolute;
+  width:250px;
+  background-color:white;
+  border:1px solid #888;
+  margin:0px;
+  padding:0px;
+}
+div.autocomplete ul {
+  list-style-type:none;
+  margin:0px;
+  padding:0px;
+}
+div.autocomplete ul li.selected { background-color: #ffb;}
+
+div.autocomplete ul li {
+  list-style-type:none;
+  display:block;
+  margin:0;
+  padding:2px;
+  cursor:pointer;
+}
 



Mime
View raw message