Author: agilliland
Date: Wed May 23 19:07:20 2007
New Revision: 541135

URL: http://svn.apache.org/viewvc?view=rev&rev=541135
Log:
provide a fix for a formatting issue that was occuring when using the s:radio 
and s:checkboxlist struts2 tags.  both of those tags render their outputted 
items without providing a way to add a line break between each item, so they 
were always rendered in a horizontal list.

the fix here is to create a custom struts2 theme for roller which overrides the 
way those 2 tags work and add a <br/> at the end of each printed item.  this 
custom theme can be used only on the specific uses of that tag which need them, 
so the default functionality is still available.


Added:
    roller/trunk/web/WEB-INF/classes/template/
    roller/trunk/web/WEB-INF/classes/template/roller/
    roller/trunk/web/WEB-INF/classes/template/roller/checkboxlist.ftl
    roller/trunk/web/WEB-INF/classes/template/roller/radiomap.ftl
    roller/trunk/web/WEB-INF/classes/template/roller/theme.properties.properties
Modified:
    roller/trunk/web/WEB-INF/jsps/admin/GlobalCommentManagementSidebar.jsp
    roller/trunk/web/WEB-INF/jsps/editor/CommentsSidebar.jsp
    roller/trunk/web/WEB-INF/jsps/editor/EntriesSidebar.jsp
    roller/trunk/web/WEB-INF/jsps/editor/EntryAdd.jsp
    roller/trunk/web/WEB-INF/jsps/editor/EntryEdit.jsp
    roller/trunk/web/WEB-INF/jsps/editor/WeblogConfig.jsp

Added: roller/trunk/web/WEB-INF/classes/template/roller/checkboxlist.ftl
URL: 
http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/classes/template/roller/checkboxlist.ftl?view=auto&rev=541135
==============================================================================
--- roller/trunk/web/WEB-INF/classes/template/roller/checkboxlist.ftl (added)
+++ roller/trunk/web/WEB-INF/classes/template/roller/checkboxlist.ftl Wed May 
23 19:07:20 2007
@@ -0,0 +1,33 @@
+<#assign itemCount = 0/>
+<#if parameters.list?exists>
+    <@s.iterator value="parameters.list">
+        <#assign itemCount = itemCount + 1/>
+        <#if parameters.listKey?exists>
+            <#assign itemKey = stack.findValue(parameters.listKey)/>
+        <#else>
+            <#assign itemKey = stack.findValue('top')/>
+        </#if>
+        <#if parameters.listValue?exists>
+            <#assign itemValue = stack.findString(parameters.listValue)/>
+        <#else>
+            <#assign itemValue = stack.findString('top')/>
+        </#if>
+<#assign itemKeyStr=itemKey.toString() />
+<input type="checkbox" name="${parameters.name?html}" 
value="${itemKeyStr?html}" id="${parameters.name?html}-${itemCount}"<#rt/>
+        <#if tag.contains(parameters.nameValue, itemKey)>
+ checked="checked"<#rt/>
+        </#if>
+        <#if parameters.disabled?default(false)>
+ disabled="disabled"<#rt/>
+        </#if>
+        <#if parameters.title?exists>
+ title="${parameters.title?html}"<#rt/>
+        </#if>
+        <#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
+        <#include "/${parameters.templateDir}/simple/common-attributes.ftl" />
+/>
+<label for="${parameters.name?html}-${itemCount}" 
class="checkboxLabel">${itemValue?html}</label><br/>
+    </@s.iterator>
+<#else>
+  &nbsp;
+</#if>

