solidus_frontend 2.1.1 → 2.2.0.beta1

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.

Potentially problematic release.


This version of solidus_frontend might be problematic. Click here for more details.

Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/README.md +30 -0
  4. data/app/assets/config/solidus_frontend_manifest.js +6 -0
  5. data/app/assets/javascripts/spree/frontend/checkout/coupon-code.js.coffee +2 -2
  6. data/app/assets/javascripts/spree/frontend/checkout.js.coffee +8 -0
  7. data/app/assets/stylesheets/spree/frontend/screen.css.scss +18 -7
  8. data/app/controllers/spree/checkout_controller.rb +63 -21
  9. data/app/controllers/spree/orders_controller.rb +2 -2
  10. data/app/controllers/spree/products_controller.rb +2 -2
  11. data/app/controllers/spree/store_controller.rb +1 -1
  12. data/app/controllers/spree/taxons_controller.rb +1 -1
  13. data/app/models/spree/frontend_configuration.rb +3 -0
  14. data/app/views/spree/address/_form.html.erb +2 -2
  15. data/app/views/spree/checkout/_address.html.erb +4 -4
  16. data/app/views/spree/checkout/_confirm.html.erb +15 -2
  17. data/app/views/spree/checkout/_delivery.html.erb +2 -2
  18. data/app/views/spree/checkout/_payment.html.erb +14 -14
  19. data/app/views/spree/checkout/_terms_and_conditions.en.html.erb +1 -0
  20. data/app/views/spree/checkout/edit.html.erb +4 -4
  21. data/app/views/spree/checkout/existing_payment/_gateway.html.erb +9 -0
  22. data/app/views/spree/checkout/payment/_gateway.html.erb +8 -8
  23. data/app/views/spree/home/index.html.erb +2 -2
  24. data/app/views/spree/layouts/spree_application.html.erb +4 -4
  25. data/app/views/spree/orders/_adjustment_row.html.erb +1 -1
  26. data/app/views/spree/orders/_adjustments.html.erb +3 -3
  27. data/app/views/spree/orders/_form.html.erb +7 -6
  28. data/app/views/spree/orders/_line_item.html.erb +2 -2
  29. data/app/views/spree/orders/edit.html.erb +9 -9
  30. data/app/views/spree/orders/show.html.erb +4 -4
  31. data/app/views/spree/products/_cart_form.html.erb +3 -3
  32. data/app/views/spree/products/_properties.html.erb +1 -1
  33. data/app/views/spree/products/index.html.erb +4 -4
  34. data/app/views/spree/products/show.html.erb +6 -6
  35. data/app/views/spree/shared/_filters.html.erb +2 -2
  36. data/app/views/spree/shared/_head.html.erb +1 -1
  37. data/app/views/spree/shared/_header.html.erb +2 -2
  38. data/app/views/spree/shared/_main_nav_bar.html.erb +2 -2
  39. data/app/views/spree/shared/_nav_bar.html.erb +1 -1
  40. data/app/views/spree/shared/_order_details.html.erb +7 -7
  41. data/app/views/spree/shared/_search.html.erb +4 -4
  42. data/app/views/spree/shared/_taxonomies.html.erb +1 -1
  43. data/config/initializers/assets.rb +1 -8
  44. data/config/routes.rb +1 -1
  45. data/lib/generators/solidus/views/override_generator.rb +46 -0
  46. data/spec/controllers/spree/checkout_controller_spec.rb +5 -52
  47. data/spec/controllers/spree/orders_controller_spec.rb +3 -3
  48. data/spec/controllers/spree/orders_controller_transitions_spec.rb +1 -1
  49. data/spec/features/caching/products_spec.rb +0 -1
  50. data/spec/features/caching/taxons_spec.rb +0 -1
  51. data/spec/features/checkout_spec.rb +4 -3
  52. data/spec/generators/solidus/views/override_generator_spec.rb +47 -0
  53. metadata +12 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e323f4e7b153bb4040b7dc1dfcbbc7defc77ae4
4
- data.tar.gz: bdc8eedc12748eb0daf6ab42b24b6f3666f927e1
3
+ metadata.gz: 3848fb0f3afde34da5f91a456bc57bb61b4b4785
4
+ data.tar.gz: e6d1cf1dac916b4b2de89815736bf3d83ffbe470
5
5
  SHA512:
