Commit 6d6f1f12 by Tran Hoang Viet

VietTH: Fix review code social feature

parent a9b16269
...@@ -38,7 +38,7 @@ label.error{ ...@@ -38,7 +38,7 @@ label.error{
-moz-box-shadow: 0px 1px 5px 0px rgba(0,0,0,0.72); -moz-box-shadow: 0px 1px 5px 0px rgba(0,0,0,0.72);
box-shadow: 0px 1px 5px 0px rgba(0,0,0,0.72); box-shadow: 0px 1px 5px 0px rgba(0,0,0,0.72);
background-color: #F3F3F3; background-color: #F3F3F3;
.share-scocial{ .share-social{
display: block; display: block;
} }
} }
...@@ -47,6 +47,12 @@ label.error{ ...@@ -47,6 +47,12 @@ label.error{
position: relative; position: relative;
&.disable{ &.disable{
opacity: 0.4; opacity: 0.4;
img{
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;
filter: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' height='0'><filter id='greyscale'><feColorMatrix type='matrix' values='0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0' /></filter></svg>#greyscale");
}
} }
img{ img{
height: 180px; height: 180px;
...@@ -55,7 +61,7 @@ label.error{ ...@@ -55,7 +61,7 @@ label.error{
} }
} }
.share-scocial{ .share-social{
display: none; display: none;
text-align: center; text-align: center;
margin-left: -15px; margin-left: -15px;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
font-size: 16px; font-size: 16px;
} }
.share-scocial{ .share-social{
display: block !important; display: block !important;
} }
} }
\ No newline at end of file
module ScocialHelper module SocialHelper
def facebook_share_url(url) def facebook_share_url(url)
"https://www.facebook.com/sharer/sharer.php?u=#{url || request.original_url}" "https://www.facebook.com/sharer/sharer.php?u=#{url || request.original_url}"
end end
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
= render 'layouts/cart' = render 'layouts/cart'
.row .row
.col-md-12 .col-md-12
= render 'layouts/share_scocial' = render 'layouts/share_social'
.col-md-10 .col-md-10
= yield = yield
......
%h3.title Checkout %h3.title Checkout
- if cart_valid? - if cart_valid?
#checkout-cart #checkout-cart.table-responsive
= form_for Order.new do |f| = form_for Order.new do |f|
%table.table %table.table
%thead %thead
......
.product-addto-cart.input-group .product-addto-cart.input-group
- max_quantity = product.stock - current_user.cart.find(product).try(:quantity).to_i - max_quantity = product.stock
- max_quantity -= current_user.cart.find(product).try(:quantity).to_i if user_signed_in?
= form_tag add_cart_product_path(product), method: :get, class: 'form-quantity' do = form_tag add_cart_product_path(product), method: :get, class: 'form-quantity' do
= text_field_tag :quantity, 1, class: 'form-control quantity' = text_field_tag :quantity, 1, class: 'form-control quantity'
= hidden_field_tag :stock, max_quantity, class: 'max-quantity' = hidden_field_tag :stock, max_quantity, class: 'max-quantity'
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
.clearfix .clearfix
.share-scocial .share-social
= link_to facebook_share_url(product_url(product)), class: 'facebook', target: '_blank' do = link_to facebook_share_url(product_url(product)), class: 'facebook', target: '_blank' do
= image_tag 'facebook.png' = image_tag 'facebook.png'
= link_to twitter_share_url(product_url(product)), class: 'twitter', target: '_blank' do = link_to twitter_share_url(product_url(product)), class: 'twitter', target: '_blank' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment