solidus_frontend 2.5.2 → 2.6.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of solidus_frontend might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Rakefile +3 -1
- data/app/assets/javascripts/spree/frontend/checkout/address.js +4 -5
- data/app/assets/javascripts/spree/frontend/locale_selector.js +5 -0
- data/app/assets/javascripts/spree/frontend.js +1 -0
- data/app/assets/stylesheets/spree/frontend/screen.css.scss +33 -7
- data/app/controllers/spree/checkout_controller.rb +5 -4
- data/app/controllers/spree/content_controller.rb +2 -0
- data/app/controllers/spree/home_controller.rb +2 -0
- data/app/controllers/spree/locale_controller.rb +10 -6
- data/app/controllers/spree/orders_controller.rb +3 -1
- data/app/controllers/spree/products_controller.rb +3 -1
- data/app/controllers/spree/store_controller.rb +2 -0
- data/app/controllers/spree/taxons_controller.rb +3 -1
- data/app/helpers/spree/orders_helper.rb +2 -0
- data/app/helpers/spree/taxon_filters_helper.rb +13 -0
- data/app/models/spree/frontend_configuration.rb +2 -0
- data/app/views/spree/address/_form.html.erb +33 -33
- data/app/views/spree/checkout/_address.html.erb +2 -2
- data/app/views/spree/checkout/_delivery.html.erb +1 -1
- data/app/views/spree/checkout/_payment.html.erb +3 -3
- data/app/views/spree/checkout/edit.html.erb +2 -2
- data/app/views/spree/checkout/payment/_gateway.html.erb +12 -13
- data/app/views/spree/orders/_form.html.erb +1 -1
- data/app/views/spree/shared/_filters.html.erb +1 -1
- data/app/views/spree/shared/_locale_selector.html.erb +25 -0
- data/app/views/spree/shared/_nav_bar.html.erb +1 -0
- data/config/initializers/assets.rb +2 -0
- data/config/initializers/canonical_rails.rb +2 -0
- data/config/routes.rb +3 -0
- data/lib/generators/solidus/views/override_generator.rb +2 -0
- data/lib/solidus_frontend.rb +2 -0
- data/lib/spree/frontend/engine.rb +2 -0
- data/lib/spree/frontend/middleware/seo_assist.rb +2 -0
- data/lib/spree/frontend.rb +2 -0
- data/lib/spree_frontend.rb +2 -0
- data/lib/tasks/rake_util.rb +2 -0
- data/lib/tasks/taxon.rake +2 -0
- data/script/rails +4 -2
- data/solidus_frontend.gemspec +4 -3
- data/spec/controllers/controller_helpers_spec.rb +6 -0
- data/spec/controllers/locale_controller_spec.rb +57 -0
- data/spec/controllers/spree/checkout_controller_spec.rb +2 -0
- data/spec/controllers/spree/checkout_controller_with_views_spec.rb +3 -2
- data/spec/controllers/spree/content_controller_spec.rb +2 -0
- data/spec/controllers/spree/current_order_tracking_spec.rb +2 -0
- data/spec/controllers/spree/home_controller_spec.rb +2 -0
- data/spec/controllers/spree/orders_controller_ability_spec.rb +2 -0
- data/spec/controllers/spree/orders_controller_spec.rb +2 -0
- data/spec/controllers/spree/orders_controller_transitions_spec.rb +2 -0
- data/spec/controllers/spree/products_controller_spec.rb +2 -0
- data/spec/controllers/spree/taxons_controller_spec.rb +2 -0
- data/spec/features/address_spec.rb +2 -0
- data/spec/features/automatic_promotion_adjustments_spec.rb +2 -0
- data/spec/features/caching/products_spec.rb +2 -8
- data/spec/features/caching/taxons_spec.rb +2 -2
- data/spec/features/cart_spec.rb +2 -0
- data/spec/features/checkout_spec.rb +7 -5
- data/spec/features/checkout_unshippable_spec.rb +3 -1
- data/spec/features/coupon_code_spec.rb +2 -0
- data/spec/features/currency_spec.rb +2 -0
- data/spec/features/free_shipping_promotions_spec.rb +2 -0
- data/spec/features/locale_spec.rb +3 -7
- data/spec/features/order_spec.rb +3 -1
- data/spec/features/products_spec.rb +4 -3
- data/spec/features/promotion_code_invalidation_spec.rb +2 -0
- data/spec/features/quantity_promotions_spec.rb +2 -0
- data/spec/features/taxons_spec.rb +2 -0
- data/spec/features/template_rendering_spec.rb +2 -0
- data/spec/generators/solidus/views/override_generator_spec.rb +2 -0
- data/spec/helpers/base_helper_spec.rb +2 -0
- data/spec/helpers/order_helper_spec.rb +2 -0
- data/spec/helpers/taxon_filters_helper_spec.rb +12 -0
- data/spec/spec_helper.rb +4 -2
- data/spec/support/shared_contexts/checkout_setup.rb +2 -0
- data/spec/support/shared_contexts/custom_products.rb +2 -0
- data/spec/support/shared_contexts/locales.rb +16 -0
- data/spec/views/spree/checkout/_summary_spec.rb +2 -0
- metadata +35 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cbda316f20a7ec8eaaf8ceb257f2be0c088698ae84483e45c147cb540549343
|
4
|
+
data.tar.gz: 1f4814fdb442ab92bcc8f3afe518240a2307706a27a9e9aabe53af63f449c61d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1cef5e94666087162ce902fb34316830eabd60a7c17f9dec29d326142f69130be56dec9615b872389208b4b4621fc1be350aac11a6c35036ab321471e3b66cb
|
7
|
+
data.tar.gz: 96b0f73a8acbc96e70a465bf6919d6c8bda9e425d2aed6478bbfc5c6af097ac5688038edf0eb0379ba3545df61d5d0e42853c91303b20f9e8bd4a4b98a1f61ed
|
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rubygems'
|
2
4
|
require 'rake'
|
3
5
|
require 'rake/testtask'
|
@@ -8,7 +10,7 @@ RSpec::Core::RakeTask.new
|
|
8
10
|
task default: :spec
|
9
11
|
|
10
12
|
DummyApp::RakeTasks.new(
|
11
|
-
gem_root: File.expand_path(
|
13
|
+
gem_root: File.expand_path(__dir__),
|
12
14
|
lib_name: 'solidus_frontend'
|
13
15
|
)
|
14
16
|
|
@@ -43,7 +43,6 @@ Spree.ready(function($) {
|
|
43
43
|
var statePara = $("#" + region + "state");
|
44
44
|
var stateSelect = statePara.find("select");
|
45
45
|
var stateInput = statePara.find("input");
|
46
|
-
var stateSpanRequired = statePara.find('[id$="state-required"]');
|
47
46
|
if (states.length > 0) {
|
48
47
|
var selected = parseInt(stateSelect.val());
|
49
48
|
stateSelect.html("");
|
@@ -68,21 +67,21 @@ Spree.ready(function($) {
|
|
68
67
|
statePara.show();
|
69
68
|
if (statesRequired) {
|
70
69
|
stateSelect.addClass("required");
|
71
|
-
|
70
|
+
statePara.addClass("field-required");
|
72
71
|
} else {
|
73
72
|
stateSelect.removeClass("required");
|
74
|
-
|
73
|
+
statePara.removeClass("field-required");
|
75
74
|
}
|
76
75
|
stateInput.removeClass("required");
|
77
76
|
} else {
|
78
77
|
stateSelect.hide().prop("disabled", true);
|
79
78
|
stateInput.show();
|
80
79
|
if (statesRequired) {
|
81
|
-
|
80
|
+
statePara.addClass("field-required");
|
82
81
|
stateInput.addClass("required");
|
83
82
|
} else {
|
84
83
|
stateInput.val("");
|
85
|
-
|
84
|
+
statePara.removeClass("field-required");
|
86
85
|
stateInput.removeClass("required");
|
87
86
|
}
|
88
87
|
statePara.toggle(!!statesRequired);
|
@@ -143,10 +143,27 @@ label.error {
|
|
143
143
|
margin-top: 3px;
|
144
144
|
}
|
145
145
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
146
|
+
.field {
|
147
|
+
padding: 10px 0;
|
148
|
+
|
149
|
+
label {
|
150
|
+
display: inline-block;
|
151
|
+
margin-bottom: 5px;
|
152
|
+
}
|
153
|
+
|
154
|
+
input,
|
155
|
+
select {
|
156
|
+
display: block;
|
157
|
+
}
|
158
|
+
|
159
|
+
&-required label:after {
|
160
|
+
content: "*";
|
161
|
+
display: inline-block;
|
162
|
+
color: $c_red;
|
163
|
+
font-weight: bold;
|
164
|
+
font-size: 1.2em;
|
165
|
+
margin-left: 3px;
|
166
|
+
}
|
150
167
|
}
|
151
168
|
|
152
169
|
fieldset {
|
@@ -356,9 +373,14 @@ nav#taxonomies {
|
|
356
373
|
}
|
357
374
|
|
358
375
|
.taxons-list {
|
376
|
+
ul {
|
377
|
+
margin-left: 1em;
|
378
|
+
}
|
359
379
|
li {
|
360
|
-
|
361
|
-
|
380
|
+
font-size: $main_navigation_font_size;
|
381
|
+
font-weight: normal;
|
382
|
+
&.current {
|
383
|
+
font-weight: bold;
|
362
384
|
}
|
363
385
|
}
|
364
386
|
}
|
@@ -640,6 +662,10 @@ ul#products {
|
|
640
662
|
/*--------------------------------------*/
|
641
663
|
/* Checkout
|
642
664
|
/*--------------------------------------*/
|
665
|
+
.checkout_form_wrapper {
|
666
|
+
text-align: left;
|
667
|
+
}
|
668
|
+
|
643
669
|
.out-of-stock {
|
644
670
|
background: #df0000;
|
645
671
|
color: white;
|
@@ -876,7 +902,7 @@ ul#products {
|
|
876
902
|
.shipping-methods {
|
877
903
|
list-style: none;
|
878
904
|
margin: 0;
|
879
|
-
padding:
|
905
|
+
padding: 10px 0;
|
880
906
|
|
881
907
|
.shipping-method {
|
882
908
|
display: inline-block;
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Spree
|
2
4
|
# This is somewhat contrary to standard REST convention since there is not
|
3
5
|
# actually a Checkout object. There's enough distinct logic specific to
|
@@ -34,7 +36,6 @@ module Spree
|
|
34
36
|
return
|
35
37
|
end
|
36
38
|
|
37
|
-
|
38
39
|
if @order.completed?
|
39
40
|
finalize_order
|
40
41
|
else
|
@@ -88,7 +89,7 @@ module Spree
|
|
88
89
|
if update_params = massaged_params[:order]
|
89
90
|
update_params.permit(permitted_checkout_attributes)
|
90
91
|
else
|
91
|
-
# We
|
92
|
+
# We currently allow update requests without any parameters in them.
|
92
93
|
{}
|
93
94
|
end
|
94
95
|
end
|
@@ -110,7 +111,7 @@ module Spree
|
|
110
111
|
def ensure_valid_state
|
111
112
|
unless skip_state_validation?
|
112
113
|
if (params[:state] && !@order.has_checkout_step?(params[:state])) ||
|
113
|
-
|
114
|
+
(!params[:state] && !@order.has_checkout_step?(@order.state))
|
114
115
|
@order.state = 'cart'
|
115
116
|
redirect_to checkout_state_path(@order.checkout_steps.first)
|
116
117
|
end
|
@@ -174,7 +175,7 @@ module Spree
|
|
174
175
|
@order.assign_default_user_addresses
|
175
176
|
# If the user has a default address, the previous method call takes care
|
176
177
|
# of setting that; but if he doesn't, we need to build an empty one here
|
177
|
-
default = {country_id: Spree::Country.default.id}
|
178
|
+
default = { country_id: Spree::Country.default.id }
|
178
179
|
@order.build_bill_address(default) unless @order.bill_address
|
179
180
|
@order.build_ship_address(default) if @order.checkout_steps.include?('delivery') && !@order.ship_address
|
180
181
|
end
|
@@ -1,16 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Spree
|
2
4
|
class LocaleController < Spree::StoreController
|
3
5
|
def set
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
if
|
8
|
-
session[:locale] =
|
6
|
+
available_locales = Spree.i18n_available_locales
|
7
|
+
requested_locale = params[:switch_to_locale] || params[:locale]
|
8
|
+
|
9
|
+
if requested_locale && available_locales.map(&:to_s).include?(requested_locale)
|
10
|
+
session[:locale] = requested_locale
|
11
|
+
I18n.locale = requested_locale
|
9
12
|
flash.notice = t('spree.locale_changed')
|
10
13
|
else
|
11
14
|
flash[:error] = t('spree.locale_not_changed')
|
12
15
|
end
|
13
|
-
|
16
|
+
|
17
|
+
redirect_to spree.root_path
|
14
18
|
end
|
15
19
|
end
|
16
20
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Spree
|
2
4
|
class OrdersController < Spree::StoreController
|
3
5
|
before_action :check_authorization
|
@@ -71,7 +73,7 @@ module Spree
|
|
71
73
|
|
72
74
|
def populate_redirect
|
73
75
|
flash[:error] = t('spree.populate_get_error')
|
74
|
-
redirect_to
|
76
|
+
redirect_to spree.cart_path
|
75
77
|
end
|
76
78
|
|
77
79
|
def empty
|
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Spree
|
2
4
|
class ProductsController < Spree::StoreController
|
3
5
|
before_action :load_product, only: :show
|
4
6
|
before_action :load_taxon, only: :index
|
5
7
|
|
6
|
-
helper 'spree/taxons'
|
8
|
+
helper 'spree/taxons', 'spree/taxon_filters'
|
7
9
|
|
8
10
|
respond_to :html
|
9
11
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spree/core/product_filters'
|
4
|
+
|
5
|
+
module Spree
|
6
|
+
module TaxonFiltersHelper
|
7
|
+
def applicable_filters_for(_taxon)
|
8
|
+
[:brand_filter, :price_filter].map do |filter_name|
|
9
|
+
Spree::Core::ProductFilters.send(filter_name) if Spree::Core::ProductFilters.respond_to?(filter_name)
|
10
|
+
end.compact
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -1,39 +1,39 @@
|
|
1
1
|
<% address_id = address_type.chars.first %>
|
2
2
|
<div class="inner" data-hook=<%="#{address_type}_inner" %>>
|
3
|
-
<
|
4
|
-
<%= form.label :firstname, t('spree.first_name')
|
3
|
+
<div class="field field-required" id=<%="#{address_id}firstname" %>>
|
4
|
+
<%= form.label :firstname, t('spree.first_name') %>
|
5
5
|
<%= form.text_field :firstname, class: 'required', autocomplete: address_type + ' given-name', required: true, autofocus: true %>
|
6
|
-
</
|
6
|
+
</div>
|
7
7
|
|
8
|
-
<
|
9
|
-
<%= form.label :lastname, t('spree.last_name')
|
8
|
+
<div class="field" id=<%="#{address_id}lastname" %>>
|
9
|
+
<%= form.label :lastname, t('spree.last_name') %>
|
10
10
|
<%= form.text_field :lastname, autocomplete: address_type + ' family-name' %>
|
11
|
-
</
|
11
|
+
</div>
|
12
12
|
|
13
13
|
<% if Spree::Config[:company] %>
|
14
|
-
<
|
15
|
-
<%= form.label :company, t('spree.company')
|
14
|
+
<div class="field" id=<%="#{address_id}company" %>>
|
15
|
+
<%= form.label :company, t('spree.company') %>
|
16
16
|
<%= form.text_field :company, autocomplete: address_type + ' organization' %>
|
17
|
-
</
|
17
|
+
</div>
|
18
18
|
<% end %>
|
19
19
|
|
20
|
-
<
|
21
|
-
<%= form.label :address1, t('spree.street_address')
|
20
|
+
<div class="field field-required" id=<%="#{address_id}address1" %>>
|
21
|
+
<%= form.label :address1, t('spree.street_address') %>
|
22
22
|
<%= form.text_field :address1, class: 'required', autocomplete: address_type + ' address-line1', required: true %>
|
23
|
-
</
|
23
|
+
</div>
|
24
24
|
|
25
|
-
<
|
26
|
-
<%= form.label :address2, I18n.t('spree.street_address_2')
|
25
|
+
<div class="field" id=<%="#{address_id}address2" %>>
|
26
|
+
<%= form.label :address2, I18n.t('spree.street_address_2') %>
|
27
27
|
<%= form.text_field :address2, autocomplete: address_type + ' address-line2' %>
|
28
|
-
</
|
28
|
+
</div>
|
29
29
|
|
30
|
-
<
|
31
|
-
<%= form.label :city, t('spree.city')
|
30
|
+
<div class="field field-required" id=<%="#{address_id}city" %>>
|
31
|
+
<%= form.label :city, t('spree.city') %>
|
32
32
|
<%= form.text_field :city, class: 'required', autocomplete: address_type + ' address-level2', required: true %>
|
33
|
-
</
|
33
|
+
</div>
|
34
34
|
|
35
|
-
<
|
36
|
-
<%= form.label :country_id, t('spree.country')
|
35
|
+
<div class="field field-required" id=<%="#{address_id}country" %>>
|
36
|
+
<%= form.label :country_id, t('spree.country') %>
|
37
37
|
<span id=<%="#{address_id}country-selection" %>>
|
38
38
|
<%= form.collection_select :country_id, available_countries, :id, :name, {},
|
39
39
|
class: 'required',
|
@@ -41,12 +41,12 @@
|
|
41
41
|
required: true
|
42
42
|
%>
|
43
43
|
</span>
|
44
|
-
</
|
44
|
+
</div>
|
45
45
|
|
46
46
|
<% if Spree::Config[:address_requires_state] %>
|
47
|
-
<
|
47
|
+
<div class="field field-required" id=<%="#{address_id}state" %>>
|
48
48
|
<% have_states = !address.country.states.empty? %>
|
49
|
-
<%= form.label :state, t('spree.state')
|
49
|
+
<%= form.label :state, t('spree.state') %>
|
50
50
|
|
51
51
|
<span class="js-address-fields" style="display: none;">
|
52
52
|
<%=
|
@@ -73,24 +73,24 @@
|
|
73
73
|
<noscript>
|
74
74
|
<%= form.text_field :state_name, class: 'required', autocomplete: address_type + ' address-level1', required: true %>
|
75
75
|
</noscript>
|
76
|
-
</
|
76
|
+
</div>
|
77
77
|
<% end %>
|
78
78
|
|
79
|
-
<
|
80
|
-
<%= form.label :zipcode, t('spree.zip')
|
79
|
+
<div class="field <%= 'field-required' if address.require_zipcode? %>" id=<%="#{address_id}zipcode" %>>
|
80
|
+
<%= form.label :zipcode, t('spree.zip') %>
|
81
81
|
<%= form.text_field :zipcode, class: "#{'required' if address.require_zipcode?}", autocomplete: address_type + ' postal-code', required: true %>
|
82
|
-
</
|
82
|
+
</div>
|
83
83
|
|
84
|
-
<
|
85
|
-
<%= form.label :phone, t('spree.phone')
|
84
|
+
<div class="field <%= 'field-required' if address.require_phone? %>" id=<%="#{address_id}phone" %>>
|
85
|
+
<%= form.label :phone, t('spree.phone') %>
|
86
86
|
<% phone_hash = address.require_phone? ? { class: 'required', required: true } : {} %>
|
87
87
|
<%= form.phone_field :phone, phone_hash.merge({ autocomplete: address_type + ' home tel' }) %>
|
88
|
-
</
|
88
|
+
</div>
|
89
89
|
|
90
90
|
<% if Spree::Config[:alternative_shipping_phone] %>
|
91
|
-
<
|
92
|
-
<%= form.label :alternative_phone, t('spree.alternative_phone')
|
91
|
+
<div class="field" id=<%="#{address_id}altphone" %>>
|
92
|
+
<%= form.label :alternative_phone, t('spree.alternative_phone') %>
|
93
93
|
<%= form.phone_field :alternative_phone, autocomplete: address_type + ' tel'%>
|
94
|
-
</
|
94
|
+
</div>
|
95
95
|
<% end %>
|
96
96
|
</div>
|
@@ -11,10 +11,10 @@
|
|
11
11
|
<fieldset id="shipping" data-hook>
|
12
12
|
<%= form.fields_for :ship_address do |ship_form| %>
|
13
13
|
<legend align="center"><%= t('spree.shipping_address') %></legend>
|
14
|
-
<
|
14
|
+
<div class="checkbox" data-hook="use_billing">
|
15
15
|
<%= check_box_tag 'order[use_billing]', '1', @order.shipping_eq_billing_address? %>
|
16
16
|
<%= label_tag :order_use_billing, t('spree.use_billing_address'), id: 'use_billing' %>
|
17
|
-
</
|
17
|
+
</div>
|
18
18
|
<%= render partial: 'spree/address/form', locals: { form: ship_form, address_type: 'shipping', address: @order.ship_address } %>
|
19
19
|
<% end %>
|
20
20
|
</fieldset>
|
@@ -38,7 +38,7 @@
|
|
38
38
|
</table>
|
39
39
|
|
40
40
|
<h5 class="stock-shipping-method-title"><%= t('spree.shipping_method') %></h5>
|
41
|
-
<ul class="
|
41
|
+
<ul class="radios shipping-methods">
|
42
42
|
<% ship_form.object.shipping_rates.each do |rate| %>
|
43
43
|
<li class="shipping-method">
|
44
44
|
<label>
|
@@ -15,7 +15,7 @@
|
|
15
15
|
</div>
|
16
16
|
|
17
17
|
<div id="existing_cards">
|
18
|
-
<
|
18
|
+
<div class="field" data-hook="existing_cards">
|
19
19
|
<table class="existing-credit-card-list">
|
20
20
|
<tbody>
|
21
21
|
<% @wallet_payment_sources.each do |wallet_payment_source| %>
|
@@ -31,7 +31,7 @@
|
|
31
31
|
<% end %>
|
32
32
|
</tbody>
|
33
33
|
</table>
|
34
|
-
</
|
34
|
+
</div>
|
35
35
|
</div>
|
36
36
|
<% end %>
|
37
37
|
|
@@ -57,7 +57,7 @@
|
|
57
57
|
</ul>
|
58
58
|
<br style="clear:both;" />
|
59
59
|
<p class='field' data-hook='coupon_code'>
|
60
|
-
<%= form.label :coupon_code
|
60
|
+
<%= form.label :coupon_code %>
|
61
61
|
<%= form.text_field :coupon_code %>
|
62
62
|
<button type="button" class="button" id="coupon-code-apply-button">
|
63
63
|
<%= t('spree.apply_code') %>
|
@@ -10,10 +10,10 @@
|
|
10
10
|
<div class="columns <%= if @order.state != 'confirm' then 'alpha twelve' else 'alpha omega sixteen' end %>" data-hook="checkout_form_wrapper">
|
11
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
|
+
<div class="field field-required" style='clear: both'>
|
14
14
|
<%= form.label :email %><br />
|
15
15
|
<%= form.email_field :email, required: true %>
|
16
|
-
</
|
16
|
+
</div>
|
17
17
|
<% end %>
|
18
18
|
<%= render @order.state, form: form %>
|
19
19
|
<% end %>
|
@@ -1,32 +1,31 @@
|
|
1
1
|
<%= image_tag 'credit_cards/credit_card.gif', id: 'credit-card-image' %>
|
2
2
|
<% param_prefix = "payment_source[#{payment_method.id}]" %>
|
3
3
|
|
4
|
-
<
|
5
|
-
<%= label_tag "name_on_card_#{payment_method.id}", t('spree.name_on_card')
|
4
|
+
<div class="field field-required">
|
5
|
+
<%= label_tag "name_on_card_#{payment_method.id}", t('spree.name_on_card') %>
|
6
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
|
+
</div>
|
8
8
|
|
9
|
-
<
|
10
|
-
<%= label_tag "card_number", t('spree.card_number')
|
9
|
+
<div class="field field-required" data-hook="card_number">
|
10
|
+
<%= label_tag "card_number", t('spree.card_number') %>
|
11
11
|
<%= text_field_tag "#{param_prefix}[number]", '', {id: 'card_number', class: 'required cardNumber', size: 19, maxlength: 19, autocomplete: "cc-number", type: "tel" } %>
|
12
|
-
|
13
12
|
<span id="card_type" style="display:none;">
|
14
13
|
( <span id="looks_like" ><%= t('spree.card_type_is') %> <span id="type"></span></span>
|
15
14
|
<span id="unrecognized"><%= t('spree.unrecognized_card_type') %></span>
|
16
15
|
)
|
17
16
|
</span>
|
18
|
-
</
|
17
|
+
</div>
|
19
18
|
|
20
|
-
<
|
21
|
-
<%= label_tag "card_expiry", t('spree.expiration')
|
19
|
+
<div class="field field-required" data-hook="card_expiration">
|
20
|
+
<%= label_tag "card_expiry", t('spree.expiration') %>
|
22
21
|
<%= text_field_tag "#{param_prefix}[expiry]", '', id: 'card_expiry', class: "required cardExpiry", placeholder: "MM / YY", type: "tel" %>
|
23
|
-
</
|
22
|
+
</div>
|
24
23
|
|
25
|
-
<
|
26
|
-
<%= label_tag "card_code", t('spree.card_code')
|
24
|
+
<div class="field field-required" data-hook="card_code">
|
25
|
+
<%= label_tag "card_code", t('spree.card_code') %>
|
27
26
|
<%= text_field_tag "#{param_prefix}[verification_value]", '', {id: 'card_code', class: 'required cardCode', size: 5, type: "tel", autocomplete: "off" } %>
|
28
27
|
<%= link_to "(#{t('spree.what_is_this')})", spree.cvv_path, target: '_blank', "data-hook" => "cvv_link", id: "cvv_link" %>
|
29
|
-
</
|
28
|
+
</div>
|
30
29
|
|
31
30
|
<% if @order.bill_address %>
|
32
31
|
<%= fields_for "#{param_prefix}[address_attributes]", @order.bill_address do |f| %>
|
@@ -22,7 +22,7 @@
|
|
22
22
|
<%= render "spree/orders/adjustments" %>
|
23
23
|
<% end %>
|
24
24
|
<tr class="cart-total">
|
25
|
-
<td colspan="4" align='right'><h5><%= t('spree.total') %></h5></
|
25
|
+
<td colspan="4" align='right'><h5><%= t('spree.total') %></h5></td>
|
26
26
|
<td colspan><h5><%= order.display_total %></h5></td>
|
27
27
|
<td></td>
|
28
28
|
</tr>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<% available_locales = current_store.available_locales %>
|
2
|
+
<% if available_locales.many? %>
|
3
|
+
<li id="locale_selector" data-hook>
|
4
|
+
<%= form_tag spree.select_locale_path, class: 'navbar-form' do %>
|
5
|
+
<div class="form-group">
|
6
|
+
<label for="switch_to_locale" class="sr-only">
|
7
|
+
<%= Spree.t(:'i18n.language') %>
|
8
|
+
</label>
|
9
|
+
<%=
|
10
|
+
select_tag(
|
11
|
+
:switch_to_locale,
|
12
|
+
options_for_select(
|
13
|
+
available_locales.map do |locale|
|
14
|
+
[I18n.t('spree.i18n.this_file_language', locale: locale, default: locale.to_s, fallback: false), locale]
|
15
|
+
end.sort,
|
16
|
+
selected: I18n.locale
|
17
|
+
),
|
18
|
+
class: 'form-control'
|
19
|
+
)
|
20
|
+
%>
|
21
|
+
<noscript><%= submit_tag t("spree.select") %></noscript>
|
22
|
+
</div>
|
23
|
+
<% end %>
|
24
|
+
</li>
|
25
|
+
<% end %>
|
data/config/routes.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
Spree::Core::Engine.routes.draw do
|
2
4
|
root to: 'home#index'
|
3
5
|
|
4
6
|
resources :products, only: [:index, :show]
|
5
7
|
|
6
8
|
get '/locale/set', to: 'locale#set'
|
9
|
+
post '/locale/set', to: 'locale#set', as: :select_locale
|
7
10
|
|
8
11
|
# non-restful checkout stuff
|
9
12
|
patch '/checkout/update/:state', to: 'checkout#update', as: :update_checkout
|
data/lib/solidus_frontend.rb
CHANGED