spree_core 0.70.3 → 0.70.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -40,7 +40,7 @@ $(document).ready(function(){
40
40
  });
41
41
  }
42
42
 
43
- $("#customer_search").autocomplete("/admin/users.json?authenticity_token=" + $('meta[name=csrf-token]').attr("content"), {
43
+ $("#customer_search").autocomplete("/admin/users.json?authenticity_token=" + encodeURIComponent($('meta[name=csrf-token]').attr("content")), {
44
44
  minChars: 5,
45
45
  delay: 1500,
46
46
  parse: prep_user_autocomplete_data,
@@ -60,10 +60,6 @@
60
60
  }
61
61
  }).triggerHandler('click');
62
62
 
63
- $('form.edit_order').submit(function() {
64
- $(this).find(':submit, :image').attr('disabled', true).removeClass('primary').addClass('disabled');
65
- });
66
-
67
63
  }
68
64
 
69
65
  if($('#checkout_form_payment').is('*')){
@@ -75,3 +71,9 @@
75
71
  }
76
72
  });
77
73
  })(jQuery);
74
+
75
+ function disableSaveOnClick() {
76
+ $('form.edit_spree_order').submit(function() {
77
+ $(this).find(':submit, :image').attr('disabled', true).removeClass('primary').addClass('disabled');
78
+ });
79
+ }
@@ -1,10 +1,10 @@
1
- class Calculator::PriceBucket < Calculator
1
+ class Calculator::PriceSack < Calculator
2
2
  preference :minimal_amount, :decimal, :default => 0
3
3
  preference :normal_amount, :decimal, :default => 0
4
4
  preference :discount_amount, :decimal, :default => 0
5
5
 
6
6
  def self.description
7
- I18n.t("price_bucket")
7
+ I18n.t("price_sack")
8
8
  end
9
9
 
10
10
  # as object we always get line items, as calculable we have Coupon, ShippingMethod
@@ -69,9 +69,15 @@ class Payment < ActiveRecord::Base
69
69
  end
70
70
 
71
71
  def process!
72
- if !processing? and source and source.respond_to?(:process!)
73
- started_processing!
74
- source.process!(self) # source is responsible for updating the payment state when it's done processing
72
+ if payment_method && payment_method.source_required?
73
+ if source
74
+ if !processing? && source.respond_to?(:process!)
75
+ started_processing!
76
+ source.process!(self) # source is responsible for updating the payment state when it's done processing
77
+ end
78
+ else
79
+ raise Spree::GatewayError.new(I18n.t(:payment_processing_failed))
80
+ end
75
81
  end
76
82
  end
77
83
 
@@ -45,4 +45,8 @@ class PaymentMethod < ActiveRecord::Base
45
45
  false
46
46
  end
47
47
 
48
+ def source_required?
49
+ true
50
+ end
51
+
48
52
  end
@@ -24,4 +24,8 @@ class PaymentMethod::Check < PaymentMethod
24
24
  payment.void
25
25
  true
26
26
  end
27
+
28
+ def source_required?
29
+ false
30
+ end
27
31
  end
@@ -27,4 +27,5 @@
27
27
  <hr class="space" />
28
28
  <div class="form-buttons" data-hook="buttons">
29
29
  <%= submit_tag t(:save_and_continue), :class => 'continue button primary' %>
30
+ <script>disableSaveOnClick();</script>
30
31
  </div>
@@ -672,7 +672,7 @@ en:
672
672
  preview: Preview
673
673
  previous: Previous
674
674
  price: Price
675
- price_bucket: Price Bucket
675
+ price_sack: Price Sack
676
676
  price_with_vat_included: "%{price} (inc. VAT)"
677
677
  problem_authorizing_card: "Problem authorizing credit card"
678
678
  problem_capturing_card: "Problem capturing credit card"
@@ -28,9 +28,9 @@ module SpreeCore
28
28
  Calculator::FlatRate,
29
29
  Calculator::FlexiRate,
30
30
  Calculator::PerItem,
31
- Calculator::PriceBucket]
31
+ Calculator::PriceSack]
32
32
 
33
- app.config.spree.calculators.tax_rates = [
33
+ app.config.spree.calculators.tax_rates = [
34
34
  Calculator::SalesTax,
35
35
  Calculator::Vat]
36
36
  end
@@ -56,7 +56,7 @@ module SpreeCore
56
56
 
57
57
  # sets the manifests / assets to be precompiled
58
58
  initializer "spree.assets.precompile" do |app|
59
- app.config.assets.precompile += ['store/all.*', 'admin/all.*', 'admin/spree_dash.*', 'admin/orders/edit_form.js', 'jqPlot/excanvas.min.js', 'admin/images/new.js', 'jquery.jstree/themes/apple/*']
59
+ app.config.assets.precompile += ['store/all.*', 'admin/all.*', 'admin/spree_dash.*', 'admin/orders/edit_form.js', 'admin/address_states.js', 'jqPlot/excanvas.min.js', 'admin/images/new.js', 'jquery.jstree/themes/apple/*']
60
60
  end
61
61
 
62
62
  # turn off asset debugging since that kills performance in development mode
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  def self.version
3
- "0.70.3"
3
+ "0.70.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_core
3
3
  version: !ruby/object:Gem::Version
4
- hash: 257
4
+ hash: 271
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 70
9
- - 3
10
- version: 0.70.3
9
+ - 4
10
+ version: 0.70.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sean Schofield
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-22 00:00:00 Z
18
+ date: 2012-03-04 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  version_requirements: &id001 !ruby/object:Gem::Requirement
@@ -103,12 +103,12 @@ dependencies:
103
103
  requirements:
104
104
  - - "="
105
105
  - !ruby/object:Gem::Version
106
- hash: 17
106
+ hash: 27
107
107
  segments:
108
108
  - 1
109
- - 0
110
109
  - 3
111
- version: 1.0.3
110
+ - 0
111
+ version: 1.3.0
112
112
  requirement: *id006
113
113
  type: :runtime
114
114
  prerelease: false
@@ -151,12 +151,12 @@ dependencies:
151
151
  requirements:
152
152
  - - "="
153
153
  - !ruby/object:Gem::Version
154
- hash: 29
154
+ hash: 27
155
155
  segments:
156
156
  - 2
157
- - 4
158
- - 1
159
- version: 2.4.1
157
+ - 5
158
+ - 0
159
+ version: 2.5.0
160
160
  requirement: *id009
161
161
  type: :runtime
162
162
  prerelease: false
@@ -221,12 +221,12 @@ dependencies:
221
221
  version: 3.1.1
222
222
  - - <=
223
223
  - !ruby/object:Gem::Version
224
- hash: 5
224
+ hash: 11
225
225
  segments:
226
226
  - 3
227
227
  - 1
228
- - 3
229
- version: 3.1.3
228
+ - 4
229
+ version: 3.1.4
230
230
  requirement: *id013
231
231
  type: :runtime
232
232
  prerelease: false
@@ -477,7 +477,7 @@ files:
477
477
  - app/models/calculator/flat_rate.rb
478
478
  - app/models/calculator/flexi_rate.rb
479
479
  - app/models/calculator/per_item.rb
480
- - app/models/calculator/price_bucket.rb
480
+ - app/models/calculator/price_sack.rb
481
481
  - app/models/calculator/sales_tax.rb
482
482
  - app/models/calculator/vat.rb
483
483
  - app/models/calculator.rb