From 440650d4a2cb012ae0bfb347d95a3a3dd0f699b9 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 14 Nov 2016 13:13:53 +0530 Subject: [PATCH 01/11] [fix] view shopping cart dropdown (#6928) --- erpnext/public/css/website.css | 1 - erpnext/public/js/shopping_cart.js | 2 +- erpnext/public/less/website.less | 1 - erpnext/templates/generators/item.html | 63 +++++++++---------- .../includes/cart/cart_dropdown.html | 6 +- .../includes/cart/cart_items_dropdown.html | 1 - erpnext/templates/includes/macros.html | 11 +++- .../includes/navbar/navbar_items.html | 2 +- .../includes/order/order_macros.html | 9 +-- 9 files changed, 49 insertions(+), 47 deletions(-) diff --git a/erpnext/public/css/website.css b/erpnext/public/css/website.css index 2bfcd3ea69..6a1d311e98 100644 --- a/erpnext/public/css/website.css +++ b/erpnext/public/css/website.css @@ -181,7 +181,6 @@ } .cart-dropdown-container .cart-items-dropdown { max-height: 350px; - overflow: auto; } .cart-dropdown-container .cart-items-dropdown .cart-dropdown { display: block; diff --git a/erpnext/public/js/shopping_cart.js b/erpnext/public/js/shopping_cart.js index ace7fd81f3..1617283f74 100644 --- a/erpnext/public/js/shopping_cart.js +++ b/erpnext/public/js/shopping_cart.js @@ -65,7 +65,7 @@ $.extend(shopping_cart, { var cart_count = getCookie("cart_count"); if(cart_count) { - $(".shopping-cart").toggleClass('hidden', true); + $(".shopping-cart").toggleClass('hidden', false); } var $cart = $('.cart-icon'); diff --git a/erpnext/public/less/website.less b/erpnext/public/less/website.less index ce36e5f59a..b270b8bed7 100644 --- a/erpnext/public/less/website.less +++ b/erpnext/public/less/website.less @@ -233,7 +233,6 @@ .cart-items-dropdown { max-height: 350px; - overflow: auto; } .cart-items-dropdown .cart-dropdown { diff --git a/erpnext/templates/generators/item.html b/erpnext/templates/generators/item.html index 5a8116cc37..c0399a787a 100644 --- a/erpnext/templates/generators/item.html +++ b/erpnext/templates/generators/item.html @@ -3,7 +3,7 @@ {% block title %} {{ title }} {% endblock %} {% block breadcrumbs %} - {% include "templates/includes/breadcrumbs.html" %} + {% include "templates/includes/breadcrumbs.html" %} {% endblock %} {% block page_content %} @@ -25,17 +25,17 @@ {{ _("Item Code") }}: {{ variant and variant.name or name }}


- {% if has_variants %} - {% for d in attributes %} + {% if has_variants %} + {% for d in attributes %} {% if attribute_values[d.attribute] -%} - + {% endfor %} + +
{%- endif %} - {% endfor %} - {% endif %} + {% endfor %} + {% endif %}
@@ -56,18 +56,17 @@

-
-
- -
- -
+
+
+ +
+ +
@@ -101,10 +100,10 @@ {% endblock %} diff --git a/erpnext/templates/includes/cart/cart_dropdown.html b/erpnext/templates/includes/cart/cart_dropdown.html index 071b28182a..de29b56fbe 100644 --- a/erpnext/templates/includes/cart/cart_dropdown.html +++ b/erpnext/templates/includes/cart/cart_dropdown.html @@ -1,6 +1,6 @@
+ style="display: none;">
{{ _("Item") }} @@ -9,13 +9,13 @@ {{ _("Price") }}
- + {% if doc.items %}
{% include "templates/includes/cart/cart_items_dropdown.html" %}
- {{ _("Checkout") }} + {{ _("Checkout") }}
{% else %}

{{ _("Cart is Empty") }}

diff --git a/erpnext/templates/includes/cart/cart_items_dropdown.html b/erpnext/templates/includes/cart/cart_items_dropdown.html index 9a3dbf89ac..b2ba4312d6 100644 --- a/erpnext/templates/includes/cart/cart_items_dropdown.html +++ b/erpnext/templates/includes/cart/cart_items_dropdown.html @@ -7,7 +7,6 @@
{{ d.get_formatted("amount") }} -
{% endfor %} \ No newline at end of file diff --git a/erpnext/templates/includes/macros.html b/erpnext/templates/includes/macros.html index da21748f77..a25f313f60 100644 --- a/erpnext/templates/includes/macros.html +++ b/erpnext/templates/includes/macros.html @@ -1,7 +1,12 @@ {% macro product_image_square(website_image, css_class="") %} -{% if website_image -%} {%- endif %} -
+{% if website_image -%} + +{%- endif %} +
{% endmacro %} diff --git a/erpnext/templates/includes/navbar/navbar_items.html b/erpnext/templates/includes/navbar/navbar_items.html index f0c780d57d..87dea8f175 100644 --- a/erpnext/templates/includes/navbar/navbar_items.html +++ b/erpnext/templates/includes/navbar/navbar_items.html @@ -2,7 +2,7 @@ {% block navbar_right_extension %}