6
- metadata.gz: 5b1eee5392d91699615e41c01bc2aa4798055bc3122654d61e2c6f192ffec664170ea64aa72bec98b3f2c059f392305ff9395ae2b24066ff1e402522eab7c9fe
7
- data.tar.gz: 3aa20a2be94c224c20c593011419ad55bc7ee2eeae0d695bc6c6928f70394358ff2bad255ccdc0a6b85060aef4106bbd4d5a261f83524fe277ad2549a801a64e
6
+ metadata.gz: ce6aea89fa22eedd9a168df53f32a217d02a0721ee1a70716b02bb184751766a55d45ec19b717c9d4a6e34a17204dafea0545dc3fe0685a55b773de444876d4c
7
+ data.tar.gz: 2b669c2dbac2c9a6a23cea1d5e1c1bc6707d5d150267ea6863e55eb442068758c8419fe0ff724c69b8600f09a8ee0235d9160867f6b08a2b969dae842cb96ef4
data/Gemfile CHANGED
@@ -2,5 +2,6 @@ eval(File.read(File.dirname(__FILE__) + '/../common_spree_dependencies.rb'))
2
2
 
3
3
  gem 'solidus_core', path: '../core'
4
4
  gem 'solidus_api', path: '../api'
5
+ gem 'generator_spec', group: :test
5
6
 
6
7
  gemspec
data/README.md CHANGED
@@ -2,6 +2,36 @@
2
2
 
3
3
  Frontend contains controllers and views implementing a storefront and cart for Solidus.
4
4
 
5
+ ## Override views
6
+
7
+ In order to customize a view you should copy the file into your host app. Using Deface is not
8
+ recommended as it provides lots of headaches while debugging and degrades your shops performance.
9
+
10
+ Solidus provides a generator to help with copying the right view into your host app.
11
+
12
+ Simply call the generator to copy all views into your host app.
13
+
14
+ ```shell
15
+ $ bundle exec rails g solidus:views:override
16
+ ```
17
+
18
+ If you only want to copy certain views into your host app, you can provide the `--only` argument:
19
+
20
+ ```shell
21
+ $ bundle exec rails g solidus:views:override --only products/show
22
+ ```
23
+
24
+ The argument to `--only` can also be a substring of the name of the view from the `app/views/spree` folder:
25
+
26
+ ```shell
27
+ $ bundle exec rails g solidus:views:override --only product
28
+ ```
29
+
30
+ This will copy all views whose directory or filename contains the string "product".
31
+
32
+ ### Handle upgrades
33
+
34
+ After upgrading solidus to a new version run the generator again and follow on screen instructions.
5
35
 
6
36
  ## Testing
7
37
 
@@ -0,0 +1,6 @@
1
+ //= link_tree ../../../vendor/assets/javascripts/jquery.validate/localization/ .js
2
+ //
3
+ //= link_tree ../images
4
+ //
5
+ //= link spree/frontend/all.js
6
+ //= link spree/frontend/all.css
@@ -13,14 +13,14 @@ Spree.onCouponCodeApply = (e) ->
13
13
  }
14
14
  )
15
15
 
16
- couponStatus.removeClass([successClass,errorClass].join(" "));
16
+ couponStatus.removeClass([successClass,errorClass].join(" "))
17
17
 
18
18
  req = Spree.ajax
19
19
  method: "PUT",
20
20
  url: url
21
21
 
22
22
  req.done (data) ->
23
- window.location.reload();
23
+ window.location.reload()
24
24
  couponCodeField.val('')
25
25
  couponStatus.addClass(successClass).html("Coupon code applied successfully.")
26
26
 
@@ -7,3 +7,11 @@
7
7
  Spree.disableSaveOnClick = ->
8
8
  ($ 'form.edit_order').submit ->
9
9
  ($ this).find(':submit, :image').attr('disabled', true).removeClass('primary').addClass 'disabled'
10
+
11
+ Spree.ready ($) ->
12
+ termsCheckbox = ($ '#accept_terms_and_conditions')
13
+ termsCheckbox.change( () ->
14
+ submitBtn = $(this.closest('form')).find(':submit')
15
+ submitBtn.prop('disabled', !this.checked)
16
+ submitBtn.toggleClass('disabled', !this.checked)
17
+ )
@@ -30,13 +30,6 @@ hr {
30
30
  border-bottom: $default_border;
31
31
  }
32
32
 
33
- /* Custom text-selection colors (remove any text shadows: twitter.com/miketaylr/status/12228805301) */
34
- ::-moz-selection{background: $link_text_color; color: $layout_background_color; text-shadow: none;}
35
- ::selection {background: $link_text_color; color: $layout_background_color; text-shadow: none;}
36
-
37
- /* j.mp/webkit-tap-highlight-color */
38
- a:link {-webkit-tap-highlight-color: $link_text_color;}
39
-
40
33
  ins {background-color: $link_text_color; color: $layout_background_color; text-decoration: none;}
