spree_frontend 2.0.7 → 2.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4de87e043800f121326d03ee2f4505f2cac7cba
4
- data.tar.gz: 0033ae9ddaf67d6e00101df373814f8836439217
3
+ metadata.gz: 720de19081a15e84f769e40a110468b72a3e1aca
4
+ data.tar.gz: 408a70061fb1e16df28c76643ec3ce3ee7ffcadc
5
5
  SHA512:
6
- metadata.gz: ac65662b06b0698ce296c01c5fca6e18fe9b64c58be38e4b3d5eb6d054f42db07042dddc99b1949391246af4d61174db5ee71e8179b39ea0d6da7523bddb3285
7
- data.tar.gz: 2dfc4519d9269b627809631f312538a146dae97575ec6b93978573cd8d4cd8a2752040d0b01a577c464be22ac248aa30388f522858279306f096fd73d6184637
6
+ metadata.gz: ee8445a2a30daf3e2f409efa48628017b0c30ae72d14da45dbaf3917e25b9bf014dee1fae71ab8ba817a93a00dc8c1c061919646ecc22832cd75f407706700a3
7
+ data.tar.gz: 1dcf80fe7ead87d96d41ec7a9aa26f1699ae7099c69709b23bd99e76d1b00fe192ec7be5f6e760d986494a22752bad56ee49ccbe5b1a53cbf82e9ec180d8a064
@@ -1,4 +1,4 @@
1
- @import 'variables';
1
+ @import 'store/variables';
2
2
 
3
3
  /*--------------------------------------*/
