spree_frontend 4.2.5 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (159) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -1
  3. data/app/assets/config/spree_frontend_manifest.js +4 -0
  4. data/app/assets/images/arrow-right-circle-fill.svg +3 -0
  5. data/app/assets/images/card-image.svg +4 -0
  6. data/app/assets/images/file-image.svg +4 -0
  7. data/app/assets/images/image.svg +4 -0
  8. data/app/assets/images/noimage/large.png +0 -0
  9. data/app/assets/images/noimage/mini.png +0 -0
  10. data/app/assets/images/noimage/plp.svg +23 -0
  11. data/app/assets/images/noimage/product.png +0 -0
  12. data/app/assets/images/noimage/small.png +0 -0
  13. data/app/assets/javascripts/spree/api/main.js +36 -0
  14. data/app/assets/javascripts/spree/api/storefront/cart.js +49 -0
  15. data/app/assets/javascripts/spree/frontend/checkout/payment.js +18 -5
  16. data/app/assets/javascripts/spree/frontend/checkout.js +16 -0
  17. data/app/assets/javascripts/spree/frontend/locale.es6 +13 -0
  18. data/app/assets/javascripts/spree/frontend/views/spree/home/product_carousels.js +3 -3
  19. data/app/assets/javascripts/spree/frontend/views/spree/products/index.js +0 -9
  20. data/app/assets/javascripts/spree/frontend/views/spree/products/price_filters.es6 +46 -0
  21. data/app/assets/javascripts/spree/frontend.js +3 -0
  22. data/app/assets/javascripts/spree.js +78 -0
  23. data/app/assets/stylesheets/spree/frontend/application.scss +1 -0
  24. data/app/assets/stylesheets/spree/frontend/components-bootstrap/button.scss +8 -0
  25. data/app/assets/stylesheets/spree/frontend/helpers/spree/frontend_helper.scss +41 -0
  26. data/app/assets/stylesheets/spree/frontend/variables/variables.scss +2 -2
  27. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/edit.scss +17 -5
  28. data/app/assets/stylesheets/spree/frontend/views/spree/cms_sections/_index.scss +1 -0
  29. data/app/assets/stylesheets/spree/frontend/views/spree/cms_sections/product_buy_bar.scss +20 -0
  30. data/app/assets/stylesheets/spree/frontend/views/spree/home/index.scss +54 -67
  31. data/app/assets/stylesheets/spree/frontend/views/spree/shared/category_nav_bar.scss +3 -3
  32. data/app/assets/stylesheets/spree/frontend/views/spree/shared/footer.scss +4 -0
  33. data/app/assets/stylesheets/spree/frontend/views/spree/shared/main_nav_bar.scss +12 -1
  34. data/app/controllers/spree/addresses_controller.rb +14 -23
  35. data/app/controllers/spree/checkout_controller.rb +5 -3
  36. data/app/controllers/spree/cms_pages_controller.rb +29 -0
  37. data/app/controllers/spree/content_controller.rb +0 -2
  38. data/app/controllers/spree/errors_controller.rb +11 -0
  39. data/app/controllers/spree/home_controller.rb +34 -1
  40. data/app/controllers/spree/locale_controller.rb +7 -1
  41. data/app/controllers/spree/orders_controller.rb +9 -7
  42. data/app/controllers/spree/products_controller.rb +14 -13
  43. data/app/controllers/spree/store_controller.rb +25 -1
  44. data/app/controllers/spree/taxons_controller.rb +12 -5
  45. data/app/helpers/spree/addresses_helper.rb +9 -4
  46. data/app/helpers/spree/cms_pages_helper.rb +23 -0
  47. data/app/helpers/spree/frontend_helper.rb +109 -10
  48. data/app/helpers/spree/navigation_helper.rb +73 -4
  49. data/app/helpers/spree/products_filters_helper.rb +168 -0
  50. data/app/helpers/spree/store_helper.rb +3 -1
  51. data/app/views/spree/checkout/_address.html.erb +1 -1
  52. data/app/views/spree/checkout/_credit_card.html.erb +1 -0
  53. data/app/views/spree/cms_pages/show.html.erb +16 -0
  54. data/app/views/spree/errors/forbidden.html.erb +0 -0
  55. data/app/views/spree/errors/unauthorized.html.erb +0 -0
  56. data/app/views/spree/home/index.html.erb +19 -118
  57. data/app/views/spree/layouts/spree_application.html.erb +3 -2
  58. data/app/views/spree/products/_description.html.erb +16 -19
  59. data/app/views/spree/products/_filters_desktop.html.erb +50 -15
  60. data/app/views/spree/products/_filters_mobile.html.erb +38 -10
  61. data/app/views/spree/products/_sort_desktop.html.erb +17 -11
  62. data/app/views/spree/products/_sort_mobile.html.erb +16 -0
  63. data/app/views/spree/products/index.html.erb +1 -1
  64. data/app/views/spree/shared/_carousel_4_products.html.erb +8 -8
  65. data/app/views/spree/shared/_checkout_header.html.erb +22 -21
  66. data/app/views/spree/shared/_copyright.html.erb +1 -10
  67. data/app/views/spree/shared/_footer.html.erb +18 -12
  68. data/app/views/spree/shared/_get_started.html.erb +32 -0
  69. data/app/views/spree/shared/_head.html.erb +1 -1
  70. data/app/views/spree/shared/_header.html.erb +3 -3
  71. data/app/views/spree/shared/_main_nav_bar.html.erb +61 -43
  72. data/app/views/spree/shared/_mobile_navigation.html.erb +30 -19
  73. data/app/views/spree/shared/_nav_bar.html.erb +1 -1
  74. data/app/views/spree/shared/_option_values.html.erb +2 -21
  75. data/app/views/spree/shared/_order_details.html.erb +1 -1
  76. data/app/views/spree/shared/_paths.html.erb +8 -0
  77. data/app/views/spree/shared/_properties.html.erb +4 -0
  78. data/app/views/spree/shared/_translations.html.erb +2 -1
  79. data/app/views/spree/shared/carousel/_single.html.erb +1 -1
  80. data/app/views/spree/shared/carousel/_thumbnails.html.erb +1 -1
  81. data/app/views/spree/shared/cms/pages/_edit_mode.html.erb +13 -0
  82. data/app/views/spree/shared/cms/sections/_featured_article.html.erb +27 -0
  83. data/app/views/spree/shared/cms/sections/_hero_image.html.erb +60 -0
  84. data/app/views/spree/shared/cms/sections/_image_gallery.html.erb +171 -0
  85. data/app/views/spree/shared/cms/sections/_product_carousel.html.erb +5 -0
  86. data/app/views/spree/shared/cms/sections/_rich_text_content.html.erb +3 -0
  87. data/app/views/spree/shared/cms/sections/_side_by_side_images.html.erb +118 -0
  88. data/app/views/spree/taxons/_header.html.erb +6 -1
  89. data/app/views/spree/users/show.html.erb +4 -1
  90. data/config/initializers/assets.rb +4 -13
  91. data/config/routes.rb +10 -4
  92. data/lib/generators/spree/frontend/install/install_generator.rb +5 -5
  93. data/lib/generators/spree/frontend/install/templates/app/assets/config/manifest.js +2 -0
  94. data/lib/generators/spree/frontend/install/templates/vendor/assets/javascripts/spree/frontend/all.js +8 -0
  95. data/lib/generators/spree/frontend/install/templates/vendor/assets/stylesheets/spree/frontend/all.css +9 -0
  96. data/lib/spree/frontend/engine.rb +6 -0
  97. data/lib/spree/frontend.rb +6 -3
  98. data/spec/fixtures/files/store_favicon.ico +0 -0
  99. data/spree_frontend.gemspec +8 -4
  100. data/vendor/assets/javascripts/cleave.js +8 -0
  101. data/vendor/assets/javascripts/fetch.umd.js +531 -0
  102. data/vendor/assets/javascripts/jquery.payment.js +652 -0
  103. data/vendor/assets/javascripts/jsuri.js +458 -0
  104. data/vendor/assets/javascripts/polyfill.min.js +1 -0
  105. metadata +117 -70
  106. data/app/assets/images/homepage/big_category_banner.jpg +0 -0
  107. data/app/assets/images/homepage/big_category_banner_mobile.jpg +0 -0
  108. data/app/assets/images/homepage/big_category_banner_tablet_landscape.jpg +0 -0
  109. data/app/assets/images/homepage/big_category_banner_tablet_portrait.jpg +0 -0
  110. data/app/assets/images/homepage/category_banner_lower.jpg +0 -0
  111. data/app/assets/images/homepage/category_banner_lower_mobile.jpg +0 -0
  112. data/app/assets/images/homepage/category_banner_lower_tablet_landscape.jpg +0 -0
  113. data/app/assets/images/homepage/category_banner_lower_tablet_portrait.jpg +0 -0
  114. data/app/assets/images/homepage/category_banner_upper.jpg +0 -0
  115. data/app/assets/images/homepage/category_banner_upper_mobile.jpg +0 -0
  116. data/app/assets/images/homepage/category_banner_upper_tablet_landscape.jpg +0 -0
  117. data/app/assets/images/homepage/category_banner_upper_tablet_portrait.jpg +0 -0
  118. data/app/assets/images/homepage/main_banner.jpg +0 -0
  119. data/app/assets/images/homepage/main_banner_mobile.jpg +0 -0
  120. data/app/assets/images/homepage/main_banner_tablet_landscape.jpg +0 -0
  121. data/app/assets/images/homepage/main_banner_tablet_portrait.jpg +0 -0
  122. data/app/assets/images/homepage/promo_banner_left.jpg +0 -0
  123. data/app/assets/images/homepage/promo_banner_left_mobile.jpg +0 -0
  124. data/app/assets/images/homepage/promo_banner_left_tablet_landscape.jpg +0 -0
  125. data/app/assets/images/homepage/promo_banner_left_tablet_portrait.jpg +0 -0
  126. data/app/assets/images/homepage/promo_banner_right.jpg +0 -0
  127. data/app/assets/images/homepage/promo_banner_right_mobile.jpg +0 -0
  128. data/app/assets/images/homepage/promo_banner_right_tablet_landscape.jpg +0 -0
  129. data/app/assets/images/homepage/promo_banner_right_tablet_portrait.jpg +0 -0
  130. data/app/assets/images/meganav/promo_banner_left-first-category.jpg +0 -0
  131. data/app/assets/images/meganav/promo_banner_left-second-category.jpg +0 -0
  132. data/app/assets/images/meganav/promo_banner_left-third-category.jpg +0 -0
  133. data/app/assets/images/meganav/promo_banner_right-first-category.jpg +0 -0
  134. data/app/assets/images/meganav/promo_banner_right-second-category.jpg +0 -0
  135. data/app/assets/images/meganav/promo_banner_right-third-category.jpg +0 -0
  136. data/app/assets/images/noimage/big_category_banner.jpg +0 -0
  137. data/app/assets/images/noimage/big_category_banner_mobile.jpg +0 -0
  138. data/app/assets/images/noimage/big_category_banner_tablet_landscape.jpg +0 -0
  139. data/app/assets/images/noimage/big_category_banner_tablet_portrait.jpg +0 -0
  140. data/app/assets/images/noimage/category_banner.jpg +0 -0
  141. data/app/assets/images/noimage/category_banner_mobile.jpg +0 -0
  142. data/app/assets/images/noimage/category_banner_plp.jpg +0 -0
  143. data/app/assets/images/noimage/category_banner_tablet_landscape.jpg +0 -0
  144. data/app/assets/images/noimage/category_banner_tablet_portrait.jpg +0 -0
  145. data/app/assets/images/noimage/main_banner.jpg +0 -0
  146. data/app/assets/images/noimage/main_banner_mobile.jpg +0 -0
  147. data/app/assets/images/noimage/main_banner_tablet_landscape.jpg +0 -0
  148. data/app/assets/images/noimage/main_banner_tablet_portrait.jpg +0 -0
  149. data/app/assets/images/noimage/product_photo.jpg +0 -0
  150. data/app/assets/images/noimage/promo_banner.jpg +0 -0
  151. data/app/assets/images/noimage/promo_banner_megamenu.jpg +0 -0
  152. data/app/assets/images/noimage/promo_banner_mobile.jpg +0 -0
  153. data/app/assets/images/noimage/promo_banner_tablet_landscape.jpg +0 -0
  154. data/app/assets/images/noimage/promo_banner_tablet_portrait.jpg +0 -0
  155. data/app/assets/images/spark-logo@3x.png +0 -0
  156. data/app/assets/javascripts/spree/frontend/locale.js +0 -13
  157. data/app/assets/javascripts/spree/frontend/multi_currency.js +0 -13
  158. data/lib/generators/spree/frontend/install/templates/config/initializers/spree_storefront.rb +0 -1
  159. data/lib/generators/spree/frontend/install/templates/config/spree_storefront.yml +0 -99
