spree_frontend 4.1.0.rc2 → 4.1.0.rc3

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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spree/frontend/cart.js +12 -0
  3. data/app/assets/javascripts/spree/frontend/checkout/address.js +2 -3
  4. data/app/assets/javascripts/spree/frontend/checkout/shipment.js +16 -4
  5. data/app/assets/javascripts/spree/frontend/views/spree/layouts/spree_application.js +30 -0
  6. data/app/assets/javascripts/spree/frontend/views/spree/products/modal_carousel.js +31 -12
  7. data/app/assets/javascripts/spree/frontend/views/spree/shared/carousel/thumbnails.js +77 -37
  8. data/app/assets/javascripts/spree/frontend/views/spree/shared/nav_bar.js +16 -7
  9. data/app/assets/javascripts/spree/frontend/views/spree/shared/product_added_modal.js +1 -1
  10. data/app/assets/stylesheets/spree/frontend/application.scss +1 -0
  11. data/app/assets/stylesheets/spree/frontend/components-bootstrap/modal.scss +4 -0
  12. data/app/assets/stylesheets/spree/frontend/components-custom/inputs.scss +14 -13
  13. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/confirm.scss +5 -0
  14. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/edit.scss +7 -0
  15. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/registration.scss +0 -1
  16. data/app/assets/stylesheets/spree/frontend/views/spree/orders/edit.scss +9 -0
  17. data/app/assets/stylesheets/spree/frontend/views/spree/products/cart_form.scss +17 -15
  18. data/app/assets/stylesheets/spree/frontend/views/spree/products/show.scss +7 -0
  19. data/app/assets/stylesheets/spree/frontend/views/spree/shared/carousel/thumbnails.scss +3 -12
  20. data/app/assets/stylesheets/spree/frontend/views/spree/shared/delete_address_popup.scss +3 -26
  21. data/app/assets/stylesheets/spree/frontend/views/spree/shared/dropdown.scss +3 -0
  22. data/app/assets/stylesheets/spree/frontend/views/spree/shared/main_nav_bar.scss +2 -1
  23. data/app/assets/stylesheets/spree/frontend/views/spree/shared/quantity_select.scss +3 -1
  24. data/app/controllers/spree/products_controller.rb +13 -0
  25. data/app/controllers/spree/taxons_controller.rb +32 -7
  26. data/app/helpers/spree/addresses_helper.rb +3 -1
  27. data/app/helpers/spree/frontend_helper.rb +15 -6
  28. data/app/views/spree/checkout/_delivery.html.erb +2 -1
  29. data/app/views/spree/checkout/_summary.html.erb +29 -2
  30. data/app/views/spree/checkout/edit.html.erb +7 -5
  31. data/app/views/spree/checkout/registration.html.erb +1 -1
  32. data/app/views/spree/products/_cart_form.html.erb +2 -2
  33. data/app/views/spree/products/_filters_desktop.html.erb +3 -3
  34. data/app/views/spree/products/_filters_mobile.html.erb +7 -7
  35. data/app/views/spree/products/_gallery_modal.html.erb +2 -2
  36. data/app/views/spree/products/_sort_desktop.html.erb +2 -2
  37. data/app/views/spree/products/_sort_mobile.html.erb +2 -2
  38. data/app/views/spree/shared/_cart.html.erb +0 -2
  39. data/app/views/spree/shared/_checkout_header.html.erb +1 -1
  40. data/app/views/spree/shared/_copyright.html.erb +1 -1
  41. data/app/views/spree/shared/_header.html.erb +1 -1
  42. data/app/views/spree/shared/_link_to_cart.html.erb +5 -2
  43. data/app/views/spree/shared/_main_nav_bar.html.erb +3 -3
  44. data/app/views/spree/shared/_nav_bar.html.erb +1 -1
  45. data/app/views/spree/shared/_option_values.html.erb +1 -1
  46. data/app/views/spree/shared/_registration.html.erb +1 -1
  47. data/app/views/spree/shared/carousel/_thumbnails.html.erb +1 -1
  48. data/app/views/spree/taxons/_subcategories.html.erb +2 -3
  49. metadata +7 -6
