svn commit: r1840350 - in /ofbiz/ofbiz-plugins/trunk: ecommerce/template/catalog/ ecommerce/template/content/ ecommerce/template/data/ ecommerce/template/forum/ ecommerce/template/shoppinglist/ lucene/template/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1840350 - in /ofbiz/ofbiz-plugins/trunk: ecommerce/template/catalog/ ecommerce/template/content/ ecommerce/template/data/ ecommerce/template/forum/ ecommerce/template/shoppinglist/ lucene/template/

Deepak Dixit-5
Author: deepak
Date: Sat Sep  8 09:38:11 2018
New Revision: 1840350

URL: http://svn.apache.org/viewvc?rev=1840350&view=rev
Log:
Improved: Replace #assign with #local in all the ftl macros
(OFBIZ-10516)

Modified:
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/CategoryDetail.ftl
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ConfigProductDetail.ftl
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/LayeredCategoryDetail.ftl
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ProductDetail.ftl
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/content/SearchContent.ftl
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/content/TplMbContent.ftl
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/data/Content.ftl
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/data/Topic.ftl
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/data/Tree.ftl
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/forum/BlogLib.ftl
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/forum/ShowForumResponse.ftl
    ofbiz/ofbiz-plugins/trunk/ecommerce/template/shoppinglist/EditShoppingList.ftl
    ofbiz/ofbiz-plugins/trunk/lucene/template/AdminSearch.ftl

Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/CategoryDetail.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/CategoryDetail.ftl?rev=1840350&r1=1840349&r2=1840350&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/CategoryDetail.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/CategoryDetail.ftl Sat Sep  8 09:38:11 2018
@@ -41,7 +41,7 @@
 </script>
 
   <#macro paginationControls>
-    <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize)?double / viewSize?double)/>
+    <#local viewIndexMax = Static["java.lang.Math"].ceil((listSize)?double / viewSize?double)/>
     <#if (viewIndexMax?int > 0)>
       <div class="row">
         <div class="col-sm-2 offset-sm-10">

Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ConfigProductDetail.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ConfigProductDetail.ftl?rev=1840350&r1=1840349&r2=1840350&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ConfigProductDetail.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ConfigProductDetail.ftl Sat Sep  8 09:38:11 2018
@@ -747,9 +747,9 @@ ${virtualJavaScript!}
 
   <#-- Upgrades/Up-Sell/Cross-Sell -->
   <#macro associated assocProducts beforeName showName afterName formNamePrefix targetRequestName>
-    <#assign targetRequest = "product">
+    <#local targetRequest = "product">
     <#if targetRequestName?has_content>
-      <#assign targetRequest = targetRequestName>
+      <#local targetRequest = targetRequestName>
     </#if>
     <#if assocProducts?has_content>
       <tr>

Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/LayeredCategoryDetail.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/LayeredCategoryDetail.ftl?rev=1840350&r1=1840349&r2=1840350&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/LayeredCategoryDetail.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/LayeredCategoryDetail.ftl Sat Sep  8 09:38:11 2018
@@ -18,7 +18,7 @@ under the License.
 -->
 
 <#macro paginationControls>