41
34
  mark {background-color: $link_text_color; color: $layout_background_color; font-style: italic; font-weight: bold;}
42
35
 
@@ -216,6 +209,16 @@ input[type= "reset"], button, a.button {
216
209
  }
217
210
  }
218
211
 
212
+ input[type=button],
213
+ input[type=submit],
214
+ button {
215
+ &.disabled {
216
+ background:#ccc;
217
+ border-color: #ccc;
218
+ text-shadow:none;
219
+ }
220
+ }
221
+
219
222
  input[type="checkbox"], label {
220
223
  vertical-align: middle;
221
224
  }
@@ -925,6 +928,14 @@ p[data-hook="use_billing"] {
925
928
  }
926
929
  }
927
930
 
931
+ .terms_and_conditions {
932
+ .policy {
933
+ height: 100px;
934
+ width: 100%;
935
+ overflow: scroll;
936
+ }
937
+ }
938
+
928
939
  /*--------------------------------------*/
929
940
  /* Cart
930
941
  /*--------------------------------------*/
@@ -25,26 +25,22 @@ module Spree
25
25
 
26
26
  # Updates the order and advances to the next state (when possible.)
27
27
  def update
28
- if OrderUpdateAttributes.new(@order, update_params, request_env: request.headers.env).apply
29
- @order.temporary_address = !params[:save_user_address]
30
- success = if @order.state == 'confirm'
31
- @order.complete
32
- else
33
- @order.next
34
- end
35
- if !success
36
- flash[:error] = @order.errors.full_messages.join("\n")
37
- redirect_to(checkout_state_path(@order.state)) && return
28
+ if update_order
29
+
30
+ assign_temp_address
31
+
32
+ unless transition_forward
33
+ redirect_on_failure
34
+ return
38
35
  end
39
36
 
37
+
40
38
  if @order.completed?
41
- @current_order = nil
42
- flash.notice = Spree.t(:order_processed_successfully)
43
- flash['order_completed'] = true
44
- redirect_to completion_route
39
+ finalize_order
45
40
  else
46
- redirect_to checkout_state_path(@order.state)
41
+ send_to_next_state
47
42
  end
43
+
48
44
  else
49
45
  render :edit
50
46
  end
@@ -52,6 +48,42 @@ module Spree
52
48
 
53
49
  private
54
50
 
51
+ def update_order
52
+ OrderUpdateAttributes.new(@order, update_params, request_env: request.headers.env).apply
53
+ end
54
+
55
+ def assign_temp_address
56
+ @order.temporary_address = !params[:save_user_address]
57
+ end
58
+
59
+ def redirect_on_failure
60
+ flash[:error] = @order.errors.full_messages.join("\n")
61
+ redirect_to(checkout_state_path(@order.state))
62
+ end
63
+
64
+ def transition_forward
65
+ if @order.confirm?
66
+ @order.complete
67
+ else
68
+ @order.next
69
+ end
70
+ end
71
+
72
+ def finalize_order
73
+ @current_order = nil
74
+ set_successful_flash_notice
75
+ redirect_to completion_route
76
+ end
77
+
78
+ def set_successful_flash_notice
79
+ flash.notice = Spree.t(:order_processed_successfully)
80
+ flash['order_completed'] = true
81
+ end
82
+
83
+ def send_to_next_state
84
+ redirect_to checkout_state_path(@order.state)
85
+ end
86
+
55
87
  def update_params
56
88
  if update_params = massaged_params[:order]
57
89
  update_params.permit(permitted_checkout_attributes)
@@ -65,7 +97,11 @@ module Spree
65
97
  massaged_params = params.deep_dup
66
98
 
67
99
  move_payment_source_into_payments_attributes(massaged_params)
68
- move_existing_card_into_payments_attributes(massaged_params)
100
+ if massaged_params[:order] && massaged_params[:order][:existing_card].present?
101
+ Spree::Deprecation.warn("Passing order[:existing_card] is deprecated. Send order[:wallet_payment_source_id] instead.", caller)
102
+ move_existing_card_into_payments_attributes(massaged_params) # deprecated
103
+ end
104
+ move_wallet_payment_source_id_into_payments_attributes(massaged_params)
69
105
  set_payment_parameters_amount(massaged_params, @order)
70
106
 
71
107
  massaged_params
@@ -74,7 +110,7 @@ module Spree
74
110
  def ensure_valid_state
