[ofbiz-plugins] branch trunk updated: Improved: enclose productsummary list in div.row to better use the screen/plugins (OFBIZ-11979)

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

[ofbiz-plugins] branch trunk updated: Improved: enclose productsummary list in div.row to better use the screen/plugins (OFBIZ-11979)

jleroux@apache.org
This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 031a160  Improved: enclose productsummary list in div.row to better use the screen/plugins (OFBIZ-11979)
031a160 is described below

commit 031a16026d81889b1afbf33e867f4484da6836df
Author: Jacques Le Roux <[hidden email]>
AuthorDate: Tue Aug 25 09:04:23 2020 +0200

    Improved: enclose productsummary list in div.row to better use the screen/plugins (OFBIZ-11979)
   
    It's not about div.row only, in productdetail, the reason field was outside the
    summary box.
   
    I've moved the reason inside the summary box, as a generic parameter, highlightLabel.
   
    Thanks: Alex Bodnaru
---
 ecommerce/template/catalog/ProductDetail.ftl  | 16 +++++++---------
 ecommerce/template/catalog/ProductSummary.ftl |  3 +++
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/ecommerce/template/catalog/ProductDetail.ftl b/ecommerce/template/catalog/ProductDetail.ftl
index f69636b..b393b46 100644
--- a/ecommerce/template/catalog/ProductDetail.ftl
+++ b/ecommerce/template/catalog/ProductDetail.ftl
@@ -1005,21 +1005,16 @@ $(function(){
         </h2>
 
         <div class="productsummary-container">
+          <div class="row">
           <#list assocProducts as productAssoc>
             <#if productAssoc.productId == product.productId>
               <#local assocProductId = productAssoc.productIdTo />
             <#else>
               <#local assocProductId = productAssoc.productId />
             </#if>
-            <div>
-              <a href="<@ofbizUrl>${targetRequest}/<#if categoryId??>~category_id=${categoryId}/</#if>~product_id=${assocProductId}</@ofbizUrl>"
-                 class="buttontext">
-              ${assocProductId}
-              </a>
-              <#if productAssoc.reason?has_content>
-                - <strong>${productAssoc.reason}</strong>
-              </#if>
-            </div>
+            <#if productAssoc.reason?has_content>
+              ${setRequestAttribute("highlightLabel", productAssoc.reason)}
+            </#if>
           ${setRequestAttribute("optProductId", assocProductId)}
           ${setRequestAttribute("listIndex", listIndex)}
           ${setRequestAttribute("formNamePrefix", formNamePrefix)}
@@ -1030,6 +1025,7 @@ $(function(){
             <#local product = pageProduct />
             <#local listIndex = listIndex + 1 />
           </#list>
+          </div>
         </div>
 
       ${setRequestAttribute("optProductId", "")}
@@ -1064,6 +1060,7 @@ $(function(){
     <h2>${uiLabelMap.ProductSimilarProducts}</h2>
 
     <div class="productsummary-container">
+      <div class="row">
       <#list commonFeatureResultIds as commonFeatureResultId>
         ${setRequestAttribute("optProductId", commonFeatureResultId)}
         ${setRequestAttribute("listIndex", commonFeatureResultId_index)}
@@ -1071,6 +1068,7 @@ $(function(){
         <#-- ${setRequestAttribute("targetRequestName", targetRequestName)} -->
         ${screens.render(productsummaryScreen)}
       </#list>
+      </div>
     </div>
   </#if>
   <hr>
diff --git a/ecommerce/template/catalog/ProductSummary.ftl b/ecommerce/template/catalog/ProductSummary.ftl
index cc12505..1412dc9 100644
--- a/ecommerce/template/catalog/ProductSummary.ftl
+++ b/ecommerce/template/catalog/ProductSummary.ftl
@@ -84,6 +84,9 @@
                         <#if prodCatMem?? && prodCatMem.comments?has_content>
                           <p>${prodCatMem.comments}</p>
                         </#if>
+                        <#if request.getAttribute("highlightLabel")??>
+                          <p><strong>${request.getAttribute("highlightLabel")}</strong></p>
+                        </#if>
 
                         <#-- example of showing a certain type of feature with the product -->
                           <#if sizeProductFeatureAndAppls?has_content>