@@ -6,3 +6,11 @@
6
6
  }
7
7
  }
8
8
  }
9
+
10
+ .cursor-default {
11
+ cursor: default;
12
+ }
13
+
14
+ .pointer-events-none {
15
+ pointer-events: none;
16
+ }
@@ -1,3 +1,22 @@
1
+ .position-absolute-center {
2
+ position:absolute;
3
+ left:50%;
4
+ top:50%;
5
+ transform:translate(-50%, -50%);
6
+ }
7
+
8
+ .position-absolute-x-center {
9
+ position:absolute;
10
+ left:50%;
11
+ transform:translate(-50%, 0);
12
+ }
13
+
14
+ .position-absolute-y-center {
15
+ position:absolute;
16
+ top:50%;
17
+ transform:translate(0, -50%);
18
+ }
19
+
1
20
  #breadcrumbs {
2
21
  padding: 0;
3
22
  }
@@ -30,3 +49,25 @@
30
49
  overflow: hidden;
31
50
  text-overflow: ellipsis;
32
51
  }
52
+
53
+ // Aspect Ratios
54
+ [style*="--aspect-ratio"] > img,
55
+ [style*="--aspect-ratio"] > svg {
56
+ width: 100%;
57
+ height: 100%;
58
+ position: absolute;
59
+ top: 0;
60
+ left: 0;
61
+ }
62
+
63
+ @supports (--custom:property) {
64
+ [style*="--aspect-ratio"] {
65
+ position: relative;
66
+ }
67
+
68
+ [style*="--aspect-ratio"]::before {
69
+ content: "";
70
+ display: block;
71
+ padding-bottom: calc(100% / (var(--aspect-ratio)));
72
+ }
73
+ }
@@ -21,7 +21,7 @@ $spree-header-tablet-height: 75px;
21
21
  $spree-header-desktop-height: 75px;