75
111
  unless skip_state_validation?
76
112
  if (params[:state] && !@order.has_checkout_step?(params[:state])) ||
77
- (!params[:state] && !@order.has_checkout_step?(@order.state))
113
+ (!params[:state] && !@order.has_checkout_step?(@order.state))
78
114
  @order.state = 'cart'
79
115
  redirect_to checkout_state_path(@order.checkout_steps.first)
80
116
  end
@@ -118,7 +154,8 @@ module Spree
118
154
 
119
155
  def ensure_sufficient_stock_lines
120
156
  if @order.insufficient_stock_lines.present?
121
- flash[:error] = Spree.t(:inventory_error_flash_for_insufficient_quantity)
157
+ out_of_stock_items = @order.insufficient_stock_lines.collect(&:name).to_sentence
158
+ flash[:error] = Spree.t(:inventory_error_flash_for_insufficient_quantity, names: out_of_stock_items)
122
159
  redirect_to spree.cart_path
123
160
  end
124
161
  end
@@ -136,7 +173,7 @@ module Spree
136
173
  def before_address
137
174
  # if the user has a default address, a callback takes care of setting
138
175
  # that; but if he doesn't, we need to build an empty one here
139
- default = { country_id: Country.default.id }
176
+ default = {country_id: Spree::Country.default.id}
140
177
  @order.build_bill_address(default) unless @order.bill_address
141
178
  @order.build_ship_address(default) if @order.checkout_steps.include?('delivery') && !@order.ship_address
142
179
  end
@@ -157,8 +194,13 @@ module Spree
157
194
  end
158
195
  end
159
196
 
160
- if try_spree_current_user && try_spree_current_user.respond_to?(:payment_sources)
161
- @payment_sources = try_spree_current_user.payment_sources
197
+ if try_spree_current_user && try_spree_current_user.respond_to?(:wallet)
198
+ @wallet_payment_sources = try_spree_current_user.wallet.wallet_payment_sources
199
+ @default_wallet_payment_source = @wallet_payment_sources.detect(&:default) ||
200
+ @wallet_payment_sources.first
201
+ # TODO: How can we deprecate this instance variable? We could try
202
+ # wrapping it in a delegating object that produces deprecation warnings.
203
+ @payment_sources = try_spree_current_user.wallet.wallet_payment_sources.map(&:payment_source).select { |ps| ps.is_a?(Spree::CreditCard) }
162
204
  end
163
205
  end
164
206
 
@@ -13,7 +13,7 @@ module Spree
13
13
  skip_before_action :verify_authenticity_token, only: [:populate]
14
14
 
15
15
  def show
16
- @order = Order.find_by_number!(params[:id])
16
+ @order = Spree::Order.find_by_number!(params[:id])
17
17
  end
18
18
 
19
19
  def update
@@ -36,7 +36,7 @@ module Spree
36
36
 
37
37
  # Shows the current incomplete order from the session
38
38
  def edit
39
- @order = current_order || Order.incomplete.find_or_initialize_by(guest_token: cookies.signed[:guest_token])
39
+ @order = current_order || Spree::Order.incomplete.find_or_initialize_by(guest_token: cookies.signed[:guest_token])
40
40
  associate_user
41
41
  end
42
42
 
@@ -37,9 +37,9 @@ module Spree
37
37
 
38
38
  def load_product
39
39
  if try_spree_current_user.try(:has_spree_role?, "admin")
40
- @products = Product.with_deleted
40
+ @products = Spree::Product.with_deleted
41
41
  else
42
- @products = Product.available
42
+ @products = Spree::Product.available
43
43
  end
44
44
  @product = @products.friendly.find(params[:id])
45
45
  end
@@ -39,7 +39,7 @@ module Spree
39
39
  end
40
40
 
41
41
  def lock_order
42
- OrderMutex.with_lock!(@order) { yield }
42
+ Spree::OrderMutex.with_lock!(@order) { yield }
43
43
  rescue Spree::OrderMutex::LockFailed
44
44
  flash[:error] = Spree.t(:order_mutex_error)
45
45
  redirect_to spree.cart_path
@@ -6,7 +6,7 @@ module Spree
6
6
  respond_to :html
7
7
 
8
8
  def show
9
- @taxon = Taxon.find_by_permalink!(params[:id])
9
+ @taxon = Spree::Taxon.find_by_permalink!(params[:id])
10
10
  return unless @taxon
11
11
 
12
12
  @searcher = build_searcher(params.merge(taxon: @taxon.id, include_images: true))
