solidus_backend 2.8.6 → 2.9.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of solidus_backend might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/javascripts/spree/backend/components/sortable_table.js +1 -0
- data/app/assets/javascripts/spree/backend/components/tabs.js +1 -0
- data/app/assets/javascripts/spree/backend/shipments.js +1 -0
- data/app/assets/javascripts/spree/backend/stock_management.js +9 -0
- data/app/assets/javascripts/spree/backend/templates/orders/line_item.hbs +1 -1
- data/app/assets/stylesheets/spree/backend/_bootstrap_custom.scss +24 -16
- data/app/assets/stylesheets/spree/backend/components/_breadcrumb.scss +12 -0
- data/app/assets/stylesheets/spree/backend/components/_buttons.scss +18 -0
- data/app/assets/stylesheets/spree/backend/components/_image_placeholder.scss +2 -2
- data/app/assets/stylesheets/spree/backend/components/_list_group.scss +2 -2
- data/app/assets/stylesheets/spree/backend/components/_messages.scss +20 -12
- data/app/assets/stylesheets/spree/backend/components/_navigation.scss +46 -10
- data/app/assets/stylesheets/spree/backend/components/_progress.scss +3 -3
- data/app/assets/stylesheets/spree/backend/components/_sidebar.scss +1 -2
- data/app/assets/stylesheets/spree/backend/components/_tabs.scss +6 -5
- data/app/assets/stylesheets/spree/backend/globals/_deprecated_variables.scss +24 -0
- data/app/assets/stylesheets/spree/backend/globals/_deprecation.scss +10 -1
- data/app/assets/stylesheets/spree/backend/globals/_variables.scss +62 -39
- data/app/assets/stylesheets/spree/backend/globals/_variables_override.scss +1 -0
- data/app/assets/stylesheets/spree/backend/globals/mixins/_caret.scss +1 -1
- data/app/assets/stylesheets/spree/backend/globals/mixins/_line_through.scss +1 -1
- data/app/assets/stylesheets/spree/backend/sections/_log_entries.scss +8 -2
- data/app/assets/stylesheets/spree/backend/sections/_orders.scss +17 -6
- data/app/assets/stylesheets/spree/backend/sections/_products.scss +3 -1
- data/app/assets/stylesheets/spree/backend/sections/_promotions.scss +5 -5
- data/app/assets/stylesheets/spree/backend/sections/_style_guide.scss +4 -4
- data/app/assets/stylesheets/spree/backend/sections/_taxonomies.scss +1 -1
- data/app/assets/stylesheets/spree/backend/shared/_fonts.scss +15 -0
- data/app/assets/stylesheets/spree/backend/shared/_forms.scss +27 -7
- data/app/assets/stylesheets/spree/backend/shared/_header.scss +3 -2
- data/app/assets/stylesheets/spree/backend/shared/_icons.scss +5 -1
- data/app/assets/stylesheets/spree/backend/shared/_layout.scss +5 -4
- data/app/assets/stylesheets/spree/backend/shared/_tables.scss +9 -4
- data/app/assets/stylesheets/spree/backend/shared/_typography.scss +10 -6
- data/app/assets/stylesheets/spree/backend/spree_admin.scss +3 -0
- data/app/controllers/spree/admin/customer_returns_controller.rb +8 -1
- data/app/controllers/spree/admin/log_entries_controller.rb +3 -0
- data/app/controllers/spree/admin/orders_controller.rb +0 -1
- data/app/controllers/spree/admin/users_controller.rb +4 -2
- data/app/helpers/spree/admin/base_helper.rb +9 -3
- data/app/helpers/spree/admin/promotions_helper.rb +15 -0
- data/app/views/spree/admin/images/index.html.erb +1 -1
- data/app/views/spree/admin/log_entries/index.html.erb +1 -19
- data/app/views/spree/admin/option_types/edit.html.erb +1 -1
- data/app/views/spree/admin/orders/_line_items_edit_form.html.erb +1 -1
- data/app/views/spree/admin/payments/_capture_events.html.erb +15 -18
- data/app/views/spree/admin/payments/_list.html.erb +1 -1
- data/app/views/spree/admin/payments/_log_entries.html.erb +29 -0
- data/app/views/spree/admin/payments/show.html.erb +13 -6
- data/app/views/spree/admin/payments/source_forms/{_storecredit.html.erb → _store_credit.html.erb} +0 -0
- data/app/views/spree/admin/payments/source_views/{_storecredit.html.erb → _store_credit.html.erb} +0 -0
- data/app/views/spree/admin/prices/_form.html.erb +1 -1
- data/app/views/spree/admin/products/_form.html.erb +16 -5
- data/app/views/spree/admin/products/edit.html.erb +1 -1
- data/app/views/spree/admin/promotions/_form.html.erb +2 -2
- data/app/views/spree/admin/promotions/index.html.erb +4 -4
- data/app/views/spree/admin/reimbursements/edit.html.erb +2 -2
- data/app/views/spree/admin/shared/_head.html.erb +0 -3
- data/app/views/spree/admin/shared/_modal.html.erb +1 -1
- data/app/views/spree/admin/shipping_methods/_form.html.erb +10 -10
- data/app/views/spree/admin/stock_items/_stock_management.html.erb +1 -1
- data/app/views/spree/admin/store_credits/edit_validity.html.erb +1 -1
- data/app/views/spree/admin/store_credits/index.html.erb +1 -1
- data/app/views/spree/admin/store_credits/show.html.erb +1 -1
- data/app/views/spree/admin/stores/_form.html.erb +1 -0
- data/app/views/spree/admin/style_guide/topics/typography/_colors.html.erb +30 -20
- data/app/views/spree/admin/style_guide/topics/typography/_fonts.html.erb +1 -1
- data/app/views/spree/admin/taxonomies/edit.html.erb +1 -1
- data/app/views/spree/admin/taxons/_form.html.erb +1 -1
- data/app/views/spree/admin/taxons/edit.html.erb +2 -2
- data/app/views/spree/admin/users/edit.html.erb +2 -2
- data/app/views/spree/admin/users/index.html.erb +2 -2
- data/app/views/spree/admin/variants/_form.html.erb +1 -1
- data/app/views/spree/admin/zones/_state_members.html.erb +1 -1
- data/spec/controllers/spree/admin/locale_controller_spec.rb +45 -0
- data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +3 -3
- data/spec/controllers/spree/admin/orders_controller_spec.rb +2 -2
- data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +1 -1
- data/spec/features/admin/orders/adjustments_spec.rb +1 -1
- data/spec/features/admin/orders/customer_details_spec.rb +5 -7
- data/spec/features/admin/orders/customer_returns_spec.rb +28 -0
- data/spec/features/admin/orders/listing_spec.rb +1 -6
- data/spec/features/admin/orders/log_entries_spec.rb +2 -2
- data/spec/features/admin/orders/new_order_spec.rb +3 -3
- data/spec/features/admin/orders/order_details_spec.rb +8 -3
- data/spec/features/admin/orders/payments_spec.rb +80 -39
- data/spec/features/admin/products/edit/products_spec.rb +25 -0
- data/spec/features/admin/products/edit/taxons_spec.rb +2 -8
- data/spec/features/admin/products/pricing_spec.rb +24 -6
- data/spec/features/admin/products/products_spec.rb +4 -4
- data/spec/features/admin/products/variant_spec.rb +1 -1
- data/spec/features/admin/promotions/promotion_spec.rb +52 -0
- data/spec/features/admin/store_credits_spec.rb +3 -3
- data/spec/features/admin/users_spec.rb +22 -0
- data/spec/spec_helper.rb +1 -2
- data/spec/support/appear_before_matcher.rb +1 -1
- data/spec/teaspoon_env.rb +23 -8
- data/vendor/assets/fonts/inter/Inter-Regular.woff +0 -0
- data/vendor/assets/fonts/inter/Inter-Regular.woff2 +0 -0
- data/vendor/assets/fonts/inter/Inter-SemiBold.woff +0 -0
- data/vendor/assets/fonts/inter/Inter-SemiBold.woff2 +0 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_pagination.scss +4 -0
- metadata +22 -10
- data/.eslintrc +0 -21
data/app/views/spree/admin/payments/source_forms/{_storecredit.html.erb → _store_credit.html.erb}
RENAMED
File without changes
|
data/app/views/spree/admin/payments/source_views/{_storecredit.html.erb → _store_credit.html.erb}
RENAMED
File without changes
|
@@ -26,7 +26,7 @@
|
|
26
26
|
<div data-hook="admin_product_price_form_amount" class="col-4">
|
27
27
|
<%= f.field_container :price do %>
|
28
28
|
<%= f.label :price %>
|
29
|
-
<%= render "spree/admin/shared/number_with_currency", f: f, amount_attr: :price, currency_attr: :currency %>
|
29
|
+
<%= render "spree/admin/shared/number_with_currency", f: f, amount_attr: :price, currency_attr: :currency, currency: @price.currency %>
|
30
30
|
<% end %>
|
31
31
|
</div>
|
32
32
|
</div>
|
@@ -32,11 +32,22 @@
|
|
32
32
|
<div data-hook="admin_product_form_price">
|
33
33
|
<%= f.field_container :price do %>
|
34
34
|
<%= f.label :price, class: Spree::Config.require_master_price ? 'required' : '' %>
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
|
36
|
+
<% if f.object.new_record? || f.object.has_default_price? %>
|
37
|
+
<%= render "spree/admin/shared/number_with_currency",
|
38
|
+
f: f,
|
39
|
+
amount_attr: :price,
|
40
|
+
required: Spree::Config.require_master_price,
|
41
|
+
currency: Spree::Config.default_pricing_options.currency %>
|
42
|
+
<%= f.error_message_on :price %>
|
43
|
+
<% else %>
|
44
|
+
<span class="info">
|
45
|
+
<%= t('spree.product_without_default_price_info',
|
46
|
+
default_currency: Spree::Config.default_pricing_options.currency) %>
|
47
|
+
<%= link_to t('spree.product_without_default_price_cta'),
|
48
|
+
spree.admin_product_prices_url(@product) %>
|
49
|
+
</span>
|
50
|
+
<% end %>
|
40
51
|
<% end %>
|
41
52
|
</div>
|
42
53
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<% end %>
|
7
7
|
<% if defined?(Spree::Frontend::Engine) %>
|
8
8
|
<li id="view_product_link">
|
9
|
-
<%= link_to t('spree.view_product'), spree.product_path(@product), id: 'admin_view_product', class: 'btn btn-
|
9
|
+
<%= link_to t('spree.view_product'), spree.product_path(@product), id: 'admin_view_product', class: 'btn btn-default ml-2' %>
|
10
10
|
</li>
|
11
11
|
<% end %>
|
12
12
|
<% end %>
|
@@ -44,13 +44,13 @@
|
|
44
44
|
<div id="starts_at_field" class="field">
|
45
45
|
<%= f.label :starts_at %>
|
46
46
|
<%= f.field_hint :starts_at %>
|
47
|
-
<%= f.text_field :starts_at, value: datepicker_field_value(@promotion.starts_at), placeholder: t(".starts_at_placeholder"), class: 'datepicker datepicker-from fullwidth' %>
|
47
|
+
<%= f.text_field :starts_at, value: datepicker_field_value(@promotion.starts_at, with_time: true), placeholder: t(".starts_at_placeholder"), class: 'datepicker datepicker-from fullwidth', data: { :'enable-time' => true, :'default-hour' => 0 } %>
|
48
48
|
</div>
|
49
49
|
|
50
50
|
<div id="expires_at_field" class="field">
|
51
51
|
<%= f.label :expires_at %>
|
52
52
|
<%= f.field_hint :expires_at %>
|
53
|
-
<%= f.text_field :expires_at, value: datepicker_field_value(@promotion.expires_at), placeholder: t(".expires_at_placeholder"), class: 'datepicker datepicker-to fullwidth' %>
|
53
|
+
<%= f.text_field :expires_at, value: datepicker_field_value(@promotion.expires_at, with_time: true), placeholder: t(".expires_at_placeholder"), class: 'datepicker datepicker-to fullwidth', data: { :'enable-time' => true, :'default-hour' => 0 } %>
|
54
54
|
</div>
|
55
55
|
</div>
|
56
56
|
</div>
|
@@ -78,11 +78,11 @@
|
|
78
78
|
<tr id="<%= spree_dom_id promotion %>">
|
79
79
|
<td><%= promotion.name %></td>
|
80
80
|
<td>
|
81
|
-
<%= (promotion.codes.size == 1) ? promotion.codes.
|
81
|
+
<%= (promotion.codes.size == 1) ? promotion.codes.take.try!(:value) : t('spree.number_of_codes', count: promotion.codes.size) %>
|
82
82
|
</td>
|
83
83
|
<td>
|
84
84
|
<span class="pill pill-<%= promotion.active? ? 'active' : 'inactive' %>">
|
85
|
-
<%= t(promotion
|
85
|
+
<%= t(admin_promotion_status(promotion), scope: 'spree.admin.promotion_status') %>
|
86
86
|
</span>
|
87
87
|
</td>
|
88
88
|
<td>
|
@@ -92,10 +92,10 @@
|
|
92
92
|
<%= promotion.usage_count %>
|
93
93
|
</td>
|
94
94
|
<td>
|
95
|
-
<%= promotion.starts_at.
|
95
|
+
<%= promotion.starts_at.to_s(:long) if promotion.starts_at %>
|
96
96
|
</td>
|
97
97
|
<td>
|
98
|
-
<%= promotion.expires_at.
|
98
|
+
<%= promotion.expires_at.to_s(:long) if promotion.expires_at %>
|
99
99
|
</td>
|
100
100
|
<td class="actions">
|
101
101
|
<% if can?(:edit, promotion) %>
|
@@ -97,10 +97,10 @@
|
|
97
97
|
<% end %>
|
98
98
|
<div class="form-buttons filter-actions actions" data-hook="reimburse-buttons">
|
99
99
|
<% if !@reimbursement.reimbursed? %>
|
100
|
-
<%= button_to [:perform, :admin, @order, @reimbursement], { class: 'button', method: 'post' } do %>
|
100
|
+
<%= button_to [:perform, :admin, @order, @reimbursement], { class: 'button btn btn-primary', method: 'post' } do %>
|
101
101
|
<%= t('spree.reimburse') %>
|
102
102
|
<% end %>
|
103
|
-
<%= link_to t('spree.actions.cancel'), url_for([:admin, @order, @reimbursement.customer_return]), class: 'btn btn-
|
103
|
+
<%= link_to t('spree.actions.cancel'), url_for([:admin, @order, @reimbursement.customer_return]), class: 'btn btn-default' %>
|
104
104
|
<% end %>
|
105
105
|
</div>
|
106
106
|
</fieldset>
|
@@ -5,9 +5,6 @@
|
|
5
5
|
|
6
6
|
<title><%= admin_page_title %></title>
|
7
7
|
|
8
|
-
<!-- Get "Open Sans" font from Google -->
|
9
|
-
<link href='//fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600&subset=latin,cyrillic,greek,vietnamese' rel='stylesheet' type='text/css'>
|
10
|
-
|
11
8
|
<%= favicon_link_tag 'favicon.ico' %>
|
12
9
|
<%= stylesheet_link_tag 'spree/backend/all', media: 'all', data: {turbolinks_track: 'reload'} %>
|
13
10
|
<%= javascript_include_tag 'spree/backend/all', data: {turbolinks_track: 'reload'} %>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<div data-hook="admin_shipping_method_form_fields" class="row">
|
2
2
|
<div data-hook="admin_shipping_method_form_name_field" class="col-5">
|
3
3
|
<%= f.field_container :name do %>
|
4
|
-
<%= f.label :name
|
4
|
+
<%= f.label :name, class: 'required' %>
|
5
5
|
<%= f.text_field :name, class: 'fullwidth' %>
|
6
6
|
<%= error_message_on :shipping_method, :name %>
|
7
7
|
<% end %>
|
@@ -9,32 +9,32 @@
|
|
9
9
|
|
10
10
|
<div data-hook="admin_shipping_method_form_internal_name_field" class="col-5">
|
11
11
|
<%= f.field_container :admin_name do %>
|
12
|
-
<%= f.label :admin_name
|
13
|
-
<%= f.text_field :admin_name, class: 'fullwidth', label: false
|
12
|
+
<%= f.label :admin_name %>
|
13
|
+
<%= f.text_field :admin_name, class: 'fullwidth', label: false %>
|
14
14
|
<%= error_message_on :shipping_method, :admin_name %>
|
15
15
|
<% end %>
|
16
16
|
</div>
|
17
17
|
|
18
18
|
<div data-hook="admin_shipping_method_form_code" class="col-5">
|
19
19
|
<%= f.field_container :code do %>
|
20
|
-
<%= f.label :code
|
21
|
-
<%= f.text_field :code, class: 'fullwidth', label: false
|
20
|
+
<%= f.label :code %>
|
21
|
+
<%= f.text_field :code, class: 'fullwidth', label: false %>
|
22
22
|
<%= error_message_on :shipping_method, :code %>
|
23
23
|
<% end %>
|
24
24
|
</div>
|
25
25
|
|
26
26
|
<div class="col-5">
|
27
27
|
<%= f.field_container :carrier do %>
|
28
|
-
<%= f.label :carrier
|
29
|
-
<%= f.text_field :carrier, class: 'fullwidth', label: false
|
28
|
+
<%= f.label :carrier %>
|
29
|
+
<%= f.text_field :carrier, class: 'fullwidth', label: false %>
|
30
30
|
<%= error_message_on :shipping_method, :carrier %>
|
31
31
|
<% end %>
|
32
32
|
</div>
|
33
33
|
|
34
34
|
<div class="col-5">
|
35
35
|
<%= f.field_container :service_level do %>
|
36
|
-
<%= f.label :service_level
|
37
|
-
<%= f.text_field :service_level, class: 'fullwidth', label: false
|
36
|
+
<%= f.label :service_level %>
|
37
|
+
<%= f.text_field :service_level, class: 'fullwidth', label: false %>
|
38
38
|
<%= error_message_on :shipping_method, :service_level %>
|
39
39
|
<% end %>
|
40
40
|
</div>
|
@@ -49,7 +49,7 @@
|
|
49
49
|
|
50
50
|
<div data-hook="admin_shipping_method_form_tracking_url_field" class="col-10">
|
51
51
|
<%= f.field_container :tracking_url do %>
|
52
|
-
<%= f.label :tracking_url
|
52
|
+
<%= f.label :tracking_url %>
|
53
53
|
<%= f.text_field :tracking_url, class: 'fullwidth', placeholder: t('spree.tracking_url_placeholder') %>
|
54
54
|
<%= error_message_on :shipping_method, :tracking_url %>
|
55
55
|
<% end %>
|
@@ -72,7 +72,7 @@
|
|
72
72
|
</colgroup>
|
73
73
|
<% variant.stock_items.each do |item| %>
|
74
74
|
<% if @stock_item_stock_locations.include?(item.stock_location) %>
|
75
|
-
<tr class="js-edit-stock-item stock-item-edit-row" data-variant-id="<%= variant.id %>" data-stock-item="<%= item.to_json %>" data-stock-location-name="<%= item.stock_location.name %>" data-track-inventory="<%= variant.should_track_inventory? %>">
|
75
|
+
<tr class="js-edit-stock-item stock-item-edit-row" data-variant-id="<%= variant.id %>" data-stock-item="<%= item.to_json %>" data-stock-location-name="<%= item.stock_location.name %>" data-track-inventory="<%= variant.should_track_inventory? %>" data-can-edit="<%= can?(:admin, Spree::StockItem) %>">
|
76
76
|
<%# This is rendered in JS %>
|
77
77
|
</tr>
|
78
78
|
<% end %>
|
@@ -20,7 +20,7 @@
|
|
20
20
|
</div>
|
21
21
|
<div class="form-buttons filter-actions actions" data-hook="buttons">
|
22
22
|
<%= button_tag t('spree.store_credit.actions.invalidate'), class: 'btn btn-primary' %>
|
23
|
-
<%= link_to t('spree.actions.cancel'), admin_user_store_credit_path(@user, @store_credit), class: 'btn btn-
|
23
|
+
<%= link_to t('spree.actions.cancel'), admin_user_store_credit_path(@user, @store_credit), class: 'btn btn-default' %>
|
24
24
|
</div>
|
25
25
|
</fieldset>
|
26
26
|
<% end %>
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<%= render 'spree/admin/users/tabs', current: :store_credits %>
|
8
8
|
<% content_for :page_actions do %>
|
9
9
|
<% if can?(:create, Spree::StoreCredit) %>
|
10
|
-
<li><%= link_to t('spree.admin.store_credits.add'), new_admin_user_store_credit_path(@user), class: 'button' %></li>
|
10
|
+
<li><%= link_to t('spree.admin.store_credits.add'), new_admin_user_store_credit_path(@user), class: 'button btn btn-primary' %></li>
|
11
11
|
<% end %>
|
12
12
|
<% end %>
|
13
13
|
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<%= render 'spree/admin/users/tabs', current: :store_credits %>
|
9
9
|
<% content_for :page_actions do %>
|
10
10
|
<% if @store_credit.editable? && can?(:edit, @store_credit) %>
|
11
|
-
<li><%= link_to t('spree.admin.store_credits.change_amount'), edit_amount_admin_user_store_credit_path(@user, @store_credit), class: 'button' %></li>
|
11
|
+
<li><%= link_to t('spree.admin.store_credits.change_amount'), edit_amount_admin_user_store_credit_path(@user, @store_credit), class: 'button btn btn-primary' %></li>
|
12
12
|
<% end %>
|
13
13
|
<% if @store_credit.invalidateable? && can?(:invalidate, @store_credit) %>
|
14
14
|
<li><%= link_to t('spree.invalidate'), edit_validity_admin_user_store_credit_path(@user, @store_credit), class: 'button' %></li>
|
@@ -9,39 +9,49 @@
|
|
9
9
|
<%-
|
10
10
|
colors = [
|
11
11
|
{
|
12
|
-
name: '$color-
|
12
|
+
name: '$color-white',
|
13
13
|
value: '#FFFFFF',
|
14
|
-
used_for: '
|
14
|
+
used_for: 'Body background color.'
|
15
15
|
},
|
16
16
|
{
|
17
|
-
name: '$color-
|
18
|
-
value: '#
|
19
|
-
used_for: '
|
17
|
+
name: '$color-light',
|
18
|
+
value: '#F9FAFB',
|
19
|
+
used_for: 'Sidebar and header background color.'
|
20
20
|
},
|
21
21
|
{
|
22
|
-
name: '$color-
|
23
|
-
value: '#
|
24
|
-
used_for: '
|
22
|
+
name: '$color-light-dark',
|
23
|
+
value: '#E5E7EB',
|
24
|
+
used_for: 'Borders color.'
|
25
25
|
},
|
26
26
|
{
|
27
|
-
name: '$color-
|
28
|
-
value: '#
|
29
|
-
used_for: '
|
27
|
+
name: '$color-dark',
|
28
|
+
value: '#24282F',
|
29
|
+
used_for: 'Text and headings color.'
|
30
30
|
},
|
31
31
|
{
|
32
|
-
name: '$color-
|
33
|
-
value: '#
|
34
|
-
used_for: '
|
32
|
+
name: '$color-dark-light',
|
33
|
+
value: '#808C9E',
|
34
|
+
used_for: 'Main text color for navigation, tabs, breadcrumb.'
|
35
|
+
},
|
36
|
+
{
|
37
|
+
name: '$color-primary',
|
38
|
+
value: '#3D76F1',
|
39
|
+
used_for: 'Buttons primary actions, links, active states.'
|
35
40
|
},
|
36
41
|
{
|
37
|
-
name: '$color-
|
38
|
-
value: '#
|
39
|
-
used_for: '
|
42
|
+
name: '$color-success',
|
43
|
+
value: '#52B73B',
|
44
|
+
used_for: 'Success actions.'
|
45
|
+
},
|
46
|
+
{
|
47
|
+
name: '$color-error',
|
48
|
+
value: '#CE452A',
|
49
|
+
used_for: 'Errors, destructive action warnings.'
|
40
50
|
},
|
41
51
|
{
|
42
|
-
name: '$color-
|
43
|
-
value: '#
|
44
|
-
used_for: '
|
52
|
+
name: '$color-notice',
|
53
|
+
value: '#FFDD59',
|
54
|
+
used_for: 'Warnings actions.'
|
45
55
|
}
|
46
56
|
]
|
47
57
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div class="half">
|
2
2
|
<p>
|
3
|
-
The typography base is "
|
3
|
+
The typography base is "Inter" and Helvetica which we load by stylesheet with @font-face rule.
|
4
4
|
Set at 13px with no specified line-height.
|
5
5
|
</p>
|
6
6
|
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<%= render partial: 'form', locals: { f: f } %>
|
15
15
|
<div class="filter-actions actions">
|
16
16
|
<%= button_tag t('spree.actions.update'), class: 'btn btn-primary' %>
|
17
|
-
<%= link_to t('spree.actions.cancel'), admin_taxonomies_path, class: 'btn btn-
|
17
|
+
<%= link_to t('spree.actions.cancel'), admin_taxonomies_path, class: 'btn btn-default' %>
|
18
18
|
</div>
|
19
19
|
</fieldset>
|
20
20
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
<% content_for :page_actions do %>
|
5
5
|
<li>
|
6
|
-
<%= link_to t('spree.back_to_taxonomies_list'), spree.admin_taxonomies_path, class: 'btn btn-
|
6
|
+
<%= link_to t('spree.back_to_taxonomies_list'), spree.admin_taxonomies_path, class: 'btn btn-default' %>
|
7
7
|
</li>
|
8
8
|
<% end %>
|
9
9
|
|
@@ -14,6 +14,6 @@
|
|
14
14
|
|
15
15
|
<div class="form-buttons filter-actions" data-hook="buttons">
|
16
16
|
<%= button_tag t('spree.actions.update'), class: 'btn btn-primary' %>
|
17
|
-
<%= link_to t('spree.actions.cancel'), edit_admin_taxonomy_url(@taxonomy), class: 'btn btn-
|
17
|
+
<%= link_to t('spree.actions.cancel'), edit_admin_taxonomy_url(@taxonomy), class: 'btn btn-default' %>
|
18
18
|
</div>
|
19
19
|
<% end %>
|
@@ -41,8 +41,8 @@
|
|
41
41
|
|
42
42
|
</div>
|
43
43
|
<div class="filter-actions actions">
|
44
|
-
<%= button_to t('.clear_key'), spree.clear_api_key_admin_user_path(@user), method: :put, data: { confirm: t('.confirm_clear_key') }, class: 'btn btn-
|
45
|
-
<%= button_to t('.regenerate_key'), spree.generate_api_key_admin_user_path(@user), method: :put, data: { confirm: t('.confirm_regenerate_key') }, class: 'btn btn-
|
44
|
+
<%= button_to t('.clear_key'), spree.clear_api_key_admin_user_path(@user), method: :put, data: { confirm: t('.confirm_clear_key') }, class: 'btn btn-default' %>
|
45
|
+
<%= button_to t('.regenerate_key'), spree.generate_api_key_admin_user_path(@user), method: :put, data: { confirm: t('.confirm_regenerate_key') }, class: 'btn btn-default' %>
|
46
46
|
</div>
|
47
47
|
|
48
48
|
<% else %>
|
@@ -82,14 +82,14 @@
|
|
82
82
|
<tr id="<%= spree_dom_id user %>" data-hook="admin_users_index_rows">
|
83
83
|
<td class='user_email'><%=link_to user.email, edit_admin_user_url(user) %></td>
|
84
84
|
<td><%= user.spree_roles.map(&:name).to_sentence %></td>
|
85
|
-
<td class="align-center"><%= link_to user.
|
85
|
+
<td class="align-center"><%= link_to user.order_count, spree.orders_admin_user_path(user) %></td>
|
86
86
|
<td class="align-center"><%= link_to user.display_lifetime_value, spree.items_admin_user_path(user) %></td>
|
87
87
|
<td class="align-center"><%= l user.created_at.to_date %></td>
|
88
88
|
<td data-hook="admin_users_index_row_actions" class="actions">
|
89
89
|
<% if can?(:edit, user) %>
|
90
90
|
<%= link_to_edit user, no_text: true %>
|
91
91
|
<% end %>
|
92
|
-
<% if can?(:destroy, user) %>
|
92
|
+
<% if can?(:destroy, user) && user.orders.count.zero? %>
|
93
93
|
<%= link_to_delete user, no_text: true %>
|
94
94
|
<% end %>
|
95
95
|
</td>
|
@@ -65,7 +65,7 @@
|
|
65
65
|
<div class="col-3">
|
66
66
|
<div class="field" data-hook="price">
|
67
67
|
<%= f.label :price %>
|
68
|
-
<%= render "spree/admin/shared/number_with_currency", f: f, amount_attr: :price, currency: @variant.
|
68
|
+
<%= render "spree/admin/shared/number_with_currency", f: f, amount_attr: :price, currency: @variant.find_or_build_default_price.currency %>
|
69
69
|
</div>
|
70
70
|
</div>
|
71
71
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
<%= zone_form.field_container :state_ids do %>
|
6
6
|
<%= zone_form.label :state_ids, plural_resource_name(Spree::State) %><br>
|
7
|
-
<%= zone_form.collection_select :state_ids, @states, :id, :
|
7
|
+
<%= zone_form.collection_select :state_ids, @states, :id, :state_with_country, {}, { multiple: true, class: "select2 fullwidth" } %>
|
8
8
|
<% end %>
|
9
9
|
</fieldset>
|
10
10
|
</div>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Spree::Admin::LocaleController, type: :controller do
|
6
|
+
stub_authorization!
|
7
|
+
|
8
|
+
before { I18n.backend.store_translations(:fr, {}) }
|
9
|
+
|
10
|
+
after do
|
11
|
+
I18n.locale = :en
|
12
|
+
I18n.reload!
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'switch_to_locale specified' do
|
16
|
+
let(:json_response) { JSON.parse(response.body, symbolize_names: true) }
|
17
|
+
|
18
|
+
before do
|
19
|
+
get :set, params: { switch_to_locale: switch_to_locale, format: :json }
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'available locale' do
|
23
|
+
let(:switch_to_locale) { 'fr' }
|
24
|
+
|
25
|
+
it 'sets locale and returns the location for the redirect' do
|
26
|
+
expect(I18n.locale).to eq :fr
|
27
|
+
expect(session[:admin_locale]).to eq(switch_to_locale)
|
28
|
+
expect(json_response).
|
29
|
+
to eq({ locale: switch_to_locale,
|
30
|
+
location: spree.admin_url(host: 'test.host') })
|
31
|
+
expect(response).to have_http_status(:ok)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'unavailable locale' do
|
36
|
+
let(:switch_to_locale) { 'klingon' }
|
37
|
+
|
38
|
+
it 'does not change locale and returns 404' do
|
39
|
+
expect(I18n.locale).to eq :en
|
40
|
+
expect(json_response).to eq({ locale: 'en', })
|
41
|
+
expect(response).to have_http_status(:not_found)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|