4
4
  /* Basic styles
@@ -55,6 +55,13 @@ module Spree
55
55
  redirect_to checkout_state_path(@order.checkout_steps.first)
56
56
  end
57
57
  end
58
+
59
+ # Fix for #4117
60
+ # If confirmation of payment fails, redirect back to payment screen
61
+ if params[:state] == "confirm" && @order.payments.valid.empty?
62
+ flash.keep
63
+ redirect_to checkout_state_path("payment")
64
+ end
58
65
  end
59
66
 
60
67
  # Should be overriden if you have areas of your checkout that don't match
@@ -149,7 +156,7 @@ module Spree
149
156
  end
150
157
 
151
158
  def rescue_from_spree_gateway_error(exception)
152
- flash[:error] = Spree.t(:spree_gateway_error_flash_for_checkout)
159
+ flash.now[:error] = Spree.t(:spree_gateway_error_flash_for_checkout)
153
160
  @order.errors.add(:base, exception.message)
154
161
  render :edit
155
162
  end
@@ -166,7 +173,7 @@ module Spree
166
173
  if coupon_result[:coupon_applied?]
167
174
  flash[:success] = coupon_result[:success] if coupon_result[:success].present?
168
175
  else
169
- flash[:error] = coupon_result[:error]
176
+ flash.now[:error] = coupon_result[:error]
170
177
  respond_with(@order) { |format| format.html { render :edit } } and return
171
178
  end
172
179
  end
@@ -29,7 +29,7 @@ module Spree
29
29
  respond_with(@order) do |format|
30
30
  format.html do
31
31
  if params.has_key?(:checkout)
32
- @order.next_transition.run_callbacks if @order.cart?
32
+ @order.next if @order.cart?
33
33
  redirect_to checkout_state_path(@order.checkout_steps.first)
34
34
  else
35
35
  redirect_to cart_path
@@ -95,7 +95,7 @@ module Spree
95
95
  flash[:success] = coupon_result[:success] if coupon_result[:success].present?
96
96
  return false
97
97
  else
98
- flash[:error] = coupon_result[:error]
98
+ flash.now[:error] = coupon_result[:error]
99
99
  respond_with(@order) { |format| format.html { render :edit } }
100
100
  return true
101
101
  end
@@ -7,64 +7,10 @@ module Spree
7
7
  end
8
8
 
9
9
  protected
10
- # This method is placed here so that the CheckoutController
11
- # and OrdersController can both reference it.
12
- def apply_coupon_code
13
- if @order.coupon_code.present?
14
- # check if coupon code is already applied
15
- if @order.adjustments.promotion.eligible.detect { |p| p.originator.promotion.code == @order.coupon_code }.present?
16
- flash[:notice] = Spree.t(:coupon_code_already_applied)
17
- true
18
- else
19
- event_name = "spree.checkout.coupon_code_added"
20
- promotion = Spree::Promotion.where("event_name = ? AND lower(code) = ?", event_name, @order.coupon_code).first
21
-
22
- if promotion.present?
23
- if promotion.expired?
24
- flash[:error] = Spree.t(:coupon_code_expired)
25
- return false
26
- end
27
-
28
- if promotion.usage_limit_exceeded?
29
- flash[:error] = Spree.t(:coupon_code_max_usage)
30
- return false
31
- end
32
-
33
- eligible_promos = @order.adjustments.promotion.eligible
34
-
35
- previous_promo = eligible_promos.first
36
- fire_event(event_name, :coupon_code => @order.coupon_code)
37
- promo = eligible_promos.detect { |p| p.originator.promotion.code == @order.coupon_code }
38
- ineligible_promos = @order.adjustments.promotion.where(:eligible => false)
39
- ineligible_promo = ineligible_promos.detect { |p| p.originator.promotion.code == @order.coupon_code }
40
-
41
- if promo.present? and promo.eligible?
42
- flash[:success] = Spree.t(:coupon_code_applied)
43
- true
44
- elsif previous_promo.present?
45
- flash[:error] = Spree.t(:coupon_code_better_exists)
46
- false
47
- elsif ineligible_promo.present?
48
- flash[:error] = Spree.t(:coupon_code_not_eligible)
49
- false
50
- else
51
- # if the promotion was created after the order
52
- flash[:error] = Spree.t(:coupon_code_not_found)
53
- false
54
- end
55
- else
56
- flash[:error] = Spree.t(:coupon_code_not_found)
57
- false
58
- end
59
- end
60
- else
61
- true
62
- end
63
- end
64
-
65
- def config_locale
66
- Spree::Frontend::Config[:locale]
67
- end
10
+
11
+ def config_locale
12
+ Spree::Frontend::Config[:locale]
13
+ end
68
14
  end
69
15
  end
70
16
 
@@ -1,6 +1,6 @@
1
1
  <fieldset id="order_details" data-hook>
2
2
  <div class="clear"></div>
3
- <legend align="center"><%= Spree.t(@order.state, :scope => :order_state).titleize %></legend>
3
+ <legend align="center"><%= Spree.t(:confirm) %></legend>
4
4
  <%= render :partial => 'spree/shared/order_details', :locals => { :order => @order } %>
5
5
  </fieldset>
6
6
 
@@ -17,11 +17,11 @@
17
17
  </tbody>
18
18
  <tr data-hook="order_total">
19
19
  <td><strong><%= Spree.t(:order_total) %>:</strong></td>
20
- <td><strong><span id='summary-order-total'><%= @order.display_total.to_html %></span></strong></td>
20
+ <td><strong><span id='summary-order-total'><%= order.display_total.to_html %></span></strong></td>
21
21
  </tr>
22
22
  <% if order.line_item_adjustment_totals.present? %>
23
23
  <tbody id="price-adjustments" data-hook="order_details_price_adjustments">
24
- <% @order.line_item_adjustment_totals.each do |label, total| %>
24
+ <% order.line_item_adjustment_totals.each do |label, total| %>
25
25
  <tr class="total">
26
26
  <td><strong><%= label %></strong></td>
27
27
  <td><strong><span><%= total.to_html %></span></strong></td>
@@ -19,7 +19,7 @@
19
19
 
20
20
  <%= render :partial => 'spree/shared/sidebar' if content_for? :sidebar %>
21
21
 
22
- <div id="content" class="columns <%= !content_for?(:sidebar) ? "sixteen" : "twelve" %>" data-hook>
22
+ <div id="content" class="columns <%= !content_for?(:sidebar) ? "sixteen" : "twelve omega" %>" data-hook>
23
23
  <%= flash_messages %>
24
24
  <%= yield %>
25
25
  </div>
@@ -32,7 +32,7 @@
32
32
 
33
33
  (function() {
34
34
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
35
- ga.src = '//google-analytics.com/ga.js';
35
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
36
36
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
37
37
  })();
38
38
  <% end %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.7
4
+ version: 2.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-19 00:00:00.000000000 Z
11
+ date: 2014-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core
@@ -16,124 +16,124 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0.7
19
+ version: 2.0.8
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.0.7
26
+ version: 2.0.8
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: spree_api
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 2.0.7
33
+ version: 2.0.8
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 2.0.7
40
+ version: 2.0.8
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: jquery-rails
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 3.0.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.0.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rails
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 3.2.13
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 3.2.13
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: canonical-rails
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: deface
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: 0.9.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.9.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: stringex
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: 1.5.1
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: 1.5.1
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: email_spec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ~>
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
117
  version: 1.2.1
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ~>
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: 1.2.1
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: capybara-accessible
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - '>='
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  description: Required dependency for Spree
@@ -238,9 +238,9 @@ files:
238
238
  - config/initializers/rails_5868.rb
239
239
  - config/initializers/spree.rb
240
240
  - config/routes.rb
241
+ - lib/spree/frontend.rb
241
242
  - lib/spree/frontend/engine.rb
242
243
  - lib/spree/frontend/middleware/seo_assist.rb
243
- - lib/spree/frontend.rb
244
244
  - lib/spree/scopes/dynamic.rb
245
245
  - lib/spree_frontend.rb
246
246
  - lib/tasks/rake_util.rb
@@ -547,18 +547,18 @@ require_paths:
547
547
  - lib
548
548
  required_ruby_version: !ruby/object:Gem::Requirement
549
549
  requirements:
550
- - - '>='
550
+ - - ">="
551
551
  - !ruby/object:Gem::Version
552
552
  version: 1.9.3
553
553
  required_rubygems_version: !ruby/object:Gem::Requirement
554
554
  requirements:
555
- - - '>='
555
+ - - ">="
556
556
  - !ruby/object:Gem::Version
557
557
  version: '0'
558
558
  requirements:
559
559
  - none
560
560
  rubyforge_project: spree_frontend
561
- rubygems_version: 2.1.0
561
+ rubygems_version: 2.2.0
562
562
  signing_key:
563
563
  specification_version: 4
564
564
  summary: Frontend e-commerce functionality for the Spree project.