Author: jleroux
Date: Mon Jun 9 14:33:06 2008 New Revision: 665899 URL: http://svn.apache.org/viewvc?rev=665899&view=rev Log: A patch from Bruno Busco "Pagination controls should not be displayed on a single page list" (https://issues.apache.org/jira/browse/OFBIZ-1827) - OFBIZ-1827 Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/categorydetail.ftl ofbiz/trunk/framework/images/webapp/images/ecommain.css Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/categorydetail.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/categorydetail.ftl?rev=665899&r1=665898&r2=665899&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/categorydetail.ftl (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/categorydetail.ftl Mon Jun 9 14:33:06 2008 @@ -17,6 +17,32 @@ under the License. --> +<#macro paginationControls> + <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize - 1)?double / viewSize?double)> + <#if (viewIndexMax?int > 1)> + <div class="product-prevnext"> + <#-- Start Page Select Drop-Down --> + <select name="pageSelect" onchange="window.location=this[this.selectedIndex].value;"> + <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int} ${uiLabelMap.CommonOf} ${viewIndexMax + 1}</option> + <#list 0..viewIndexMax as curViewNum> + <option value="<@ofbizUrl>category/~category_id=${productCategoryId}/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${curViewNum?int + 1}</@ofbizUrl>">${uiLabelMap.CommonGotoPage} ${curViewNum + 1}</option> + </#list> + </select> + <#-- End Page Select Drop-Down --> + <#if (viewIndex?int > 1)> + <a href="<@ofbizUrl>category/~category_id=${productCategoryId}/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex?int - 1}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonPrevious}</a> | + </#if> + <#if (listSize?int > 0)> + <span class="tabletext">${lowIndex} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize}</span> + </#if> + <#if highIndex?int < listSize?int> + | <a href="<@ofbizUrl>category/~category_id=${productCategoryId}/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex?int + 1}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonNext}</a> + </#if> + </div> + </#if> +</#macro> + + <#if productCategory?exists> <h1> <div>${categoryContentWrapper.get("CATEGORY_NAME")?if_exists}</div> @@ -58,29 +84,7 @@ </#if> <#if productCategoryMembers?has_content> - <div class="product-prevnext"> - <#-- Start Page Select Drop-Down --> - <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize - 1)?double / viewSize?double)> - <select name="pageSelect" onchange="window.location=this[this.selectedIndex].value;"> - <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int} ${uiLabelMap.CommonOf} ${viewIndexMax + 1}</option> - <#list 0..viewIndexMax as curViewNum> - <option value="<@ofbizUrl>category/~category_id=${productCategoryId}/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${curViewNum?int + 1}</@ofbizUrl>">${uiLabelMap.CommonGotoPage} ${curViewNum + 1}</option> - </#list> - </select> - <#-- End Page Select Drop-Down --> - <b> - <#if (viewIndex?int > 1)> - <a href="<@ofbizUrl>category/~category_id=${productCategoryId}/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex?int - 1}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonPrevious}</a> | - </#if> - <#if (listSize?int > 0)> - <span class="tabletext">${lowIndex} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize}</span> - </#if> - <#if highIndex?int < listSize?int> - | <a href="<@ofbizUrl>category/~category_id=${productCategoryId}/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex?int + 1}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonNext}</a> - </#if> - </b> - </div> - + <@paginationControls/> <div class="productsummary-container"> <#list productCategoryMembers as productCategoryMember> ${setRequestAttribute("optProductId", productCategoryMember.productId)} @@ -89,30 +93,7 @@ ${screens.render(productsummaryScreen)} </#list> </div> - - <div class="product-prevnext"> - <#-- Start Page Select Drop-Down --> - <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize - 1)?double / viewSize?double)> - <select name="pageSelect" onchange="window.location=this[this.selectedIndex].value;"> - <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int} ${uiLabelMap.CommonOf} ${viewIndexMax + 1}</option> - <#list 0..viewIndexMax as curViewNum> - <option value="<@ofbizUrl>category/~category_id=${productCategoryId}/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${curViewNum?int + 1}</@ofbizUrl>">${uiLabelMap.CommonGotoPage} ${curViewNum + 1}</option> - </#list> - </select> - <#-- End Page Select Drop-Down --> - <b> - <#if (viewIndex?int > 1)> - <a href="<@ofbizUrl>category?category_id=${productCategoryId}&VIEW_SIZE=${viewSize}&VIEW_INDEX=${viewIndex?int - 1}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonPrevious}</a> | - </#if> - <#if (listSize?int > 0)> - <span class="tabletext">${lowIndex} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize}</span> - </#if> - <#if highIndex?int < listSize?int> - | <a href="<@ofbizUrl>category?category_id=${productCategoryId}&VIEW_SIZE=${viewSize}&VIEW_INDEX=${viewIndex?int + 1}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonNext}</a> - </#if> - </b> - </div> - + <@paginationControls/> <#else> <div><hr class='sepbar'/></div> <div class='tabletext'>${uiLabelMap.ProductNoProductsInThisCategory}</div> Modified: ofbiz/trunk/framework/images/webapp/images/ecommain.css URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/ecommain.css?rev=665899&r1=665898&r2=665899&view=diff ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/ecommain.css (original) +++ ofbiz/trunk/framework/images/webapp/images/ecommain.css Mon Jun 9 14:33:06 2008 @@ -885,6 +885,10 @@ text-align: right; } +.product-prevnext .tabletext { +font-weight: bold; +} + .productcategorylink-container { position: relative; margin-top: 10px; @@ -991,4 +995,4 @@ .bothclear{ height:1%; clear: both; -} \ No newline at end of file +} |
Free forum by Nabble | Edit this page |