@@ -1,5 +1,8 @@
1
1
  module Spree
2
2
  class FrontendConfiguration < Preferences::Configuration
3
3
  preference :locale, :string, default: Rails.application.config.i18n.default_locale
4
+
5
+ # Add your terms and conditions in app/views/spree/checkout/_terms_and_conditions.en.html.erb
6
+ preference :require_terms_and_conditions_acceptance, :boolean, default: false
4
7
  end
5
8
  end
@@ -51,7 +51,7 @@
51
51
  <%=
52
52
  form.collection_select(
53
53
  :state_id, address.country.states, :id, :name,
54
- {:include_blank => true},
54
+ {include_blank: true},
55
55
  {
56
56
  class: have_states ? 'required' : '',
57
57
  style: have_states ? '' : 'display: none;',
@@ -70,7 +70,7 @@
70
70
  %>
71
71
  </span>
72
72
  <noscript>
73
- <%= form.text_field :state_name, :class => 'required', autocomplete: address_type + ' address-level1' %>
73
+ <%= form.text_field :state_name, class: 'required', autocomplete: address_type + ' address-level1' %>
74
74
  </noscript>
75
75
  </p>
76
76
  <% end %>
@@ -2,7 +2,7 @@
2
2
  <fieldset id="billing" data-hook>
3
3
  <%= form.fields_for :bill_address do |bill_form| %>
4
4
  <legend align="center"><%= Spree.t(:billing_address) %></legend>
5
- <%= render :partial => 'spree/address/form', :locals => { :form => bill_form, :address_type => 'billing', :address => @order.bill_address } %>
5
+ <%= render partial: 'spree/address/form', locals: { form: bill_form, address_type: 'billing', address: @order.bill_address } %>
6
6
  <% end %>
7
7
  </fieldset>
8
8
  </div>
@@ -13,16 +13,16 @@
13
13
  <legend align="center"><%= Spree.t(:shipping_address) %></legend>
14
14
  <p class="field checkbox" data-hook="use_billing">
15
15
  <%= check_box_tag 'order[use_billing]', '1', @order.shipping_eq_billing_address? %>
16
- <%= label_tag :order_use_billing, Spree.t(:use_billing_address), :id => 'use_billing' %>
16
+ <%= label_tag :order_use_billing, Spree.t(:use_billing_address), id: 'use_billing' %>
17
17
  </p>
18
- <%= render :partial => 'spree/address/form', :locals => { :form => ship_form, :address_type => 'shipping', :address => @order.ship_address } %>
18
+ <%= render partial: 'spree/address/form', locals: { form: ship_form, address_type: 'shipping', address: @order.ship_address } %>
19
19
  <% end %>
20
20
  </fieldset>
21
21
  </div>
22
22
  <hr class="clear" />
23
23
 
24
24
  <div class="form-buttons" data-hook="buttons">
25
- <%= submit_tag Spree.t(:save_and_continue), :class => 'continue button primary' %>
25
+ <%= submit_tag Spree.t(:save_and_continue), class: 'continue button primary' %>
26
26
  <% if try_spree_current_user %>
27
27
  <span data-hook="save_user_address">
28
28
  &nbsp; &nbsp;
@@ -1,12 +1,25 @@
1
1
  <fieldset id="order_details" data-hook>
2
2
  <div class="clear"></div>
3
3
  <legend align="center"><%= Spree.t(:confirm) %></legend>
4
- <%= render :partial => 'spree/shared/order_details', :locals => { :order => @order } %>
4
+ <%= render partial: 'spree/shared/order_details', locals: { order: @order } %>
5
5
  </fieldset>
6
6
 
7
7
  <br />
8
8
 
9
9
  <div class="form-buttons" data-hook="buttons">
10
- <%= submit_tag Spree.t(:place_order), :class => 'continue button primary' %>
10
+ <% Spree::Frontend::Config[:require_terms_and_conditions_acceptance].tap do |requires_acceptance| %>
11
+ <% if requires_acceptance %>
12
+ <div class="terms_and_conditions" data-hook="terms_and_conditions">
13
+ <div class="policy"><%= render partial: "spree/checkout/terms_and_conditions" %></div>
14
+ <%= check_box_tag :accept_terms_and_conditions, 'accepted', false %>
15
+ <%= label_tag :accept_terms_and_conditions, Spree.t(:agree_to_terms_of_service) %>
16
+ </div>
17
+ <% end %>
18
+
19
+ <%= submit_tag Spree.t(:place_order),
20
+ disabled: requires_acceptance,
21
+ class: "continue button primary #{ 'disabled' if requires_acceptance }" %>
22
+ <% end %>
23
+
11
24
  <script>Spree.disableSaveOnClick();</script>
12
25
  </div>
@@ -87,7 +87,7 @@
87
87
  <% if Spree::Config[:shipping_instructions] %>
88
88
  <p id="minstrs" data-hook>
89
89
  <%= form.label :special_instructions, Spree.t(:shipping_instructions) %><br />
90
- <%= form.text_area :special_instructions, :cols => 40, :rows => 7 %>
90
+ <%= form.text_area :special_instructions, cols: 40, rows: 7 %>
91
91
  </p>
92
92
  <% end %>
93
93
  </div>
@@ -96,5 +96,5 @@
96
96
  <br />
97
97
 
98
98
  <div class="form-buttons" data-hook="buttons">
99
- <%= submit_tag Spree.t(:save_and_continue), :class => 'continue button primary' %>
99
+ <%= submit_tag Spree.t(:save_and_continue), class: 'continue button primary' %>
100
100
  </div>
@@ -1,7 +1,7 @@
1
1
  <fieldset id="payment" data-hook>
2
2
  <legend align="center"><%= Spree.t(:payment_information) %></legend>
3
3
  <div data-hook="checkout_payment_step">
4
- <% if @payment_sources.present? %>
4
+ <% if @wallet_payment_sources.present? %>
5
5
  <div class="card_options">
6
6
  <%= radio_button_tag 'use_existing_card', 'yes', true %>
7
7
  <label for="use_existing_card_yes">
@@ -18,16 +18,16 @@
18
18
  <p class="field" data-hook="existing_cards">
19
19
  <table class="existing-credit-card-list">
20
20
  <tbody>
21
- <% @payment_sources.each do |card| %>
22
- <tr id="<%= dom_id(card,'spree')%>" class="<%= cycle('even', 'odd') %>">
23
- <td><%= card.name %></td>
24
- <td><%= card.display_number %></td>
25
- <td><%= card.month %></td>
26
- <td><%= card.year %></td>
27
- <td>
28
- <%= radio_button_tag "order[existing_card]", card.id, (card == @payment_sources.first), { class: "existing-cc-radio" } %>
29
- </td>
30
- </tr>
21
+ <% @wallet_payment_sources.each do |wallet_payment_source| %>
22
+ <%=
23
+ render(
24
+ partial: "spree/checkout/existing_payment/#{wallet_payment_source.payment_source.payment_method.method_type}",
25
+ locals: {
26
+ wallet_payment_source: wallet_payment_source,
27
+ default: wallet_payment_source == @default_wallet_payment_source,
28
+ }
29
+ )
30
+ %>
31
31
  <% end %>
32
32
  </tbody>
33
33
  </table>
@@ -40,7 +40,7 @@
40
40
  <p>
41
41
  <label>
42
42
  <%= radio_button_tag "order[payments_attributes][][payment_method_id]", method.id, method == @order.available_payment_methods.first %>
43
- <%= Spree.t(method.name, :scope => :payment_methods, :default => method.name) %>
43
+ <%= Spree.t(method.name, scope: :payment_methods, default: method.name) %>
44
44
  </label>
45
45
  </p>
46
46
  <% end %>
@@ -50,7 +50,7 @@
50
50
  <% @order.available_payment_methods.each do |method| %>
51
51
  <li id="payment_method_<%= method.id %>" class="<%= 'last' if method == @order.available_payment_methods.last %>" data-hook>
52
52
  <fieldset>
53
- <%= render :partial => "spree/checkout/payment/#{method.method_type}", :locals => { :payment_method => method } %>
53
+ <%= render partial: "spree/checkout/payment/#{method.method_type}", locals: { payment_method: method } %>
54
54
  </fieldset>
55
55
  </li>
56
56
  <% end %>
@@ -72,6 +72,6 @@
72
72
  <br class="space" />
73
73
 
74
74
  <div class="form-buttons" data-hook="buttons">
75
- <%= submit_tag Spree.t(:save_and_continue), :class => 'continue button primary' %>
75
+ <%= submit_tag Spree.t(:save_and_continue), class: 'continue button primary' %>
76
76
  <script>Spree.disableSaveOnClick();</script>
77
77
  </div>
@@ -0,0 +1 @@
1
+ Put your terms and conditions here
@@ -1,5 +1,5 @@
1
1
  <div id="checkout" data-hook>
2
- <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @order } %>
2
+ <%= render partial: 'spree/shared/error_messages', locals: { target: @order } %>
3
3
 
4
4
  <div class="row" data-hook="checkout_header">
5
5
  <h1 class="columns three alpha" data-hook="checkout_title"><%= Spree.t(:checkout) %></h1>
@@ -8,19 +8,19 @@
8
8
 
9
9
  <div class="row" data-hook="checkout_content">
10
10
  <div class="columns <%= if @order.state != 'confirm' then 'alpha twelve' else 'alpha omega sixteen' end %>" data-hook="checkout_form_wrapper">
11
- <%= form_for @order, :url => update_checkout_path(@order.state), :html => { :id => "checkout_form_#{@order.state}" } do |form| %>
11
+ <%= form_for @order, url: update_checkout_path(@order.state), html: { id: "checkout_form_#{@order.state}" } do |form| %>
12
12
  <% if @order.state == 'address' || !@order.email? %>
13
13
  <p class="field" style='clear: both'>
14
14
  <%= form.label :email %><br />
15
15
  <%= form.text_field :email %>
16
16
  </p>
17
17
  <% end %>
18
- <%= render @order.state, :form => form %>
18
+ <%= render @order.state, form: form %>
19
19
  <% end %>
20
20
  </div>
21
21
  <% if @order.state != 'confirm' %>
22
22
  <div id="checkout-summary" data-hook="checkout_summary_box" class="columns omega four">
23
- <%= render :partial => 'summary', :locals => { :order => @order } %>
23
+ <%= render partial: 'summary', locals: { order: @order } %>
24
24
  </div>
25
25
  <% end %>
26
26
  </div>
@@ -0,0 +1,9 @@
1
+ <tr id="<%= dom_id(wallet_payment_source, 'spree')%>" class="<%= cycle('even', 'odd') %>">
2
+ <td><%= wallet_payment_source.payment_source.name %></td>
3
+ <td><%= wallet_payment_source.payment_source.display_number %></td>
4
+ <td><%= wallet_payment_source.payment_source.month %></td>
5
+ <td><%= wallet_payment_source.payment_source.year %></td>
6
+ <td>
7
+ <%= radio_button_tag "order[wallet_payment_source_id]", wallet_payment_source.id, default, class: "existing-cc-radio" %>
8
+ </td>
9
+ </tr>
@@ -1,14 +1,14 @@
1
- <%= image_tag 'credit_cards/credit_card.gif', :id => 'credit-card-image' %>
1
+ <%= image_tag 'credit_cards/credit_card.gif', id: 'credit-card-image' %>
2
2
  <% param_prefix = "payment_source[#{payment_method.id}]" %>
3
3
 
4
4
  <p class="field">
5
5
  <%= label_tag "name_on_card_#{payment_method.id}", Spree.t(:name_on_card) %><span class="required">*</span><br />
6
- <%= text_field_tag "#{param_prefix}[name]", "#{@order.billing_firstname} #{@order.billing_lastname}", { id: "name_on_card_#{payment_method.id}", :autocomplete => "cc-name" } %>
6
+ <%= text_field_tag "#{param_prefix}[name]", "#{@order.billing_firstname} #{@order.billing_lastname}", { id: "name_on_card_#{payment_method.id}", autocomplete: "cc-name" } %>
7
7
  </p>
8
8
 
9
9
  <p class="field" data-hook="card_number">
10
10
  <%= label_tag "card_number", Spree.t(:card_number) %><span class="required">*</span><br />
11
- <%= text_field_tag "#{param_prefix}[number]", '', {:id => 'card_number', :class => 'required cardNumber', :size => 19, :maxlength => 19, :autocomplete => "cc-number", type: "tel"} %>
11
+ <%= text_field_tag "#{param_prefix}[number]", '', {id: 'card_number', class: 'required cardNumber', size: 19, maxlength: 19, autocomplete: "cc-number", type: "tel"} %>
12
12
  &nbsp;
13
13
  <span id="card_type" style="display:none;">
14
14
  ( <span id="looks_like" ><%= Spree.t(:card_type_is) %> <span id="type"></span></span>
@@ -19,19 +19,19 @@
19
19
 
20
20
  <p class="field" data-hook="card_expiration">
21
21
  <%= label_tag "card_expiry", Spree.t(:expiration) %><span class="required">*</span><br />
22
- <%= text_field_tag "#{param_prefix}[expiry]", '', :id => 'card_expiry', :class => "required cardExpiry", :placeholder => "MM / YY", type: "tel" %>
22
+ <%= text_field_tag "#{param_prefix}[expiry]", '', id: 'card_expiry', class: "required cardExpiry", placeholder: "MM / YY", type: "tel" %>
23
23
  </p>
24
24
 
25
25
  <p class="field" data-hook="card_code">
26
26
  <%= label_tag "card_code", Spree.t(:card_code) %><span class="required">*</span><br />
27
- <%= text_field_tag "#{param_prefix}[verification_value]", '', {:id => 'card_code', :class => 'required cardCode', :size => 5, type: "tel", autocomplete: "off"} %>
28
- <%= link_to "(#{Spree.t(:what_is_this)})", spree.cvv_path, :target => '_blank', "data-hook" => "cvv_link", :id => "cvv_link" %>
27
+ <%= text_field_tag "#{param_prefix}[verification_value]", '', {id: 'card_code', class: 'required cardCode', size: 5, type: "tel", autocomplete: "off"} %>
28
+ <%= link_to "(#{Spree.t(:what_is_this)})", spree.cvv_path, target: '_blank', "data-hook" => "cvv_link", id: "cvv_link" %>
29
29
  </p>
30
30
 
31
31
  <% if @order.bill_address %>
32
32
  <%= fields_for "#{param_prefix}[address_attributes]", @order.bill_address do |f| %>
33
- <%= render :partial => 'spree/address/form_hidden', :locals => { :form => f } %>
33
+ <%= render partial: 'spree/address/form_hidden', locals: { form: f } %>
34
34
  <% end %>
35
35
  <% end %>
36
36
 
37
- <%= hidden_field_tag "#{param_prefix}[cc_type]", '', :id => "cc_type", :class => 'ccType' %>
37
+ <%= hidden_field_tag "#{param_prefix}[cc_type]", '', id: "cc_type", class: 'ccType' %>
@@ -1,12 +1,12 @@
1
1
  <% content_for :sidebar do %>
2
2
  <div data-hook="homepage_sidebar_navigation">
3
- <%= render :partial => 'spree/shared/taxonomies' %>
3
+ <%= render partial: 'spree/shared/taxonomies' %>
4
4
  </div>
5
5
  <% end %>
6
6
 
7
7
  <div data-hook="homepage_products">
8
8
  <% cache(cache_key_for_products) do %>
9
- <%= render :partial => 'spree/shared/products', :locals => { :products => @products } %>
9
+ <%= render partial: 'spree/shared/products', locals: { products: @products } %>
10
10
  <% end %>
11
11
  </div>
12
12
 
@@ -5,19 +5,19 @@
5
5
  <!--[if IE 9 ]> <html class="ie ie9" lang="<%= I18n.locale %>"> <![endif]-->
6
6
  <!--[if gt IE 9]><!--><html lang="<%= I18n.locale %>"><!--<![endif]-->
7
7
  <head data-hook="inside_head">
8
- <%= render :partial => 'spree/shared/head' %>
8
+ <%= render partial: 'spree/shared/head' %>
9
9
  </head>
10
10
  <body class="<%= body_class %>" id="<%= @body_id || 'default' %>" data-hook="body">
11
11
 
12
12
  <div class="container">
13
13
 
14
- <%= render :partial => 'spree/shared/header' %>
14
+ <%= render partial: 'spree/shared/header' %>
15
15
 
16
16
  <div id="wrapper" class="row" data-hook>
17
17
 
18
18
  <%= taxon_breadcrumbs(@taxon) %>
19
19
 
20
- <%= render :partial => 'spree/shared/sidebar' if content_for? :sidebar %>
20
+ <%= render partial: 'spree/shared/sidebar' if content_for? :sidebar %>
21
21
 
22
22
  <div id="content" class="columns <%= !content_for?(:sidebar) ? "sixteen" : "twelve omega" %>" data-hook>
23
23
  <%= flash_messages %>
@@ -28,7 +28,7 @@
28
28
 
29
29
  </div>
30
30
 
31
- <%= render :partial => 'spree/shared/footer' %>
31
+ <%= render partial: 'spree/shared/footer' %>
32
32
 
33
33
  </div>
34
34
 
@@ -2,7 +2,7 @@
2
2
  <tr class="adjustment">
3
3
  <td colspan="4" align='right'><h5><%= type %>: <%= label %></h5></td>
4
4
  <td colspan='2'>
5
- <h5><%= Spree::Money.new(adjustments.sum(&:amount), :currency => @order.currency) %></h5>
5
+ <h5><%= Spree::Money.new(adjustments.sum(&:amount), currency: @order.currency) %></h5>
6
6
  </td>
7
7
  </tr>
8
8
  <% end %>