Skip to content

Commit

Permalink
Merge branch 'release/3.4.1.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunbhardwaj committed May 18, 2015
2 parents fc9eb84 + 178a850 commit 52af504
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 29 deletions.
15 changes: 13 additions & 2 deletions static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1674,7 +1674,7 @@ border-top: 1px solid rgba(248, 248, 248, 0.2);
padding: 5px;
}
.related-products{
padding-top: 5px;
padding: 5px 0 15px 0;
}
.product-short-description{
font-size: 13px;
Expand Down Expand Up @@ -1778,7 +1778,7 @@ h3.product-item-name{
vertical-align: middle;
}
.btn-related-item-add-cart{
margin: 10px 0 20px 0;
margin-top: 10px;
}
.order-detail-description .panel-default > .panel-heading{
background: transparent;
Expand Down Expand Up @@ -1873,4 +1873,15 @@ h3.product-item-name{
}
#search_form{
position: relative;
}
.cart-add-msg{
background: #fff;
border: 1px solid #eee;
position: absolute;
top: auto;
right: 15px;
width: 242px;
margin-top: 17px;
z-index: 100;
padding: 10px;
}
38 changes: 27 additions & 11 deletions templates/webshop/base.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@
<li class="my-cart">
<a href="" class="my-cart-show">{{ _('My Cart') }} <span class="quantity">0</span></a>
</li>
<li class="hidden cart-message">
<div class="cart-add-msg">
</div>
</li>
</ul>
</div>
{% endif %}
Expand Down Expand Up @@ -341,6 +345,15 @@
</div>
</div>
</footer>
<script type="text/html" id='cart-message'>
<div class="col-sm-5">
<img class="img-responsive" src="<%= line.image %>" >
</div>
<div class="col-sm-7">
<p><%= line.display_name %> <br> added to your cart</p>
</div>
</script>

<script type="text/html" id='cart-html-append'>

<a href="{{ url_for('nereid.cart.view_cart') }}" class="my-cart-show">{{ _('My Cart') }} <span class="quantity"><%= parseInt(user_status.cart_size) %></span></a>
Expand Down Expand Up @@ -466,8 +479,16 @@
$.each(lines, function(index, line) {
$(".product-" + line.product.id + "-buy-now-btn")
.attr('disabled', 'disabled');
var isDisabled=$(".product-" + line.product.id + "-buy-now-btn").prop('disabled');
if(isDisabled){
$('.tooltip-bottom-'+ line.product.id).tooltip({
title: "This product is already added to the cart",
placement: "bottom"
});
}
});
}
function updatedCart(){
$.post("{{ url_for('nereid.website.user_status') }}", function(data){
var template = $("#cart-html-append").html();
Expand All @@ -481,7 +502,6 @@
removeFromCart(delUrl);
return true;
}
e.preventDefault();
var alreadySubmitted = false;
Expand Down Expand Up @@ -558,16 +578,12 @@
updatedCart();
}
})
.done(function(){
$.pnotify({
title: 'message',
text: 'Product Added to your Cart',
history: false,
nonblock: true,
delay:2000,
nonblock_opacity: .4,
animation: 'show'
});
.done(function(result){
$(".cart-message").removeClass("hidden").show();
var template = $("#cart-message").html();
console.log(result.line);
$(".cart-add-msg").html(_.template(template, {'line': result.line}));
$(".cart-message").removeClass("hidden").show().delay(3000).fadeOut();
});
});
</script>
Expand Down
32 changes: 17 additions & 15 deletions templates/webshop/product.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,15 @@
{% if product.salable %}
<div class="col-md-12 col-sm-12 col-xs-12 buy-now">
<form action="{{ url_for("nereid.cart.add_to_cart") }}" method="post" id="product-buy-now" class="add-to-cart" autocomplete="off" data-ga-event-label="Add To Cart" data-ga-product-name="{{ product.name }}" data-ga-product-category="{{ product.category and product.category.name or None }}" data-ga-product-price="{{ product.sale_price()|currencyformat(request.nereid_currency.code) }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="hidden" name="quantity" value="1"/>
<input type="hidden" name="size" id="size-id"/>
<input type="hidden" name="product" value="{{ product.id }}"/>
<input type="hidden" name="action" value="add"/>
<button class="btn btn-primary btn-buynow btn-block btn-lg product-buy-now product-{{ product.id }}-buy-now-btn" type="button" {% if not product.can_buy_from_eshop() %}disabled{% endif %}
quantity="1" id="buy-now-btn">Add to Cart</button>

<div class="tooltip-bottom-{{ product.id }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="hidden" name="quantity" value="1"/>
<input type="hidden" name="size" id="size-id"/>
<input type="hidden" name="product" value="{{ product.id }}"/>
<input type="hidden" name="action" value="add"/>
<button class="btn btn-primary btn-buynow btn-block btn-lg product-buy-now product-{{ product.id }}-buy-now-btn" type="button"{% if not product.can_buy_from_eshop() %}disabled{% endif %}
quantity="1" id="buy-now-btn">Add to Cart</button>
</div>
</form>
</div>
{% if product.type == 'goods' %}
Expand Down Expand Up @@ -258,12 +259,14 @@
<a class="btn btn-related-item-add-cart" href="{{ related_product.get_absolute_url() }}">Add to Cart</a>
{% else %}
<form action="{{ url_for("nereid.cart.add_to_cart") }}" method="post" id="product-buy-now" autocomplete="off" class="form-related-inline related-products add-to-cart" data-ga-event-label="Add To Cart Related Product" data-ga-product-name="{{ related_product.name }}" data-ga-product-category="{{ related_product.category and related_product.category.name or None }}" data-ga-product-price="{{ related_product.sale_price()|currencyformat(request.nereid_currency.code) }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="hidden" name="quantity" value="1"/>
<input type="hidden" name="size" id="size-id"/>
<input type="hidden" name="product" value="{{ related_product.id }}"/>
<input type="hidden" name="action" value="add"/>
<button class="btn btn-related-item-add-cart product-buy-now product-{{ related_product.id }}-buy-now-btn" type="button" quantity="1" id="buy-now-btn">Add to Cart</button>
<div class="tooltip-bottom-{{ related_product.id }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="hidden" name="quantity" value="1"/>
<input type="hidden" name="size" id="size-id"/>
<input type="hidden" name="product" value="{{ related_product.id }}"/>
<input type="hidden" name="action" value="add"/>
<button class="btn btn-related-item-add-cart product-buy-now product-{{ related_product.id }}-buy-now-btn" type="button" quantity="1" id="buy-now-btn">Add to Cart</button>
</div>
</form>
{% endif %}
{% else %}
Expand Down Expand Up @@ -469,7 +472,6 @@
var wishlist_id = $(this).val();
var product_id = {{ product.id }};
var data = {'wishlist': wishlist_id, 'product': product_id, 'action': "add"}
console.log(data);
$.ajax({
type: "POST",
url: "{{ url_for('wishlist.wishlist.wishlist_product') }}",
Expand Down
2 changes: 1 addition & 1 deletion tryton.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tryton]
version=3.4.1.9
version=3.4.1.10
depends:
nereid
nereid_cms
Expand Down

0 comments on commit 52af504

Please sign in to comment.