@@ -51,4 +51,5 @@
51
51
  @import "spree/frontend/views/spree/shared/mobile_navigation";
52
52
  @import "spree/frontend/views/spree/shared/no_product_available";
53
53
  @import "spree/frontend/views/spree/shared/color_select";
54
+ @import "spree/frontend/views/spree/shared/dropdown";
54
55
  @import "spree/frontend/views/spree/shared/delete_address_popup";
@@ -1,3 +1,7 @@
1
1
  .modal-backdrop {
2
2
  background: adjust-color(theme-color-level('dark', -5), $alpha: -0.4);
3
3
  }
4
+
5
+ .modal {
6
+ padding: 0 !important
7
+ }
@@ -1,5 +1,5 @@
1
1
  .spree-flat-input {
2
- color: theme-color('secondary');
2
+ color: theme-color("secondary");
3
3
  transition: basic-transition(border-color);
4
4
  padding: 15px;
5
5
  width: 100%;
@@ -11,6 +11,9 @@
11
11
  outline: none;
12
12
  font-size: font-px-to-rem(12px);
13
13
  line-height: inherit;
14
+ appearance: none;
15
+ -webkit-appearance: none;
16
+ -moz-appearance: none;
14
17
  @include media-breakpoint-up(sm) {
15
18
  padding: 25px;
16
19
  font-size: font-px-to-rem(23px);
@@ -20,7 +23,7 @@
20
23
  font-size: font-px-to-rem(14px);
21
24
  }
22
25
  &:focus {
23
- border-color: theme-color('secondary');
26
+ border-color: theme-color("secondary");
24
27
  }
25
28
  &::placeholder {
26
29
  text-transform: uppercase;
@@ -45,12 +48,8 @@
45
48
  }
46
49
  }
47
50
 