Added: roller/trunk/web/WEB-INF/classes/template/roller/radiomap.ftl
URL: 
http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/classes/template/roller/radiomap.ftl?view=auto&rev=541135
==============================================================================
--- roller/trunk/web/WEB-INF/classes/template/roller/radiomap.ftl (added)
+++ roller/trunk/web/WEB-INF/classes/template/roller/radiomap.ftl Wed May 23 
19:07:20 2007
@@ -0,0 +1,42 @@
+<@s.iterator value="parameters.list">
+    <#if parameters.listKey?exists>
+        <#assign itemKey = stack.findValue(parameters.listKey)/>
+    <#else>
+        <#assign itemKey = stack.findValue('top')/>
+    </#if>
+    <#assign itemKeyStr = itemKey.toString() />
+    <#if parameters.listValue?exists>
+        <#assign itemValue = stack.findString(parameters.listValue)/>
+    <#else>
+        <#assign itemValue = stack.findString('top')/>
+    </#if>
+<input type="radio" name="${parameters.name?html}" 
id="${parameters.id?html}${itemKeyStr?html}"<#rt/>
+<#if tag.contains(parameters.nameValue, itemKey)>
+ checked="checked"<#rt/>
+</#if>
+<#if itemKey?exists>
+ value="${itemKeyStr?html}"<#rt/>
+</#if>
+<#if parameters.disabled?default(false)>
+ disabled="disabled"<#rt/>
+</#if>
+<#if parameters.tabindex?exists>
+ tabindex="${parameters.tabindex?html}"<#rt/>
+</#if>
+<#if parameters.cssClass?exists>
+ class="${parameters.cssClass?html}"<#rt/>
+</#if>
+<#if parameters.cssStyle?exists>
+ style="${parameters.cssStyle?html}"<#rt/>
+</#if>
+<#if parameters.title?exists>
+ title="${parameters.title?html}"<#rt/>
+</#if>
+<#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
+<#include "/${parameters.templateDir}/simple/common-attributes.ftl" />
+/><#rt/>
+<label for="${parameters.id?html}${itemKeyStr?html}"><#rt/>
+    ${itemValue}<#t/>
+</label>
+<br/>
+</@s.iterator>

Added: 
roller/trunk/web/WEB-INF/classes/template/roller/theme.properties.properties
URL: 
http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/classes/template/roller/theme.properties.properties?view=auto&rev=541135
==============================================================================
--- 
roller/trunk/web/WEB-INF/classes/template/roller/theme.properties.properties 
(added)
+++ 
roller/trunk/web/WEB-INF/classes/template/roller/theme.properties.properties 
Wed May 23 19:07:20 2007
@@ -0,0 +1,3 @@
+
+# Roller struts2 theme extends the 'basic' theme
+parent = basic

Modified: roller/trunk/web/WEB-INF/jsps/admin/GlobalCommentManagementSidebar.jsp
URL: 
http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/admin/GlobalCommentManagementSidebar.jsp?view=diff&rev=541135&r1=541134&r2=541135
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/admin/GlobalCommentManagementSidebar.jsp 
(original)
+++ roller/trunk/web/WEB-INF/jsps/admin/GlobalCommentManagementSidebar.jsp Wed 
May 23 19:07:20 2007
@@ -59,7 +59,7 @@
             <br />
         </label> 
         <div>
-            <s:radio name="approvedString" list="commentStatusOptions" 
listKey="key" listValue="value" />
+            <s:radio theme="roller" name="approvedString" 
list="commentStatusOptions" listKey="key" listValue="value" />
         </div>
     </div> 
     <br />
@@ -73,7 +73,7 @@
             <br />
         </label>
         <div>
-            <s:radio name="spamString" list="spamStatusOptions" listKey="key" 
listValue="value" />
+            <s:radio theme="roller" name="spamString" list="spamStatusOptions" 
listKey="key" listValue="value" />
         </div>
     </div>
     <br />

Modified: roller/trunk/web/WEB-INF/jsps/editor/CommentsSidebar.jsp
URL: 
http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/editor/CommentsSidebar.jsp?view=diff&rev=541135&r1=541134&r2=541135
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/editor/CommentsSidebar.jsp (original)
+++ roller/trunk/web/WEB-INF/jsps/editor/CommentsSidebar.jsp Wed May 23 
19:07:20 2007
@@ -60,7 +60,7 @@
             <br />
         </label> 
         <div>
-            <s:radio name="approvedString" list="commentStatusOptions" 
listKey="key" listValue="value" />
+            <s:radio theme="roller" name="approvedString" 
list="commentStatusOptions" listKey="key" listValue="value" />
         </div>
     </div> 
     <br />