22
22
 
23
23
  // bootstrap overrides
24
- $grid-gutter-width: 19px;
24
+ $grid-gutter-width: 1rem;
25
25
  $body-color: $font-color;
26
26
  $theme-colors: (
27
27
  // standard bootstrap colors
@@ -62,7 +62,7 @@ $container-max-widths: (
62
62
  );
63
63
 
64
64
  // helper variables
65
- $container-padding: 17px;
65
+ $container-padding: $grid-gutter-width / 2;
66
66
  $photo-width-to-height-ratio: 30001/ 37500;
67
67
  $photo-width-to-height-ratio-zoom: 28015 / 37500;
68
68
  $thumbnails-carousel-single-height: 100% / $photo-width-to-height-ratio;
@@ -32,9 +32,21 @@
32
32
  }
33
33
  }
34
34
  &-text {
35
- padding-left: 15px;
35
+ color: black;
36
+ font-size: 0.8rem;
37
+ @include media-breakpoint-up(sm) {
38
+ font-size: 1rem;
39
+ }
40
+ @include media-breakpoint-up(lg) {
41
+ font-size: 1.25rem;
42
+ }
43
+ svg {
44
+ height: 15px;
45
+ padding-top: 2px;
46
+ }
36
47
  &:hover {
37
48
  text-decoration: underline;
49
+ color: black;
38
50
  }
39
51
  }
