spree_favorite_products 2.2.2 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -1
- data/app/models/spree/product_decorator.rb +1 -1
- data/app/models/spree/user_decorator.rb +1 -1
- data/app/views/spree/favorite_products/destroy.js.erb +3 -0
- data/app/views/spree/favorite_products/index.html.erb +3 -3
- data/spec/models/spree/product_decorator_spec.rb +1 -1
- data/spec/models/spree/user_decorator_spec.rb +1 -1
- data/spree_favorite_products.gemspec +1 -1
- metadata +4 -4
data/README.md
CHANGED
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
} else {
|
|
6
6
|
$("#favorite_product_<%= @favorite.product_id%>").remove();
|
|
7
7
|
alert("Successfully removed favorite product from your list");
|
|
8
|
+
if (!$('.favorite_product').length) {
|
|
9
|
+
window.location = '<%= favorite_products_path %>'
|
|
10
|
+
}
|
|
8
11
|
}
|
|
9
12
|
<% else %>
|
|
10
13
|
alert("Could not remove product form your list")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div data-hook="account_my_favorite_products" class="account-my-favorite-products commonform">
|
|
2
2
|
<h3><%= Spree.t(:my_favorite_products) %></h3>
|
|
3
3
|
<% if @favorite_products.present? %>
|
|
4
|
-
<table class="favorite-products order-summary">
|
|
4
|
+
<table class="favorite-products order-summary" width="100%">
|
|
5
5
|
<thead>
|
|
6
6
|
<tr>
|
|
7
7
|
<th class="favorite-product-image"><%= Spree.t(:product_image) %></th>
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
</thead>
|
|
12
12
|
<tbody>
|
|
13
13
|
<% @favorite_products.each do |product| %>
|
|
14
|
-
<tr class="<%= cycle('even', 'odd') %>" id="favorite_product_<%= product.id %>">
|
|
14
|
+
<tr class="<%= cycle('even', 'odd') %> favorite_product" id="favorite_product_<%= product.id %>">
|
|
15
15
|
<td class="favorite-product-image"><%= link_to small_image(product), product_path(product) %></td>
|
|
16
16
|
<td class="favorite-product-name"><%= product.name %></td>
|
|
17
|
-
<td class="favorite-product-remove"><%= link_to 'Remove', favorite_product_path(:id => product.id), :method => :delete, :remote => true %>
|
|
17
|
+
<td class="favorite-product-remove"><%= link_to 'Remove', favorite_product_path(:id => product.id), :method => :delete, :remote => true, :confirm => 'Are you sure you want to remove the product?' %>
|
|
18
18
|
</tr>
|
|
19
19
|
<% end %>
|
|
20
20
|
</tbody>
|
|
@@ -15,7 +15,7 @@ describe Spree::Product do
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
it { should have_many(:favorites) }
|
|
18
|
+
it { should have_many(:favorites).dependent(:destroy) }
|
|
19
19
|
it { should have_many(:favorite_users).through(:favorites).class_name('Spree::User') }
|
|
20
20
|
|
|
21
21
|
describe "Spree::Product.favorite" do
|
|
@@ -11,7 +11,7 @@ describe Spree::User do
|
|
|
11
11
|
favorite.save!
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
it { should have_many(:favorites) }
|
|
14
|
+
it { should have_many(:favorites).dependent(:destroy) }
|
|
15
15
|
it { should have_many(:favorite_products).through(:favorites).class_name('Spree::Product') }
|
|
16
16
|
|
|
17
17
|
describe "has_favorite_product?" do
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Gem::Specification.new do |s|
|
|
3
3
|
s.platform = Gem::Platform::RUBY
|
|
4
4
|
s.name = 'spree_favorite_products'
|
|
5
|
-
s.version = '2.2.
|
|
5
|
+
s.version = '2.2.3'
|
|
6
6
|
s.summary = 'Favorite Products in Spree'
|
|
7
7
|
s.description = 'This extension adds the following features: 1. Adds a link Mark as favorite on product detail page. 2. Favorite Products tab on header 3. Favorite Products tab in admin section'
|
|
8
8
|
s.required_ruby_version = '>= 1.9.3'
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spree_favorite_products
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 1
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 2
|
|
8
8
|
- 2
|
|
9
|
-
-
|
|
10
|
-
version: 2.2.
|
|
9
|
+
- 3
|
|
10
|
+
version: 2.2.3
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Mohit Bansal
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2014-
|
|
18
|
+
date: 2014-05-15 00:00:00 Z
|
|
19
19
|
dependencies:
|
|
20
20
|
- !ruby/object:Gem::Dependency
|
|
21
21
|
name: spree_core
|