From 4ba78e73dda92a10d42e0d5ac0d1e71ce7dba8c3 Mon Sep 17 00:00:00 2001 From: marination Date: Tue, 8 Jun 2021 22:14:20 +0530 Subject: [PATCH] fix: Checkbox sizes and paging buttons - Show paging buttons at all times and enable/disable buttons - Define checkbox and radio button sizes within erpnext - Wishlist cards even height --- erpnext/e_commerce/product_view.js | 31 +++++++++++-------- erpnext/public/scss/shopping_cart.scss | 12 +++++++ .../generators/item/item_add_to_cart.html | 4 +-- erpnext/templates/generators/item_group.html | 5 ++- .../templates/includes/cart/cart_address.html | 2 +- erpnext/templates/includes/macros.html | 6 ++-- erpnext/www/all-products/index.html | 5 ++- 7 files changed, 41 insertions(+), 24 deletions(-) diff --git a/erpnext/e_commerce/product_view.js b/erpnext/e_commerce/product_view.js index 3a2cdaee27a..5ebf44ec5c7 100644 --- a/erpnext/e_commerce/product_view.js +++ b/erpnext/e_commerce/product_view.js @@ -140,20 +140,24 @@ erpnext.ProductView = class { let query_params = frappe.utils.get_query_params(); let start = query_params.start ? cint(JSON.parse(query_params.start)) : 0; let page_length = settings.products_per_page || 0; + let no_of_products = this.products.length; + + let prev_disable = start > 0 ? "" : "disabled"; + let next_disable = (no_of_products > page_length || no_of_products == page_length) ? "" : "disabled"; + + paging_html += ` + `; + + paging_html += ` + + `; - if (start > 0) { - paging_html += ` - `; - } - if (this.products.length > page_length || this.products.length == page_length) { - paging_html += ` - - `; - } paging_html += ``; $(".page_content").append(paging_html); @@ -240,6 +244,7 @@ erpnext.ProductView = class { name="discount" id="${ filter[0] }" data-filter-name="discount" data-filter-value="${ filter[0] }" + style="width: 14px !important" > ${ filter[1] } diff --git a/erpnext/public/scss/shopping_cart.scss b/erpnext/public/scss/shopping_cart.scss index 09a3de6a3de..ca3140c600f 100644 --- a/erpnext/public/scss/shopping_cart.scss +++ b/erpnext/public/scss/shopping_cart.scss @@ -185,6 +185,18 @@ body.product-page { } } +.product-filter { + width: 14px !important; + height: 14px !important; +} + +.discount-filter { + &:before { + width: 14px !important; + height: 14px !important; + } +} + .list-image { overflow: hidden; max-height: 200px; diff --git a/erpnext/templates/generators/item/item_add_to_cart.html b/erpnext/templates/generators/item/item_add_to_cart.html index d3bc097d8ec..fd243f5059e 100644 --- a/erpnext/templates/generators/item/item_add_to_cart.html +++ b/erpnext/templates/generators/item/item_add_to_cart.html @@ -100,7 +100,7 @@ {% if cart_settings.enable_wishlist %}