Title: [1344] trunk/web/web-runner/src/main/webapp/ftl: JBEHAVE-190: Converted macro to function and assigned path variable to effectively deal with whitespaces.
Revision
1344
Author
mauro
Date
2009-10-15 16:10:52 -0500 (Thu, 15 Oct 2009)

Log Message

JBEHAVE-190:  Converted macro to function and assigned path variable to effectively deal with whitespaces.

Modified Paths

Diff

Modified: trunk/web/web-runner/src/main/webapp/ftl/data/files.ftl (1343 => 1344)

--- trunk/web/web-runner/src/main/webapp/ftl/data/files.ftl	2009-10-15 20:44:42 UTC (rev 1343)
+++ trunk/web/web-runner/src/main/webapp/ftl/data/files.ftl	2009-10-15 21:10:52 UTC (rev 1344)
@@ -9,7 +9,7 @@
 <#include "/ftl/navigation.ftl" parse="true">
 <div id="content">
     <form action=""
-    
+        
         <div id="files">
            <fieldset>
                <legend><@i.messageFor "dataFiles" "Data Files"/></legend>
@@ -17,9 +17,10 @@
 		       <#if (files.size() > 0) >		       		
 	           <table>
 	             <#list files as file>	
+					<#assign path=p.normalise(file.path)>	             
 	                <tr>
-	                    <td><@p.normalise file.path/></td>
-	                    <td><@w.checkbox "selectedPaths" "${file.path}" /></td>
+	                    <td>${path}</td>
+	                    <td><@w.checkbox "selectedPaths" "${path}" /></td>
 	                </tr>
 	             </#list>
 	           </table>
@@ -39,10 +40,12 @@
 		                <tr>
 		                	<td>
 		                	<#if (p.isViewable(file)) >
-		                		<a class="buttonView"  path/>/<@p.normalise file.path/>')"><@i.messageFor "viewContent" "View"/></a>
+		                	    <#assign selectedPath=p.normalise(path)+"/"+p.normalise(file.path)>
+		                		<a class="buttonView"  "viewContent" "View"/></a>
 		                	</#if>
 		                	</td>
-		                	<td class="contentFilePath"><@p.normalise file.path/></td>
+		                	<#assign relativePath=p.normalise(file.path)>
+		                	<td class="contentFilePath">${relativePath}</td>
 		                </tr>
 	                </#list>
 	             </#list>

Modified: trunk/web/web-runner/src/main/webapp/ftl/data/upload.ftl (1343 => 1344)

--- trunk/web/web-runner/src/main/webapp/ftl/data/upload.ftl	2009-10-15 20:44:42 UTC (rev 1343)
+++ trunk/web/web-runner/src/main/webapp/ftl/data/upload.ftl	2009-10-15 21:10:52 UTC (rev 1344)
@@ -1,5 +1,6 @@
 <#import "/ftl/waffle/i18n.ftl" as i>
 <#import "/ftl/waffle/form.ftl" as w>
+<#import "/ftl/paths.ftl" as p>
 <html xmlns="http://www.w3.org/1999/xhtml">
 <body>
 <head>
@@ -48,7 +49,8 @@
 	         <table>
 	            <#list uploadedFiles as file>
 	                <tr>
-	                    <td>${file.path}</td>
+						<#assign path=p.normalise(file.path)>	             
+	                    <td>${path}</td>
 	                </tr>
 	            </#list>
 	         </table>   

Modified: trunk/web/web-runner/src/main/webapp/ftl/paths.ftl (1343 => 1344)

--- trunk/web/web-runner/src/main/webapp/ftl/paths.ftl	2009-10-15 20:44:42 UTC (rev 1343)
+++ trunk/web/web-runner/src/main/webapp/ftl/paths.ftl	2009-10-15 21:10:52 UTC (rev 1344)
@@ -3,15 +3,18 @@
  * Normalises path by replacing '\' with '/'
  *
  * @param path the path
+ * @return the normalised path
  -->
-<#macro normalise path>
-    <#if path?exists><#assign path=path.replace("\\","/")></#if>${path}
-</#macro>
+<#function normalise path>
+    <#assign normalised = path.replace("\\","/")>
+    <#return normalised>
+</#function>
 
 <#--
  * Determines if file is viewable by looking for a path name with an extension
  *
  * @param file the file
+ * @return boolean true if file path has extension
  -->
 <#function isViewable file>
     <#if file.path.matches(".*\\.[A-Za-z]+")><#return true></#if>


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to