-  <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize - 1)?double / viewSize?double)>
+  <#local viewIndexMax = Static["java.lang.Math"].ceil((listSize - 1)?double / viewSize?double)>
   <#if (viewIndexMax?int > 0)>
     <div class="product-prevnext">
       <#-- Start Page Select Drop-Down -->

Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ProductDetail.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ProductDetail.ftl?rev=1840350&r1=1840349&r2=1840350&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ProductDetail.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/catalog/ProductDetail.ftl Sat Sep  8 09:38:11 2018
@@ -992,10 +992,10 @@ $(function(){
   </div>
     <#-- Upgrades/Up-Sell/Cross-Sell -->
     <#macro associated assocProducts beforeName showName afterName formNamePrefix targetRequestName>
-      <#assign pageProduct = product />
-      <#assign targetRequest = "product" />
+      <#local pageProduct = product />
+      <#local targetRequest = "product" />
       <#if targetRequestName?has_content>
-        <#assign targetRequest = targetRequestName />
+        <#local targetRequest = targetRequestName />
       </#if>
       <#if assocProducts?has_content>
         <h2>
@@ -1006,9 +1006,9 @@ $(function(){
         <div class="productsummary-container">
           <#list assocProducts as productAssoc>
             <#if productAssoc.productId == product.productId>
-              <#assign assocProductId = productAssoc.productIdTo />
+              <#local assocProductId = productAssoc.productIdTo />
             <#else>
-              <#assign assocProductId = productAssoc.productId />
+              <#local assocProductId = productAssoc.productId />
             </#if>
             <div>
               <a href="<@ofbizUrl>${targetRequest}/<#if categoryId??>~category_id=${categoryId}/</#if>~product_id=${assocProductId}</@ofbizUrl>"
@@ -1026,7 +1026,7 @@ $(function(){
             ${setRequestAttribute("targetRequestName", targetRequestName)}
             </#if>
           ${screens.render(productsummaryScreen)}
-            <#assign product = pageProduct />
+            <#local product = pageProduct />
             <#local listIndex = listIndex + 1 />
           </#list>
         </div>

Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/template/content/SearchContent.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/content/SearchContent.ftl?rev=1840350&r1=1840349&r2=1840350&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/content/SearchContent.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/content/SearchContent.ftl Sat Sep  8 09:38:11 2018
@@ -99,8 +99,8 @@ under the License.
 
 
 <#macro listSiteIds contentId indentIndex=0>
-  <#assign dummy=Static["org.apache.ofbiz.base.util.Debug"].logInfo("in listSiteIds, contentId:" + contentId,"")/>
-  <#assign dummy=Static["org.apache.ofbiz.base.util.Debug"].logInfo("in listSiteIds, indentIndex:" + indentIndex,"")/>
+  <#local dummy=Static["org.apache.ofbiz.base.util.Debug"].logInfo("in listSiteIds, contentId:" + contentId,"")/>
+  <#local dummy=Static["org.apache.ofbiz.base.util.Debug"].logInfo("in listSiteIds, indentIndex:" + indentIndex,"")/>
   <#local indent = ""/>
   <#if 0 < indentIndex >
     <#list 0..(indentIndex - 1) as idx>

Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/template/content/TplMbContent.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/content/TplMbContent.ftl?rev=1840350&r1=1840349&r2=1840350&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/content/TplMbContent.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/content/TplMbContent.ftl Sat Sep  8 09:38:11 2018
@@ -51,7 +51,7 @@ under the License.
 </#macro>
 <#--
 <#macro content>
-  <#assign contentId="ECMC" + .node.@id[0]/>
+  <#local contentId="ECMC" + .node.@id[0]/>
   <DataResource dataResourceId="${contentId}" dataResourceTypeId="ELECTRONIC_TEXT"
       dataTemplateTypeId="NONE" dataSourceId="ECM" mimeTypeId="text/html"/>
   <ElectronicText dataResourceId="${contentId}">

Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/template/data/Content.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/data/Content.ftl?rev=1840350&r1=1840349&r2=1840350&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/data/Content.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/data/Content.ftl Sat Sep  8 09:38:11 2018
@@ -28,7 +28,7 @@ under the License.
 </#macro>
 
 <#macro content>
-  <#assign contentId="ECMC" + .node.@id[0]/>
+  <#local contentId="ECMC" + .node.@id[0]/>
   <DataResource dataResourceId="${contentId}" dataResourceTypeId="ELECTRONIC_TEXT" dataTemplateTypeId="NONE"
               dataSourceId="ECM" mimeTypeId="text/xml"/>
   <ElectronicText dataResourceId="${contentId}">

Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/template/data/Topic.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/data/Topic.ftl?rev=1840350&r1=1840349&r2=1840350&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/data/Topic.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/data/Topic.ftl Sat Sep  8 09:38:11 2018
@@ -27,13 +27,13 @@ under the License.
 </#macro>
 
 <#macro topic>
-  <#assign contentId="ECMT" + .node.@id[0]/>
+  <#local contentId="ECMT" + .node.@id[0]/>
   <Content contentId="${contentId}" contentTypeId="WEB_SITE_PUB_PT" contentName="${.node.topic_heading}"
       description="${.node.topic_desc?html}" ownerContentId=""/>
-  <#assign internalName=.node.@name[0]/>
-  <#assign internalNameParts=internalName?split(".")/>
-  <#assign firstPart=internalNameParts[0] />
-  <#assign nowStamp=Static["org.apache.ofbiz.base.util.UtilDateTime"].nowTimestamp()/>
+  <#local internalName=.node.@name[0]/>
+  <#local internalNameParts=internalName?split(".")/>
+  <#local firstPart=internalNameParts[0] />
+  <#local nowStamp=Static["org.apache.ofbiz.base.util.UtilDateTime"].nowTimestamp()/>
   <#if "WIDGETS" == firstPart>
     <ContentAssoc contentId="CNTWIDGETS" contentIdTo="${contentId}" contentAssocTypeId="SUB_CONTENT"
         fromDate="${nowStamp?string("yyyy-MM-dd HH:mm:ss")}"/>

Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/template/data/Tree.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/data/Tree.ftl?rev=1840350&r1=1840349&r2=1840350&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/data/Tree.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/data/Tree.ftl Sat Sep  8 09:38:11 2018
@@ -27,16 +27,16 @@ under the License.
 </#macro>
 
 <#macro topic>
-  <#assign contentId="ECMT" + .node.@id[0]/>
+  <#local contentId="ECMT" + .node.@id[0]/>
   <#recurse .node>
 </#macro>
 
 <#macro child>
-  <#assign contentIdTo="ECMT" + .node.@id[0]/>
-  <#assign assocType="SUB_CONTENT"/>
+  <#local contentIdTo="ECMT" + .node.@id[0]/>
+  <#local assocType="SUB_CONTENT"/>
   <#if .node.@type = "content">
-    <#assign contentIdTo="ECMC" + .node.@id[0]/>
-    <#assign assocType="PUBLISH_LINK"/>
+    <#local contentIdTo="ECMC" + .node.@id[0]/>
+    <#local assocType="PUBLISH_LINK"/>
   </#if>
   <#assign nowStamp=Static["org.apache.ofbiz.base.util.UtilDateTime"].nowTimestamp()/>
   <ContentAssoc contentIdTo="${contentIdTo}" contentId="${contentId}" contentAssocTypeId="${assocType}"

Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/template/forum/BlogLib.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/forum/BlogLib.ftl?rev=1840350&r1=1840349&r2=1840350&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/forum/BlogLib.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/forum/BlogLib.ftl Sat Sep  8 09:38:11 2018
@@ -169,25 +169,25 @@ under the License.
 
 <#macro nextPrev listSize requestURL queryString lowIndex=0 highIndex=10 viewSize=10 viewIndex=0 >
 
-  <#assign lowIdx=lowIndex/>
-  <#assign highIdx=highIndex/>
-  <#assign viewSz=viewSize/>
-  <#assign viewIdx=viewIndex/>
-  <#assign listSz=listSize/>
+  <#local lowIdx=lowIndex/>
+  <#local highIdx=highIndex/>
+  <#local viewSz=viewSize/>
+  <#local viewIdx=viewIndex/>
+  <#local listSz=listSize/>
 
-  <#if !lowIdx?has_content><#assign lowIdx=0/></#if>
-  <#if !highIdx?has_content><#assign highIdx=0/></#if>
-  <#if !viewSz?has_content><#assign viewSz=10/></#if>
-  <#if !viewIdx?has_content><#assign viewIdx=10/></#if>
-  <#if !listSz?has_content><#assign listSz=0/></#if>
+  <#if !lowIdx?has_content><#local lowIdx=0/></#if>
+  <#if !highIdx?has_content><#local highIdx=0/></#if>
+  <#if !viewSz?has_content><#local viewSz=10/></#if>
+  <#if !viewIdx?has_content><#local viewIdx=10/></#if>
+  <#if !listSz?has_content><#local listSz=0/></#if>
 
   <#if queryString?has_content>
-    <#assign queryString = Static["org.apache.ofbiz.base.util.UtilHttp"].stripViewParamsFromQueryString(queryString)/>
+    <#local queryString = Static["org.apache.ofbiz.base.util.UtilHttp"].stripViewParamsFromQueryString(queryString)/>
   </#if>
 
-  <#assign lowIdxShow = lowIdx + 1 />
+  <#local lowIdxShow = lowIdx + 1 />
   <#if highIdx < lowIdxShow >
-    <#assign lowIdxShow = highIdx/>
+    <#local lowIdxShow = highIdx/>
   </#if>
   <table border="0">
     <tr>

Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/template/forum/ShowForumResponse.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/forum/ShowForumResponse.ftl?rev=1840350&r1=1840349&r2=1840350&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/forum/ShowForumResponse.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/forum/ShowForumResponse.ftl Sat Sep  8 09:38:11 2018
@@ -122,11 +122,11 @@ under the License.
 
 <#-- not used, will be deleted -->
 <#macro getCurrentContent >
-  <#assign globalNodeTrail=globalNodeTrail/>
+  <#local globalNodeTrail=globalNodeTrail/>
   <#if globalNodeTrail??>
-    <#assign currentNode=globalNodeTrail?last/>
+    <#local currentNode=globalNodeTrail?last/>
     <#if currentNode??>
-      <#assign currentValue=currentNode.value/>
+      <#local currentValue=currentNode.value/>
       <#if currentValue??>
         <@wrapSubContentCache subContentId=currentValue.contentId wrapTemplateId="WRAP_ARTICLE" >
           <@traverseSubContentCache  contentAssocTypeId="SUB_CONTENT"
@@ -134,7 +134,7 @@ under the License.
               returnAfterPickWhen="mapKey != null && mapKey.equals(\"ARTICLE\")"
               followWhen="contentAssocTypeId != null && contentAssocTypeId.equals(\"_never_\")"
               wrapTemplateId="">
-            <#assign description=currentValue.description?default("No description")/>
+            <#local description=currentValue.description?default("No description")/>
             ${uiLabelMap.CommonDescription}[${currentValue.contentId!}]:${description}
             <a class="tabButton"
                 href="<@ofbizUrl>ViewBlog?contentId=${thisContentId}&amp;nodeTrailCsv=${nodeTrailCsv!}</@ofbizUrl>">
@@ -148,10 +148,10 @@ under the License.
 </#macro>
 
 <#macro renderSiteAncestryPath trail startIndex=0 >
-  <#assign indent = "">
-  <#assign csv = "">
-  <#assign counter = 0>
-  <#assign len = trail?size>
+  <#local indent = "">
+  <#local csv = "">
+  <#local counter = 0>
+  <#local len = trail?size>
   <table border="0" cellspacing="4">
     <#list trail as webSitePublishPoint>
       <#if counter < len && startIndex <= counter >
@@ -161,12 +161,12 @@ under the License.
           <a class="tabButton"
              href="<@ofbizUrl>main?pubPt=${webSitePublishPoint.contentId!}</@ofbizUrl>">${uiLabelMap.CommonBackTo}</a>
           &nbsp;${webSitePublishPoint.templateTitle!}
-          <#assign indent = indent + "&nbsp;&nbsp;&nbsp;&nbsp;">
+          <#local indent = indent + "&nbsp;&nbsp;&nbsp;&nbsp;">
           [${webSitePublishPoint.contentId!}]
         </td>
       </#if>
     </tr>
-      <#assign counter = counter + 1>
+      <#local counter = counter + 1>
       <#if 20 < counter > <#break/></#if>
     </#list>
   </table>

Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/template/shoppinglist/EditShoppingList.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/template/shoppinglist/EditShoppingList.ftl?rev=1840350&r1=1840349&r2=1840350&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/template/shoppinglist/EditShoppingList.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/template/shoppinglist/EditShoppingList.ftl Sat Sep  8 09:38:11 2018
@@ -55,7 +55,7 @@ under the License.
 //]]>
 </script>
 <#macro paginationControls>
-  <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize)?double / viewSize?double)>
+  <#local viewIndexMax = Static["java.lang.Math"].ceil((listSize)?double / viewSize?double)>
   <#if (viewIndexMax?int > 0)>
         <#-- Start Page Select Drop-Down -->
         <select name="pageSelect" class="custom-select float-right mb-2" onchange="callDocumentByPaginate(this[this.selectedIndex].value);">

Modified: ofbiz/ofbiz-plugins/trunk/lucene/template/AdminSearch.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/lucene/template/AdminSearch.ftl?rev=1840350&r1=1840349&r2=1840350&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/lucene/template/AdminSearch.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/lucene/template/AdminSearch.ftl Sat Sep  8 09:38:11 2018
@@ -129,8 +129,8 @@ under the License.
 <hr />
 
 <#macro listSiteIds contentId indentIndex=0>
-  <#assign dummy=Static["org.apache.ofbiz.base.util.Debug"].logInfo("in listSiteIds, contentId:" + contentId,"")/>
-  <#assign dummy=Static["org.apache.ofbiz.base.util.Debug"].logInfo("in listSiteIds, indentIndex:" + indentIndex,"")/>
+  <#local dummy=Static["org.apache.ofbiz.base.util.Debug"].logInfo("in listSiteIds, contentId:" + contentId,"")/>
+  <#local dummy=Static["org.apache.ofbiz.base.util.Debug"].logInfo("in listSiteIds, indentIndex:" + indentIndex,"")/>
   <#local indent = ""/>
   <#if 0 < indentIndex >
     <#list 0..(indentIndex - 1) as idx>