40
52
  }
@@ -388,19 +400,19 @@
388
400
  }
389
401
  &-header {
390
402
  font-size: font-px-to-rem(16px);
403
+ hyphens: auto;
404
+ overflow-wrap: break-word;
405
+ word-wrap: break-word;
391
406
  font-weight: 500;
392
- line-height: 1.06;
393
407
  letter-spacing: 0.4px;
394
- margin-bottom: 35px;
408
+ margin-bottom: 30px;
395
409
  @include media-breakpoint-up(sm) {
396
410
  font-size: font-px-to-rem(29px);
397
- line-height: 1.1;
398
411
  letter-spacing: 0.73px;
399
412
  margin-bottom: 74px;
400
413
  }
401
414
  @include media-breakpoint-up(lg) {
402
415
  font-size: font-px-to-rem(26px);
403
- line-height: 0.65;
404
416
  letter-spacing: 0.65px;
405
417
  margin-bottom: 35px;
406
418
  }
@@ -0,0 +1 @@
1
+ @import "spree/frontend/views/spree/cms_sections/product_buy_bar";
@@ -0,0 +1,20 @@
1
+ .row.section-row.sticky-top {
2
+ z-index: 3;
3
+ background-color: rgba(255, 255, 255, 0.95);
4
+ padding: 5px 0;
5
+ border-top: 1px solid $global-border-style;
6
+ border-bottom: 1px solid $global-border-style;
7
+ top: $spree-header-mobile-height + 24px;
8
+
9
+ .buy-container {
10
+ min-height: $spree-header-mobile-height;
11
+ }
12
+
13
+ li.buy-bar {
14
+ a { color: grey;
15
+ &.active {
16
+ color: $header-font-color;
17
+ }
18
+ }
19
+ }
20
+ }
@@ -1,10 +1,29 @@
1
+ :root {
2
+ --spree-border-color: transparent;
3
+ }
4
+
5
+ .brand {
6
+ img {
7
+ width: 85%;
8
+ max-width: 140px;
9
+ }
10
+ }
11
+
12
+ .section-row {
13
+ margin-bottom: #{$grid-gutter-width};
14
+ }
15
+
16
+ .match-col-gap {
17
+ padding-left: $container-padding;
18
+ padding-right: $container-padding;
19
+ }
20
+
1
21
  .homepage {
2
22
  &-hero-image {
3
23
  display: flex;
4
- justify-content: center;
24
+ justify-content: flex-start;
5
25
  flex-direction: column;
6
26
  text-align: center;
7
- height: 204px;
8
27
  width: 100%;
9
28
  overflow: hidden;
10
29
 
@@ -16,16 +35,7 @@
16
35
  height: 100%;
17
36
  }
18
37
 
19
- @include media-breakpoint-up(md) {
20
- height: 418px;
21
- }
22
-
23
- @include media-breakpoint-up(lg) {
24
- height: 600px;
25
- }
26
-
27
38
  .hero-content {
28
- position: absolute;
29
39
  z-index: 1;
30
40
  right: 10%;
31
41
  }
@@ -40,7 +50,7 @@
40
50
 
41
51
  @include media-breakpoint-up(md) {
42
52
  font-size: font-px-to-rem(44px);
43
- width: 288px;
53
+ width: 398px;
44
54
  }
45
55
 
46
56
  @include media-breakpoint-up(lg) {
@@ -65,17 +75,6 @@
65
75
 
66
76
  &-taxon-box {
67
77
  display: block;
68
- flex-direction: column;
69
- height: 140px;
70
- position: relative;
71
- overflow: hidden;
72
-
73
- img {
74
- display: block;
75
- object-fit: cover;
76
- width: 100%;
77
- height: 100%;
78
- }
79
78
 
80
79
  h3 {
81
80
  margin: 0;
@@ -97,14 +96,6 @@
97
96
  }
98
97
  }
99
98
 
100
- @include media-breakpoint-up(md) {
101
- height: 324px;
102
- }
103
-
104
- @include media-breakpoint-up(lg) {
105
- height: 390px;
106
- }
107
-
108
99
  &-text {
109
100
  width: 100%;
110
101
  text-transform: uppercase;
@@ -133,10 +124,10 @@
133
124
  &-fashion-trends-box {
134
125
  background: $secondary-background;
135
126
  color: $secondary-font-color;
136
- padding: 30px 0px;
127
+ padding: 30px 15px;
137
128
 
138
129
  @include media-breakpoint-up(md) {
139
- padding: 60px 0px;
130
+ padding: 5vw 0px;
140
131
  }
141
132
 
142
133
  &-summer-text {
@@ -178,11 +169,12 @@
178
169
  color: $font-color;
179
170
  margin: auto;
180
171
  font-size: font-px-to-rem(12px);
181
- width: 283px;
172
+ max-width: 283px;
182
173
 
183
174
  @include media-breakpoint-up(md) {
184
175
  font-size: font-px-to-rem(16px);
185
- width: 608px;
176
+ width: 90%;
177
+ max-width: 608px;
186
178
  }
187
179
  }
188
180
  .spree-btn {
@@ -190,58 +182,36 @@
190
182
  border: solid 2px theme-color('primary');
191
183
  font-size: font-px-to-rem(12px);
192
184
  font-weight: bold;
185
+ max-width: 100%;
193
186
  @include media-breakpoint-up(md) {
194
187
  font-size: font-px-to-rem(22px);
195
- width: 400px;
196
- padding-top: 0.7rem;
197
188
  }
198
189
  @include media-breakpoint-up(lg) {
199
190
  font-size: font-px-to-rem(20px);
200
- width: 497.2px;
201
191
  }
202
192
  }
203
193
  }
204
194
  }
205
195
 
206
196
  &-bottom-box {
207
- background: $secondary-background;
208
- color: $secondary-font-color;
209
- display: flex;
210
- justify-content: center;
211
- flex-direction: column;
212
- text-align: center;
213
- height: 168px;
214
- overflow: hidden;
215
-
216
197
  img {
217
198
  width: 100%;
218
199
  object-fit: cover;
219
200
  }
220
201
 
221
- @include media-breakpoint-up(md) {
222
- height: 363px;
223
- }
224
- @include media-breakpoint-up(lg) {
225
- height: 350px;
226
- }
227
-
228
202
  &-inner {
229
203
  background: $primary-background;
230
204
  margin: auto;
231
- padding: 10px 30px;
232
205
  position: absolute;
233
- width: 70%;
234
- left: 15%;
235
-
236
- @include media-breakpoint-up(md) {
237
- padding: 30px 100px;
238
- }
206
+ max-height: 70%;
207
+ min-width: 60%;
208
+ max-width: 80%;
209
+ bottom: 35px;
239
210
 
240
211
  &-small-text {
241
212
  font-weight: 500;
242
213
  line-height: 0.9;
243
214
  letter-spacing: 0.25px;
244
- text-align: center;
245
215
  color: theme-color('primary');
246
216
  font-size: font-px-to-rem(10px);
247
217
 
@@ -257,9 +227,12 @@
257
227
  font-weight: 600;
258
228
  line-height: 1.2;
259
229
  letter-spacing: 0.38px;
260
- text-align: center;
261
230
  color: $font-color;
262
- font-size: font-px-to-rem(15px);
231
+ font-size: font-px-to-rem(14px);
232
+
233
+ @include media-breakpoint-up(sm) {
234
+ font-size: font-px-to-rem(22px);
235
+ }
263
236
 
264
237
  @include media-breakpoint-up(md) {
265
238
  font-size: font-px-to-rem(27px);
@@ -280,14 +253,28 @@
280
253
  text-decoration: none !important;
281
254
  }
282
255
  &-text {
283
- font-size: 12px;
256
+ font-size: font-px-to-rem(12px);
284
257
 
285
258
  @include media-breakpoint-up(md) {
286
- font-size: 22px;
259
+ font-size: font-px-to-rem(22px);
287
260
  }
288
261
  @include media-breakpoint-up(lg) {
289
- font-size: 24px;
262
+ font-size: font-px-to-rem(24px);
290
263
  }
291
264
  }
292
265
  }
266
+
267
+ &-hpb {
268
+ border: 3px solid var(--spree-border-color);
269
+ }
270
+ }
271
+
272
+ #missingHomepage {
273
+ .missing-homepage-logo-container {
274
+ width: 160px;
275
+
276
+ img {
277
+ max-width: 100%;
278
+ }
279
+ }
293
280
  }
@@ -1,7 +1,7 @@
1
1
  .category {
2
2
  &-links {
3
- width: 176px;
4
- min-width: 176px;
3
+ width: 170px;
4
+ min-width: 170px;
5
5
 
6
6
  &-header {
7
7
  color: $meganav-font-color;
@@ -12,7 +12,7 @@
12
12
 
13
13
  ul {
14
14
  list-style-type: none;
15
- padding-top: 27px;
15
+ padding-top: 15px;
16
16
  }
17
17
 
18
18
  li {
@@ -41,6 +41,10 @@
41
41
  @include media-breakpoint-up(xl) {
42
42
  font-size: font-px-to-rem(16px);
43
43
  font-weight: 500;
44
+
45
+ a {
46
+ font-size: font-px-to-rem(16px) !important;
47
+ }
44
48
  }
45
49
  }
46
50
  &-info {
@@ -28,6 +28,14 @@
28
28
  }
29
29
  }
30
30
 
31
+ #{$self}-button.active {
32
+ color: $header-font-color;
33
+ text-decoration: none;
34
+ &:after {
35
+ border-bottom-color: $header-font-color;
36
+ }
37
+ }
38
+
31
39
  .dropdown-item {
32
40
  width: auto;
33
41
  padding: 0;
@@ -35,6 +43,10 @@
35
43
  &:hover, &:focus {
36
44
  background-color: transparent;
37
45
  }
46
+ &.active {
47
+ color: $header-font-color;
48
+ text-decoration: underline;
49
+ }
38
50
  }
39
51
 
40
52
  &-button {
@@ -60,7 +72,6 @@
60
72
  }
61
73
 
62
74
  &-dropdown {
63
- padding: 51px 0px 51px 0px;
64
75
  min-height: 341px;
65
76
  left: 0;
66
77
  right: 0;
@@ -4,13 +4,9 @@ module Spree
4
4
  helper Spree::AddressesHelper
5
5
  load_and_authorize_resource class: Spree::Address
6
6
 
7
- def index
8
- @addresses = try_spree_current_user.addresses
9
- end
10
-
11
7
  def create
12
8
  @address = try_spree_current_user.addresses.build(address_params)
13
- if @address.save
9
+ if create_service.call(user: try_spree_current_user, address_params: @address.attributes).success?
14
10
  flash[:notice] = I18n.t(:successfully_created, scope: :address_book)
15
11
  redirect_to spree.account_path
16
12
  else
@@ -23,28 +19,15 @@ module Spree
23
19
  end
24
20
 
25
21
  def new
26
- @address = Spree::Address.default
22
+ @address = Spree::Address.new(country: current_store.default_country, user: try_spree_current_user)
27
23
  end
28
24
 
29
25
  def update
30
- if @address.editable?
31
- if @address.update(address_params)
32
- flash[:notice] = Spree.t(:successfully_updated, scope: :address_book)
33
- redirect_back_or_default(addresses_path)
34
- else
35
- render :edit
36
- end
26
+ if update_service.call(address: @address, address_params: address_params).success?
27
+ flash[:notice] = Spree.t(:successfully_updated, scope: :address_book)
28
+ redirect_back_or_default(addresses_path)
37
29
  else
38
- new_address = @address.clone
39
- new_address.attributes = address_params
40
- new_address.user_id = @address.user_id
41
- @address.update_attribute(:deleted_at, Time.current)
42
- if new_address.save
43
- flash[:notice] = Spree.t(:successfully_updated, scope: :address_book)
44
- redirect_back_or_default(addresses_path)
45
- else
46
- render :edit
47
- end
30
+ render :edit
48
31
  end
49
32
  end
50
33
 
@@ -60,5 +43,13 @@ module Spree
60
43
  def address_params
61
44
  params.require(:address).permit(permitted_address_attributes)
62
45
  end
46
+
47
+ def create_service
48
+ Spree::Dependencies.account_create_address_service.constantize
49
+ end
50
+
51
+ def update_service
52
+ Spree::Dependencies.account_update_address_service.constantize
53
+ end
63
54
  end
64
55
  end