spree_core 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/spree/admin/products_controller.rb +4 -0
- data/app/controllers/spree/products_controller.rb +1 -1
- data/app/models/spree/calculator/per_item.rb +4 -1
- data/app/models/spree/order.rb +4 -10
- data/app/views/spree/admin/payments/new.html.erb +11 -6
- data/config/locales/en.yml +2 -0
- data/lib/spree/core/engine.rb +0 -4
- data/lib/spree/core/url_helpers.rb +9 -0
- data/lib/spree/core/version.rb +1 -1
- metadata +31 -31
- data/app/views/spree/admin/products/show.html.erb +0 -4
@@ -13,7 +13,7 @@ module Spree
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def show
|
16
|
-
@product = Product.find_by_permalink!(params[:id])
|
16
|
+
@product = Product.active.find_by_permalink!(params[:id])
|
17
17
|
return unless @product
|
18
18
|
|
19
19
|
@variants = Variant.active.includes([:option_values, :images]).where(:product_id => @product.id)
|
data/app/models/spree/order.rb
CHANGED
@@ -553,11 +553,8 @@ module Spree
|
|
553
553
|
end
|
554
554
|
|
555
555
|
def restock_items!
|
556
|
-
|
557
|
-
|
558
|
-
line_item = line_items.find_by_variant_id(inventory_unit.variant_id)
|
559
|
-
InventoryUnit.decrease(self, inventory_unit.variant, line_item.quantity)
|
560
|
-
end
|
556
|
+
line_items.each do |line_item|
|
557
|
+
InventoryUnit.decrease(self, line_item.variant, line_item.quantity)
|
561
558
|
end
|
562
559
|
end
|
563
560
|
|
@@ -566,11 +563,8 @@ module Spree
|
|
566
563
|
end
|
567
564
|
|
568
565
|
def unstock_items!
|
569
|
-
|
570
|
-
|
571
|
-
line_item = line_items.find_by_variant_id(inventory_unit.variant_id)
|
572
|
-
InventoryUnit.increase(self, inventory_unit.variant, line_item.quantity)
|
573
|
-
end
|
566
|
+
line_items.each do |line_item|
|
567
|
+
InventoryUnit.increase(self, line_item.variant, line_item.quantity)
|
574
568
|
end
|
575
569
|
end
|
576
570
|
|
@@ -2,16 +2,21 @@
|
|
2
2
|
|
3
3
|
<h2><%= t(:new) %> <%= t("activerecord.models.#{@payment.class.to_s.underscore}.one") %></h2>
|
4
4
|
|
5
|
-
|
5
|
+
<% if @payment_methods.any? %>
|
6
|
+
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @payment } %>
|
6
7
|
|
7
|
-
<%= form_for @payment, :url => admin_order_payments_path(@order) do |f| %>
|
8
|
+
<%= form_for @payment, :url => admin_order_payments_path(@order) do |f| %>
|
8
9
|
|
9
|
-
|
10
|
+
<%= render :partial => 'form', :locals => { :f => f } %>
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
<p class="form-buttons" data-hook="buttons">
|
13
|
+
<%= button @order.cart? ? t(:continue) : t(:update) %>
|
14
|
+
</p>
|
14
15
|
|
16
|
+
<% end %>
|
17
|
+
<% else %>
|
18
|
+
<%= t(:cannot_create_payment_without_payment_methods) %>
|
19
|
+
<%= link_to t(:please_define_payment_methods), admin_payment_methods_url %>
|
15
20
|
<% end %>
|
16
21
|
|
17
22
|
<% content_for :head do %>
|
data/config/locales/en.yml
CHANGED
@@ -284,6 +284,7 @@ en:
|
|
284
284
|
cancel_my_account: Cancel my account
|
285
285
|
cancel_my_account_description: "Unhappy?"
|
286
286
|
canceled: Canceled
|
287
|
+
cannot_create_payment_without_payment_methods: You cannot create a payment for an order without any payment methods defined.
|
287
288
|
cannot_create_returns: Cannot create returns as this order has no shipped units.
|
288
289
|
cannot_perform_operation: "Cannot perform requested operation"
|
289
290
|
capture: Capture
|
@@ -668,6 +669,7 @@ en:
|
|
668
669
|
phone: Phone
|
669
670
|
place_order: Place Order
|
670
671
|
please_create_user: "Please create a user account"
|
672
|
+
please_define_payment_methods: "Please define some payment methods first."
|
671
673
|
powered_by: "Powered by"
|
672
674
|
presentation: Presentation
|
673
675
|
preview: Preview
|
data/lib/spree/core/engine.rb
CHANGED
@@ -74,10 +74,6 @@ module Spree
|
|
74
74
|
app.config.assets.precompile += ['store/all.*', 'admin/all.*', 'admin/orders/edit_form.js', 'admin/address_states.js', 'jqPlot/excanvas.min.js', 'admin/images/new.js', 'jquery.jstree/themes/apple/*']
|
75
75
|
end
|
76
76
|
|
77
|
-
initializer "spree.asset.pipeline" do |app|
|
78
|
-
app.config.assets.debug = false
|
79
|
-
end
|
80
|
-
|
81
77
|
initializer "spree.mail.settings" do |app|
|
82
78
|
if Spree::MailMethod.table_exists?
|
83
79
|
Spree::Core::MailSettings.init
|
data/lib/spree/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-04-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: acts_as_list
|
16
|
-
requirement: &
|
16
|
+
requirement: &70302537108460 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - =
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.1.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70302537108460
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: nested_set
|
27
|
-
requirement: &
|
27
|
+
requirement: &70302537107400 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - =
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.6.8
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70302537107400
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: jquery-rails
|
38
|
-
requirement: &
|
38
|
+
requirement: &70302537106340 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -46,10 +46,10 @@ dependencies:
|
|
46
46
|
version: 1.0.19
|
47
47
|
type: :runtime
|
48
48
|
prerelease: false
|
49
|
-
version_requirements: *
|
49
|
+
version_requirements: *70302537106340
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: highline
|
52
|
-
requirement: &
|
52
|
+
requirement: &70302537104500 !ruby/object:Gem::Requirement
|
53
53
|
none: false
|
54
54
|
requirements:
|
55
55
|
- - =
|
@@ -57,10 +57,10 @@ dependencies:
|
|
57
57
|
version: 1.6.8
|
58
58
|
type: :runtime
|
59
59
|
prerelease: false
|
60
|
-
version_requirements: *
|
60
|
+
version_requirements: *70302537104500
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: state_machine
|
63
|
-
requirement: &
|
63
|
+
requirement: &70302537124460 !ruby/object:Gem::Requirement
|
64
64
|
none: false
|
65
65
|
requirements:
|
66
66
|
- - =
|
@@ -68,10 +68,10 @@ dependencies:
|
|
68
68
|
version: 1.1.1
|
69
69
|
type: :runtime
|
70
70
|
prerelease: false
|
71
|
-
version_requirements: *
|
71
|
+
version_requirements: *70302537124460
|
72
72
|
- !ruby/object:Gem::Dependency
|
73
73
|
name: ffaker
|
74
|
-
requirement: &
|
74
|
+
requirement: &70302537123780 !ruby/object:Gem::Requirement
|
75
75
|
none: false
|
76
76
|
requirements:
|
77
77
|
- - ~>
|
@@ -79,21 +79,21 @@ dependencies:
|
|
79
79
|
version: 1.12.0
|
80
80
|
type: :runtime
|
81
81
|
prerelease: false
|
82
|
-
version_requirements: *
|
82
|
+
version_requirements: *70302537123780
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: paperclip
|
85
|
-
requirement: &
|
85
|
+
requirement: &70302537123120 !ruby/object:Gem::Requirement
|
86
86
|
none: false
|
87
87
|
requirements:
|
88
88
|
- - =
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: 2.
|
90
|
+
version: 2.7.0
|
91
91
|
type: :runtime
|
92
92
|
prerelease: false
|
93
|
-
version_requirements: *
|
93
|
+
version_requirements: *70302537123120
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
95
|
name: meta_search
|
96
|
-
requirement: &
|
96
|
+
requirement: &70302537122500 !ruby/object:Gem::Requirement
|
97
97
|
none: false
|
98
98
|
requirements:
|
99
99
|
- - =
|
@@ -101,10 +101,10 @@ dependencies:
|
|
101
101
|
version: 1.1.1
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
|
-
version_requirements: *
|
104
|
+
version_requirements: *70302537122500
|
105
105
|
- !ruby/object:Gem::Dependency
|
106
106
|
name: activemerchant
|
107
|
-
requirement: &
|
107
|
+
requirement: &70302537121860 !ruby/object:Gem::Requirement
|
108
108
|
none: false
|
109
109
|
requirements:
|
110
110
|
- - =
|
@@ -112,10 +112,10 @@ dependencies:
|
|
112
112
|
version: 1.20.1
|
113
113
|
type: :runtime
|
114
114
|
prerelease: false
|
115
|
-
version_requirements: *
|
115
|
+
version_requirements: *70302537121860
|
116
116
|
- !ruby/object:Gem::Dependency
|
117
117
|
name: rails
|
118
|
-
requirement: &
|
118
|
+
requirement: &70302537121300 !ruby/object:Gem::Requirement
|
119
119
|
none: false
|
120
120
|
requirements:
|
121
121
|
- - ! '>='
|
@@ -126,10 +126,10 @@ dependencies:
|
|
126
126
|
version: 3.1.4
|
127
127
|
type: :runtime
|
128
128
|
prerelease: false
|
129
|
-
version_requirements: *
|
129
|
+
version_requirements: *70302537121300
|
130
130
|
- !ruby/object:Gem::Dependency
|
131
131
|
name: kaminari
|
132
|
-
requirement: &
|
132
|
+
requirement: &70302537119740 !ruby/object:Gem::Requirement
|
133
133
|
none: false
|
134
134
|
requirements:
|
135
135
|
- - ! '>='
|
@@ -137,10 +137,10 @@ dependencies:
|
|
137
137
|
version: 0.13.0
|
138
138
|
type: :runtime
|
139
139
|
prerelease: false
|
140
|
-
version_requirements: *
|
140
|
+
version_requirements: *70302537119740
|
141
141
|
- !ruby/object:Gem::Dependency
|
142
142
|
name: deface
|
143
|
-
requirement: &
|
143
|
+
requirement: &70302537118780 !ruby/object:Gem::Requirement
|
144
144
|
none: false
|
145
145
|
requirements:
|
146
146
|
- - ! '>='
|
@@ -148,10 +148,10 @@ dependencies:
|
|
148
148
|
version: 0.7.2
|
149
149
|
type: :runtime
|
150
150
|
prerelease: false
|
151
|
-
version_requirements: *
|
151
|
+
version_requirements: *70302537118780
|
152
152
|
- !ruby/object:Gem::Dependency
|
153
153
|
name: stringex
|
154
|
-
requirement: &
|
154
|
+
requirement: &70302537117760 !ruby/object:Gem::Requirement
|
155
155
|
none: false
|
156
156
|
requirements:
|
157
157
|
- - ~>
|
@@ -159,7 +159,7 @@ dependencies:
|
|
159
159
|
version: 1.3.0
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
|
-
version_requirements: *
|
162
|
+
version_requirements: *70302537117760
|
163
163
|
description: Required dependency for Spree
|
164
164
|
email: sean@spreecommerce.com
|
165
165
|
executables: []
|
@@ -521,7 +521,6 @@ files:
|
|
521
521
|
- app/views/spree/admin/products/index.html.erb
|
522
522
|
- app/views/spree/admin/products/new.html.erb
|
523
523
|
- app/views/spree/admin/products/new.js.erb
|
524
|
-
- app/views/spree/admin/products/show.html.erb
|
525
524
|
- app/views/spree/admin/properties/_form.html.erb
|
526
525
|
- app/views/spree/admin/properties/edit.html.erb
|
527
526
|
- app/views/spree/admin/properties/filtered.html.erb
|
@@ -761,6 +760,7 @@ files:
|
|
761
760
|
- lib/spree/core/testing_support/factories.rb
|
762
761
|
- lib/spree/core/theme_support/hook_listener.rb
|
763
762
|
- lib/spree/core/theme_support.rb
|
763
|
+
- lib/spree/core/url_helpers.rb
|
764
764
|
- lib/spree/core/user_banners.rb
|
765
765
|
- lib/spree/core/version.rb
|
766
766
|
- lib/spree/core.rb
|
@@ -973,7 +973,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
973
973
|
version: '0'
|
974
974
|
segments:
|
975
975
|
- 0
|
976
|
-
hash: -
|
976
|
+
hash: -350126003318038634
|
977
977
|
requirements:
|
978
978
|
- none
|
979
979
|
rubyforge_project: spree_core
|