Skip to content

Commit

Permalink
Merge pull request #609 from awesto/fixes/hide-watch-list-icon
Browse files Browse the repository at this point in the history
Fixes/hide watch list icon
  • Loading branch information
jrief committed Sep 19, 2017
2 parents 4cf55e3 + 2059ad0 commit a0e9f50
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
5 changes: 4 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
Changelog for django-SHOP
=========================

0.11.2
======
* Do not render buttons and links related to the watch-list, when it is not available.


0.11.1
======
Expand Down Expand Up @@ -61,7 +65,6 @@ Changelog for django-SHOP
* Fallback to hard-coded URL if CMS page for "Continue Shopping" is missing.



0.10.2
======

Expand Down
4 changes: 4 additions & 0 deletions shop/templates/shop/catalog/product-add2cart.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
{% addtoblock "js" %}<script src="{% static 'shop/js/catalog.js' %}" type="text/javascript"></script>{% endaddtoblock %}
{% addtoblock "ng-requires" %}django.shop.catalog{% endaddtoblock %}

{% page_url "shop-watch-list" as shop_watch_list_url %}{% if not shop_watch_list_url %}{% url "shop-watch-list" as shop_watch_list_url %}{% endif %}

{% block add-product-to-cart-panel %}{% with inline_styles=instance.inline_styles %}
<div class="panel panel-default"{% if inline_styles %} style="{{ inline_styles }}"{% endif %}>
<div class="panel-heading">
Expand Down Expand Up @@ -44,7 +46,9 @@ <h3 class="panel-title">{% trans "Order Product" %}</h3>
<tr>
<td></td>
<td class="vertical-align-middle">
{% if shop_watch_list_url %}
<button class="btn btn-info btn-block btn-xs" ng-click="addToCart('{% url 'shop:watch-list' %}', {watch: true})">{% trans "Watch product" %}</button>
{% endif %}
</td>
<td>
<button class="btn btn-primary btn-block" ng-click="addToCart('{% url 'shop:cart-list' %}')">{% trans "Add to cart" %}</button>
Expand Down
11 changes: 8 additions & 3 deletions shop/templates/shop/navbar/watch-icon.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{% load cms_tags %}
{% page_url "shop-watch-list" as shop_watch_list_url %}{% if not shop_watch_list_url %}{% url "shop-watch-list" as shop_watch_list_url %}{% endif %}
{% load cms_tags i18n %}
{% page_url "shop-watch-list" as shop_watch_list_url %}
{% if shop_watch_list_url %}
{% page_attribute 'menu_title' 'shop-watch-list' as tooltip %}
{% else %}
{% url "shop-watch-list" as shop_watch_list_url %}
{% trans "Watch List" as tooltip %}
{% endif %}
{% if shop_watch_list_url %}
{% page_attribute 'menu_title' 'shop-watch-list' as tooltip %}
<li><a href="{{ shop_watch_list_url }}" title="{{ tooltip }}"><i class="fa fa-heart fa-lg" uib-tooltip="{{ tooltip }}"></i></a></li>
{% endif %}

0 comments on commit a0e9f50

Please sign in to comment.