48
- label {
49
- color: theme-color('secondary');
50
- }
51
-
52
51
  .spree-flat-label {
53
- color: theme-color('secondary');
52
+ color: theme-color("secondary");
54
53
  text-transform: uppercase;
55
54
  font-size: font-px-to-rem(12px);
56
55
 
@@ -83,7 +82,7 @@ label {
83
82
  height: 22px;
84
83
  }
85
84
 
86
- input[type='checkbox'] {
85
+ input[type="checkbox"] {
87
86
  display: none;
88
87
  }
89
88
 
@@ -94,8 +93,9 @@ label {
94
93
  height: 22px;
95
94
  font-size: 0;
96
95
  border-radius: 0;
97
- border: 2px solid theme-color('secondary');
96
+ border: 2px solid theme-color("secondary");
98
97
  background-color: $input-background;
98
+ cursor: pointer;
99
99
 
100
100
  @include media-breakpoint-up(sm) {
101
101
  width: 32px;
@@ -111,7 +111,7 @@ label {
111
111
  label:after {
112
112
  transition: basic-transition(opacity);
113
113
  opacity: 0;
114
- content: '';
114
+ content: "";
115
115
  position: absolute;
116
116
  width: 12px;
117
117
  height: 8px;
@@ -138,8 +138,8 @@ label {
138
138
  }
139
139
  }
140
140
 
141
- input[type='checkbox']:checked + label {
142
- background-color: theme-color('secondary');
141
+ input[type="checkbox"]:checked + label {
142
+ background-color: theme-color("secondary");
143
143
 
144
144
  &:after {
145
145
  opacity: 1;
@@ -165,7 +165,7 @@ label {
165
165
  }
166
166
 
167
167
  .spree-checkbox-label {
168
- color: theme-color('info');
168
+ color: theme-color("info");
169
169
  font-size: font-px-to-rem(12px);
170
170
  margin: 0;
171
171
  // Autoprefixer don't seem to catch this
@@ -174,6 +174,7 @@ label {
174
174
  -moz-user-select: none;
175
175
  -ms-user-select: none;
176
176
  user-select: none;
177
+ cursor: pointer;
177
178
 
178
179
  @include media-breakpoint-up(sm) {
179
180
  font-size: font-px-to-rem(21px);
@@ -2,6 +2,11 @@
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
 
5
+ div:first-child {
6
+ -webkit-flex: 0;
7
+ flex-shrink: 0;
8
+ }
9
+
5
10
  &-order-details {
6
11
  padding-bottom: 40px;
7
12
  font-weight: 500;
@@ -1,4 +1,11 @@
1
1
  .checkout {
2
+ &-summary {
3
+ &-container {
4
+ @include media-breakpoint-up(lg) {
5
+ top: $spree-header-desktop-height + 25px;
6
+ }
7
+ }
8
+ }
2
9
  &-header {
3
10
  margin: 0;
4
11
  &-link {
@@ -1,6 +1,5 @@
1
1
  .checkout-registration {
2
2
  padding-bottom: 64px;
3
- border-bottom: 1px solid theme-color('borders');
4
3
 
5
4
  &-styled-or {
6
5
  font-size: 12px;
@@ -215,13 +215,17 @@
215
215
  margin: 0;
216
216
  }
217
217
  input[type="number"] {
218
+ -webkit-appearance: none;
218
219
  -moz-appearance: textfield;
220
+ appearance: none;
219
221
  }
220
222
  button {
221
223
  font-size: font-px-to-rem(14px);
222
224
  height: 25px;
223
225
  background-color: $input-background;
224
226
  border-color: theme-color("borders");
227
+ border-width: 1px !important;
228
+ border-style: solid;
225
229
  color: color-yiq($input-background);
226
230
  @include media-breakpoint-up(sm) {
227
231
  height: 51.4px;
@@ -354,6 +358,11 @@
354
358
  }
355
359
  }
356
360
  }
361
+ input[type=text] {
362
+ -webkit-appearance: none;
363
+ -moz-appearance: none;
364
+ appearance: none;
365
+ }
357
366
  }
358
367
  &-total {
359
368
  margin-top: 28px;
@@ -27,6 +27,7 @@
27
27
  .quantity-select button {
28
28
  background: $input-background;
29
29
  color: color-yiq($input-background);
30
+ touch-action: manipulation;
30
31
  }
31
32
  @include media-breakpoint-up(md) {
32
33
  &-price {
@@ -62,8 +63,8 @@
62
63
  list-style: none;
63
64
  padding: 0;
64
65
  margin: 0;
65
- margin-left: - calc-spacer(1);
66
- margin-right: - calc-spacer(1);
66
+ margin-left: -calc-spacer(1);
67
+ margin-right: -calc-spacer(1);
67
68
  &-label {
68
69
  font-size: font-px-to-rem(11px);
69
70
  border: 2px solid theme-color-level("light", 1);
@@ -80,12 +81,12 @@
80
81
  opacity: 0;
81
82
  position: fixed;
82
83
  &:checked {
83
- &+#{$self}-variant-values-label {
84
+ & + #{$self}-variant-values-label {
84
85
  border-color: theme-color("dark-text");
85
86
  }
86
87
  }
87
88
  &--bad-combination {
88
- &+#{$self2}-label {
89
+ & + #{$self2}-label {
89
90
  position: relative;
90
91
  color: theme-color-level("light", 1);
91
92
  &:hover {
@@ -96,7 +97,7 @@
96
97
  display: block;
97
98
  width: 2px;
98
99
  height: 100% * sqrt(2);
99
- content: '';
100
+ content: "";
100
101
  background: theme-color-level("light", 1);
101
102
  transition: background 200ms;
102
103
  transform: rotate(-45deg);
@@ -112,7 +113,8 @@
112
113
  cursor: not-allowed;
113
114
  opacity: 0.5;
114
115
 
115
- &:active, &:focus {
116
+ &:active,
117
+ &:focus {
116
118
  outline: theme-color("dark-text") dotted thin;
117
119
  }
118
120
  }
@@ -133,7 +135,7 @@
133
135
  line-height: $size - $size-border * 2;
134
136
  &:before {
135
137
  $inner-circle-size: $size - ($size-border - 1px) * 2; // Cover outer border by 1px to avoid color bleed.
136
- content: '';
138
+ content: "";
137
139
  margin: -1px;
138
140
  display: block;
139
141
  border: 2px solid theme-color("light");
@@ -145,7 +147,7 @@
145
147
  }
146
148
  &-radio {
147
149
  &--bad-combination {
148
- &+#{$self}-variant-values-label {
150
+ & + #{$self}-variant-values-label {
149
151
  &:after {
150
152
  height: 100%;
151
153
  top: 0;
@@ -154,7 +156,7 @@
154
156
  }
155
157
  &:checked {
156
158
  &--bad-combination {
157
- &+#{$self}-variant-values-label {
159
+ & + #{$self}-variant-values-label {
158
160
  &:after {
159
161
  background: theme-color("dark-text");
160
162
  }
@@ -177,7 +179,7 @@
177
179
  }
178
180
  &-radio {
179
181
  &--bad-combination {
180
- &+#{$self}-variant-values-label {
182
+ & + #{$self}-variant-values-label {
181
183
  &:hover {
182
184
  &:after {
183
185
  background: theme-color-level("light", 1);
@@ -190,7 +192,7 @@
190
192
  }
191
193
  }
192
194
  }
193
- &>li+li{
195
+ & > li + li {
194
196
  margin-top: calc-spacer(4);
195
197
  }
196
198
  @include media-breakpoint-up(md) {
@@ -210,21 +212,21 @@
210
212
  .select-label {
211
213
  cursor: pointer;
212
214
  padding: 4px 7px;
213
- border: 2px solid theme-color('borders');
215
+ border: 2px solid theme-color("borders");
214
216
  min-width: 32px;
215
217
  max-height: 32px;
216
218
  text-align: center;
217
219
  font-size: font-px-to-rem(14px);
218
220
  font-weight: 500;
219
221
  @include media-breakpoint-up(sm) {
220
- border: 3px solid theme-color('borders');
222
+ border: 3px solid theme-color("borders");
221
223
  padding: 7px 7px;
222
224
  min-width: 49px;
223
225
  max-height: 49px;
224
226
  font-size: font-px-to-rem(20px);
225
227
  }
226
228
  @include media-breakpoint-up(md) {
227
- border: 2px solid theme-color('borders');
229
+ border: 2px solid theme-color("borders");
228
230
  padding: 4px 7px;
229
231
  min-width: 32px;
230
232
  max-height: 32px;
@@ -232,7 +234,7 @@
232
234
  }
233
235
 
234
236
  input:checked + & {
235
- border-color: theme-color('secondary');
237
+ border-color: theme-color("secondary");
236
238
  }
237
239
  }
238
240
 
@@ -163,3 +163,10 @@
163
163
  line-height: font-px-to-rem(26px);
164
164
  }
165
165
  }
166
+
167
+ .breadcrumb-item:last-of-type {
168
+ display: none;
169
+ @include media-breakpoint-up(md) {
170
+ display: block;
171
+ }
172
+ }
@@ -11,21 +11,12 @@
11
11
  display: block;
12
12
  }
13
13
  &-single {
14
- height: 0;
15
- padding-bottom: $thumbnails-carousel-single-height;
16
14
  position: relative;
17
15
  display: none;
18
-
19
- .modal-dialog--zoom & {
20
- padding-bottom: $thumbnails-carousel-single-height-zoom;
21
- }
16
+ overflow: hidden;
22
17
 
23
18
  img {
24
- position: absolute;
25
- width: 100%;
26
- height: 100%;
27
- object-fit: contain;
28
- border: 1px solid transparent;
19
+ border: 2px solid transparent;
29
20
  &.selected {
30
21
  border-color: $secondary-color;
31
22
  }
@@ -75,7 +66,7 @@
75
66
  &-single {
76
67
  &--visible {
77
68
  & ~ & {
78
- margin-top: $single-gap-md;
69
+ margin-top: $single-gap-md / 2;
79
70
  }
80
71
 
81
72
  .modal-dialog--zoom & ~ & {
@@ -36,29 +36,6 @@
36
36
  width: 80%;
37
37
  }
38
38
 
39
- form {
40
- input#keywords {
41
- color: theme-color('dark-text');
42
- font-size: font-px-to-rem(14px);
43
- width: calc(100% - 40px);
44
- &:focus {
45
- outline: none;
46
- }
47
- &::placeholder {
48
- color: theme-color('borders');
49
- }
50
- &::-webkit-search-cancel-button {
51
- display: none;
52
- }
53
- @include media-breakpoint-up(lg) {
54
- font-size: font-px-to-rem(22px);
55
- }
56
- }
57
- input[type='submit'] {
58
- display: none;
59
- }
60
- }
61
-
62
39
  &.shown {
63
40
  visibility: visible;
64
41
  opacity: 1;
@@ -71,7 +48,7 @@
71
48
  line-height: 0.91;
72
49
  letter-spacing: 0.55px;
73
50
  text-align: center;
74
- color: #232323;
51
+ color: $font-color;
75
52
  margin-bottom: 23px;
76
53
 
77
54
  @include media-breakpoint-up(lg) {
@@ -88,7 +65,7 @@
88
65
  line-height: 1.38;
89
66
  letter-spacing: 0.4px;
90
67
  text-align: center;
91
- color: #232323;
68
+ color: $font-color;
92
69
  margin: auto;
93
70
 
94
71
  @include media-breakpoint-up(sm) {
@@ -101,7 +78,7 @@
101
78
  &-buttons {
102
79
  margin-top: 48px;
103
80
  justify-content: space-evenly;
104
- @supports (-ms-ime-align:auto) {
81
+ @supports (-ms-ime-align: auto) {
105
82
  justify-content: space-around;
106
83
  }
107
84
  }
@@ -0,0 +1,3 @@
1
+ .spree-flat-select-arrow {
2
+ pointer-events: none;
3
+ }
@@ -67,6 +67,7 @@
67
67
  display: none;
68
68
  background: $meganav-background;
69
69
  background-clip: padding-box;
70
+ border-top: 1px solid $global-border-style;
70
71
 
71
72
  form {
72
73
  input#keywords {
@@ -92,7 +93,7 @@
92
93
  }
93
94
 
94
95
  @include media-breakpoint-up(xl) {
95
- top: $spree-header-desktop-height;
96
+ top: $spree-header-desktop-height - 1px;
96
97
  }
97
98
  }
98
99
  }
@@ -50,6 +50,8 @@
50
50
  margin: 0;
51
51
  }
52
52
  input[type=number] {
53
- -moz-appearance:textfield;
53
+ -webkit-appearance: none;
54
+ -moz-appearance:textfield;
55
+ appearance: none;
54
56
  }
55
57
  }
@@ -1,6 +1,7 @@
1
1
  module Spree
2
2
  class ProductsController < Spree::StoreController
3
3
  include Spree::ProductsHelper
4
+ include Spree::FrontendHelper
4
5
 
5
6
  before_action :load_product, only: [:show, :related]
6
7
  before_action :load_taxon, only: :index
@@ -10,6 +11,17 @@ module Spree
10
11
  def index
11
12
  @searcher = build_searcher(params.merge(include_images: true))
12
13
  @products = @searcher.retrieve_products
14
+
15
+ last_modified = @products.maximum(:updated_at)&.utc if @products.respond_to?(:maximum)
16
+
17
+ etag = [
18
+ store_etag,
19
+ last_modified&.to_i,
20
+ available_option_types_cache_key,
21
+ filtering_params_cache_key
22
+ ]
23
+
24
+ fresh_when etag: etag, last_modified: last_modified, public: true
13
25
  end
14
26
 
15
27
  def show
@@ -20,6 +32,7 @@ module Spree
20
32
  if stale?(etag: product_etag, last_modified: @product.updated_at.utc, public: true)
21
33
  @product_summary = Spree::ProductSummaryPresenter.new(@product).call
22
34
  @product_properties = @product.product_properties.includes(:property)
35
+ @product_price = @product.price_in(current_currency).amount
23
36
  load_variants
24
37
  @product_images = product_images(@product, @variants)
25
38
  end