@@ -74,7 +74,7 @@
             <br />
         </label>
         <div>
-            <s:radio name="spamString" list="spamStatusOptions" listKey="key" 
listValue="value" />
+            <s:radio theme="roller" name="spamString" list="spamStatusOptions" 
listKey="key" listValue="value" />
         </div>
     </div>
     <br />

Modified: roller/trunk/web/WEB-INF/jsps/editor/EntriesSidebar.jsp
URL: 
http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/editor/EntriesSidebar.jsp?view=diff&rev=541135&r1=541134&r2=541135
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/editor/EntriesSidebar.jsp (original)
+++ roller/trunk/web/WEB-INF/jsps/editor/EntriesSidebar.jsp Wed May 23 19:07:20 
2007
@@ -99,7 +99,7 @@
                             <br />
                         </label> 
                         <div>
-                            <s:radio name="bean.status" list="statusOptions" 
listKey="key" listValue="value" />
+                            <s:radio theme="roller" name="bean.status" 
list="statusOptions" listKey="key" listValue="value" />
                         </div>
                     </div>
                     
@@ -113,7 +113,7 @@
                             <br />
                         </label> 
                         <div>
-                            <s:radio name="bean.sortBy" list="sortByOptions" 
listKey="key" listValue="value" />
+                            <s:radio theme="roller" name="bean.sortBy" 
list="sortByOptions" listKey="key" listValue="value" />
                         </div>
                     </div>
                     

Modified: roller/trunk/web/WEB-INF/jsps/editor/EntryAdd.jsp
URL: 
http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/editor/EntryAdd.jsp?view=diff&rev=541135&r1=541134&r2=541135
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/editor/EntryAdd.jsp (original)
+++ roller/trunk/web/WEB-INF/jsps/editor/EntryAdd.jsp Wed May 23 19:07:20 2007
@@ -114,7 +114,7 @@
             <s:text name="weblogEdit.pluginsToApply" /></a>
         </div>
         <div id="pluginControl" class="miscControl" style="display:none">
-            <s:checkboxlist name="bean.plugins" list="entryPlugins" 
listKey="name" listValue="name" />
+            <s:checkboxlist theme="roller" name="bean.plugins" 
list="entryPlugins" listKey="name" listValue="name" />
         </div>
     </s:if>
 

Modified: roller/trunk/web/WEB-INF/jsps/editor/EntryEdit.jsp
URL: 
http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/editor/EntryEdit.jsp?view=diff&rev=541135&r1=541134&r2=541135
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/editor/EntryEdit.jsp (original)
+++ roller/trunk/web/WEB-INF/jsps/editor/EntryEdit.jsp Wed May 23 19:07:20 2007
@@ -146,7 +146,7 @@
             <s:text name="weblogEdit.pluginsToApply" /></a>
         </div>
         <div id="pluginControl" class="miscControl" style="display:none">
-            <s:checkboxlist name="bean.plugins" list="entryPlugins" 
listKey="name" listValue="name" />
+            <s:checkboxlist theme="roller" name="bean.plugins" 
list="entryPlugins" listKey="name" listValue="name" />
         </div>
     </s:if>
 

Modified: roller/trunk/web/WEB-INF/jsps/editor/WeblogConfig.jsp
URL: 
http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/editor/WeblogConfig.jsp?view=diff&rev=541135&r1=541134&r2=541135
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/editor/WeblogConfig.jsp (original)
+++ roller/trunk/web/WEB-INF/jsps/editor/WeblogConfig.jsp Wed May 23 19:07:20 
2007
@@ -213,7 +213,7 @@
         <tr>
             <td class="label"><s:text name="websiteSettings.label1" /> <br 
/><s:text name="websiteSettings.label2" /></td>
             <td class="field">
-                <s:checkboxlist list="pluginsList" 
name="bean.defaultPluginsArray" listKey="name" listValue="name" />
+                <s:checkboxlist theme="roller" list="pluginsList" 
name="bean.defaultPluginsArray" listKey="name" listValue="name" />
             
             </td>
             <td class="description"><%-- <s:text name="websiteSettings.tip." 
/> --%></td>


Reply via email to