svn commit: r544429 - /ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl

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

svn commit: r544429 - /ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl

rayb-2
Author: rayb
Date: Tue Jun  5 02:17:29 2007
New Revision: 544429

URL: http://svn.apache.org/viewvc?view=rev&rev=544429
Log:
Bug fix for the keyword search results page. OFBIZ-1013

Modified:
    ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl?view=diff&rev=544429&r1=544428&r2=544429
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl Tue Jun  5 02:17:29 2007
@@ -31,23 +31,23 @@
 <#if productIds?has_content>
     <div class="product-prevnext">
         <#-- Start Page Select Drop-Down -->
-        <#assign viewIndexMax = Static["java.lang.Math"].ceil(listSize?double / viewSize?double)>
+        <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize - 1)?double / viewSize?double)>
         <select name="pageSelect" class="selectBox" onchange="window.location=this[this.selectedIndex].value;">
-          <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int + 1} ${uiLabelMap.CommonOf} ${viewIndexMax}</option>
-          <#list 1..viewIndexMax as curViewNum>
-            <option value="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${curViewNum?int - 1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>">${uiLabelMap.CommonGotoPage} ${curViewNum}</option>
+          <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int + 1} ${uiLabelMap.CommonOf} ${viewIndexMax + 1}</option>
+          <#list 0..viewIndexMax as curViewNum>
+            <option value="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${curViewNum?int}/~clearSearch=N</@ofbizUrl>">${uiLabelMap.CommonGotoPage} ${curViewNum + 1}</option>
           </#list>
         </select>
         <#-- End Page Select Drop-Down -->
         <b>
-        <#if 0 < viewIndex?int>
-          <a href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${viewIndex-1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonPrevious}</a> |
+        <#if (viewIndex?int > 0)>
+          <a href="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex?int - 1}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonPrevious}</a> |
         </#if>
-        <#if 0 < listSize?int>
+        <#if (listSize?int > 0)>
           <span class="tabletext">${lowIndex+1} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize}</span>
         </#if>
         <#if highIndex?int < listSize?int>
-          | <a href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${viewIndex+1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonNext}</a>
+          | <a href="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex+1}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonNext}</a>
         </#if>
         </b>
     </div>
@@ -66,23 +66,23 @@
 <#if productIds?has_content>
     <div class="product-prevnext">
         <#-- Start Page Select Drop-Down -->
-        <#assign viewIndexMax = Static["java.lang.Math"].ceil(listSize?double / viewSize?double)>
+        <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize - 1)?double / viewSize?double)>
         <select name="pageSelect" class="selectBox" onchange="window.location=this[this.selectedIndex].value;">
-          <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int + 1} ${uiLabelMap.CommonOf} ${viewIndexMax}</option>
-          <#list 1..viewIndexMax as curViewNum>
-            <option value="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${curViewNum?int - 1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>">${uiLabelMap.CommonGotoPage} ${curViewNum}</option>
+          <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int + 1} ${uiLabelMap.CommonOf} ${viewIndexMax + 1}</option>
+          <#list 0..viewIndexMax as curViewNum>
+            <option value="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${curViewNum?int}/~clearSearch=N</@ofbizUrl>">${uiLabelMap.CommonGotoPage} ${curViewNum + 1}</option>
           </#list>
         </select>
         <#-- End Page Select Drop-Down -->
         <b>
-        <#if 0 < viewIndex?int>
-          <a href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${viewIndex-1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonPrevious}</a> |
+        <#if (viewIndex?int > 0)>
+          <a href="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex?int - 1}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonPrevious}</a> |
         </#if>
-        <#if 0 < listSize?int>
+        <#if (listSize?int > 0)>
           <span class="tabletext">${lowIndex+1} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize}</span>
         </#if>
         <#if highIndex?int < listSize?int>
-          | <a href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${viewIndex+1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonNext}</a>
+          | <a href="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex+1}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonNext}</a>
         </#if>
         </b>
     </div>