spree_admin 5.0.0.rc1 → 5.0.0

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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/spree/admin/components/_main.scss +14 -4
  3. data/app/assets/stylesheets/spree/admin/shared/_base.scss +12 -1
  4. data/app/controllers/spree/admin/dashboard_controller.rb +4 -1
  5. data/app/helpers/spree/admin/base_helper.rb +24 -10
  6. data/app/helpers/spree/admin/navigation_helper.rb +13 -10
  7. data/app/helpers/spree/admin/stores_helper.rb +3 -2
  8. data/app/helpers/spree/admin/webhooks_subscribers_helper.rb +1 -1
  9. data/app/javascript/spree/admin/controllers/variants_form_controller.js +4 -3
  10. data/app/views/layouts/spree/admin.html.erb +4 -0
  11. data/app/views/spree/admin/dashboard/_sidebar.html.erb +2 -0
  12. data/app/views/spree/admin/dashboard/_top_products.html.erb +34 -24
  13. data/app/views/spree/admin/dashboard/analytics.html.erb +3 -1
  14. data/app/views/spree/admin/dashboard/show.html.erb +3 -7
  15. data/app/views/spree/admin/orders/_customer_summary.html.erb +0 -2
  16. data/app/views/spree/admin/orders/_filters.html.erb +1 -1
  17. data/app/views/spree/admin/orders/_header.html.erb +2 -0
  18. data/app/views/spree/admin/orders/_summary.html.erb +1 -1
  19. data/app/views/spree/admin/orders/edit.html.erb +3 -5
  20. data/app/views/spree/admin/products/_filters.html.erb +1 -1
  21. data/app/views/spree/admin/products/_form.html.erb +3 -3
  22. data/app/views/spree/admin/products/edit.html.erb +3 -0
  23. data/app/views/spree/admin/products/form/_variants.html.erb +1 -0
  24. data/app/views/spree/admin/shared/_developers_nav.html.erb +2 -2
  25. data/app/views/spree/admin/shared/_head.html.erb +3 -1
  26. data/app/views/spree/admin/shared/_posts_tabs.html.erb +2 -2
  27. data/app/views/spree/admin/shared/_returns_and_refunds_nav.html.erb +3 -3
  28. data/app/views/spree/admin/shared/_shipping_nav.html.erb +2 -2
  29. data/app/views/spree/admin/shared/_stock_nav.html.erb +2 -2
  30. data/app/views/spree/admin/shared/_tax_nav.html.erb +2 -2
  31. data/app/views/spree/admin/shared/_user.html.erb +2 -2
  32. data/app/views/spree/admin/shared/_user_dropdown.html.erb +2 -2
  33. data/app/views/spree/admin/shared/sidebar/_orders_nav.html.erb +19 -29
  34. data/app/views/spree/admin/shared/sidebar/_products_nav.html.erb +6 -25
  35. data/app/views/spree/admin/shared/sidebar/_returns_nav.html.erb +8 -15
  36. data/app/views/spree/admin/shared/sidebar/_store_nav.html.erb +24 -52
  37. data/app/views/spree/admin/shared/sidebar/_storefront_nav.html.erb +19 -26
  38. data/app/views/spree/admin/stores/form/_basic.html.erb +2 -2
  39. data/app/views/spree/admin/variants/_variant.html.erb +8 -2
  40. data/app/views/spree/admin/variants/form/_pricing.html.erb +4 -3
  41. data/config/locales/en.yml +0 -43
  42. data/lib/spree/admin/engine.rb +50 -0
  43. metadata +9 -13
  44. data/app/views/spree/admin/orders/_extra_filters.html.erb +0 -0
  45. data/app/views/spree/admin/products/form/_extra_filters.html.erb +0 -0
  46. data/app/views/spree/admin/products/form/_extra_form.html.erb +0 -0
  47. data/app/views/spree/admin/products/form/_extra_form_sidebar.erb +0 -0
  48. data/app/views/spree/admin/stores/form/_custom.html.erb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c46d7797c6b7f96882ad96c43ea5a208adeca65c74816b1541a4eec33c6dbdd7
4
- data.tar.gz: 51593866ea9184c76e644c9e87691b94e183ea9bab9d50df371f97bc6a53ae59
3
+ metadata.gz: 9a3f2875dd028cc2a4d3dc3fb9933583918ff856afe242193a4c784bae6af84f
4
+ data.tar.gz: 9b3ec33e0fbc122fa9915fb5f0199c2ec79e249f9291429713c6d7e5dd89e2b8
5
5
  SHA512:
6
- metadata.gz: ab791c77bbf7061f800a622f19242dfea2ff77d5e11e6fca722ce06239462f7160bda2bfe31b983ef6fc440b0e9caa36802a986574a9c2ab7fee8dc50ab6b281
7
- data.tar.gz: 850bd370e9ec8cc75cf0017d6c866ea7f45c116e33d737977217a6c1e61070e5b2edb9f1275d23cca355cc190ad2c60d17cbf6d57baf49cebd82a6fd49e11303
6
+ metadata.gz: 42d85993653cd2792a7ee9bb052da3a5dfab181415fb2362c73fd09f33acc46a4ed6253d81fcdbb3d61320ca14ca4d5fa5eb92f5080e292a179f397778dcfc1a
7
+ data.tar.gz: cadca2e5fa570bf58c8de527f4702e9623e0ad3a3861a030404838a9ae3e1186d23cdd071dea58d3fe5222faf5a3d90f49cd095e767ea08b870f28cb21921944
@@ -54,23 +54,32 @@ turbo-frame[loading] .spinner-border, turbo-frame[busy] .spinner-border {
54
54
  border-radius: $border-radius;
55
55
  display: flex;
56
56
  align-items: center;
57
- padding-left: 0.5rem;
58
- padding-right: 0.5rem;
57
+ padding-left: 0.35rem;
58
+ padding-right: 0.35rem;
59
59
  padding-top: 0.35rem;
60
60
  padding-bottom: 0.35rem;
61
61
 
62
62
  .ti {
63
63
  font-size: 1rem;
64
64
  margin-right: 0.5rem;
65
+ border-radius: $border-radius-sm;
66
+ padding: 0.2rem 0.2rem;
65
67
  }
66
68
 
67
69
  &:hover {
68
- background-color: $gray-75;
70
+ background-color: $gray-50;
69
71
  }
70
72
  &.active {
71
73
  color: theme-color('primary');
72
- background-color: $gray-100;
74
+ background-color: $white;
75
+ box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.05) 0px 1px 2px -1px, rgba(0, 0, 0, 0.02) 0px 2px 4px 0px;
73
76
  font-weight: 500;
77
+
78
+ .ti {
79
+ background-color: theme-color('primary');
80
+ color: $white;
81
+ box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.05) 0px 1px 2px -1px, rgba(0, 0, 0, 0.02) 0px 2px 4px 0px;
82
+ }
74
83
  }
75
84
 
76
85
  .badge {
@@ -96,6 +105,7 @@ turbo-frame[loading] .spinner-border, turbo-frame[busy] .spinner-border {
96
105
  &.active, &:active, &:focus {
97
106
  font-weight: 600;
98
107
  background-color: transparent !important;
108
+ box-shadow: none;
99
109
  }
100
110
  }
101
111
  }
@@ -671,4 +671,15 @@ div.uppy-Root {
671
671
 
672
672
  .tooltip-inner {
673
673
  box-shadow: $dropdown-box-shadow;
674
- }
674
+ }
675
+
676
+ .avatar {
677
+ border-radius: 50%;
678
+ background-color: $gray-200;
679
+ color: $gray-500;
680
+ font-size: 1rem;
681
+ font-weight: 500;
682
+ display: flex;
683
+ align-items: center;
684
+ justify-content: center;
685
+ }
@@ -83,7 +83,10 @@ module Spree
83
83
 
84
84
  product_ids = line_items_grouped.map(&:variant_product_id).uniq.compact
85
85
 
86
- return if product_ids.empty?
86
+ if product_ids.empty?
87
+ @top_products = []
88
+ return
89
+ end
87
90
 
88
91
  products = current_store.products.with_deleted.includes(:master, :variants).where(id: product_ids)
89
92
 
@@ -3,6 +3,12 @@ module Spree
3
3
  module BaseHelper
4
4
  include Spree::ImagesHelper
5
5
 
6
+ def render_admin_partials(section, options = {})
7
+ Rails.application.config.spree_admin.send(section).map do |partial|
8
+ render partial, options
9
+ end.join.html_safe
10
+ end
11
+
6
12
  def enterprise_edition?
7
13
  defined?(Vendo)
8
14
  end
@@ -16,27 +22,35 @@ module Spree
16
22
  end
17
23
 
18
24
  def settings_active?
19
- %w[stores zones shipping_methods oauth_applications
20
- payment_methods refund_reasons reimbursement_types
21
- shipping_categories store_credit_categories
22
- syncs tax_categories tax_rates webhooks accounts
23
- custom_domains audits exports imports return_authorization_reasons
24
- documents stripe_tax_registrations members subscriptions stock_locations webhooks_subscribers].include?(controller_name)
25
+ @settings_active || %w[stores zones shipping_methods oauth_applications
26
+ payment_methods refund_reasons reimbursement_types
27
+ shipping_categories store_credit_categories
28
+ syncs tax_categories tax_rates webhooks accounts
29
+ custom_domains audits exports imports return_authorization_reasons
30
+ documents stripe_tax_registrations members subscriptions stock_locations webhooks_subscribers].include?(controller_name)
25
31
  end
26
32
 
27
33
  def available_countries_iso
28
34
  @available_countries_iso ||= current_store.countries_available_for_checkout.pluck(:iso)
29
35
  end
30
36
 
31
- def avatar_url_for(user)
37
+ def render_avatar(user, options = {})
32
38
  return unless user.present?
33
39
 
40
+ options[:width] ||= 128
41
+ options[:height] ||= 128
42
+ options[:class] ||= 'avatar'
43
+
34
44
  if user.respond_to?(:avatar) && user.avatar.attached? && user.avatar.variable?
35
- main_app.cdn_image_url(
36
- user.avatar.variant(spree_image_variant_options(resize_to_fill: [128, 128]))
45
+ image_tag(
46
+ main_app.cdn_image_url(
47
+ user.avatar.variant(spree_image_variant_options(resize_to_fill: [options[:width] * 2, options[:height] * 2]))
48
+ ),
49
+ class: options[:class],
50
+ style: "width: #{options[:width]}px; height: #{options[:height]}px;"
37
51
  )
38
52
  else
39
- "https://eu.ui-avatars.com/api/?name=#{user.name&.initials}&background=random"
53
+ content_tag(:div, user.name&.initials, class: options[:class], style: "width: #{options[:width]}px; height: #{options[:height]}px;")
40
54
  end
41
55
  end
42
56
 
@@ -1,6 +1,19 @@
1
1
  module Spree
2
2
  module Admin
3
3
  module NavigationHelper
4
+ # Creates a navigation item with optional icon
5
+ # @param [String, SafeBuffer] label The text or HTML to use as the link content
6
+ # @param [String] url The URL for the link
7
+ # @param [String, nil] icon Optional icon name to prepend to the label
8
+ # @param [Boolean, nil] active Whether the link should be marked as active
9
+ # @return [SafeBuffer] The navigation item HTML
10
+ def nav_item(label, url, icon: nil, active: nil)
11
+ content_tag :li, class: 'nav-item', role: 'presentation' do
12
+ label = icon(icon) + label if icon.present?
13
+ active_link_to label, url, class: 'nav-link', active: active
14
+ end
15
+ end
16
+
4
17
  # the per_page_dropdown is used on index pages like orders, products, promotions etc.
5
18
  # this method generates the select_tag
6
19
  def per_page_dropdown
@@ -162,16 +175,6 @@ module Spree
162
175
  end
163
176
  end
164
177
 
165
- def nav_pill_list_item(resource, url: nil, label: Spree.t(resource), active: nil, link_class: 'nav-link')
166
- url = spree.send("admin_#{resource.to_s.pluralize}_path") if url.nil?
167
- active = request.url.starts_with?(url) || request.fullpath.starts_with?(url) || controller_name == resource.to_s if active.nil?
168
- link_class = "#{link_class} active" if active
169
-
170
- content_tag :li, class: 'nav-item', role: 'presentation' do
171
- link_to label, url, role: 'tab', 'aria-controls': 'pills-general', class: link_class, 'aria-selected': active
172
- end
173
- end
174
-
175
178
  def external_link_to(label, url, opts = {}, &block)
176
179
  opts[:target] ||= :blank
177
180
  opts[:rel] ||= :nofollow
@@ -77,8 +77,9 @@ module Spree
77
77
  )
78
78
  else
79
79
  initials = store.name.split.map(&:first).join.upcase
80
- image_tag("https://eu.ui-avatars.com/api/?name=#{initials}&background=random", width: opts[:height], height: opts[:height],
81
- class: 'rounded with-tip', title: store.name)
80
+ content_tag(:div, initials, class: "avatar rounded with-tip bg-light",
81
+ style: "width: #{opts[:height]}px; height: #{opts[:height]}px;",
82
+ title: store.name)
82
83
  end
83
84
  end
84
85
  end
@@ -5,7 +5,7 @@ module Spree
5
5
  content_tag :div, class: 'col-xs-12 col-sm-6 col-md-4 col-lg-4 form-group' do
6
6
  content_tag :div, class: 'custom-control custom-switch' do
7
7
  (form.check_box resource_name, event_checkbox_opts(resource_name), true, nil) + ' ' +
8
- form.label(resource_name, Spree.t("admin.webhooks_subscribers.#{resource_name.to_s.pluralize}"), class: 'custom-control-label')
8
+ form.label(resource_name, Spree.t("#{resource_name.to_s.pluralize}"), class: 'custom-control-label')
9
9
  end
10
10
  end
11
11
  end
@@ -36,7 +36,8 @@ export default class extends CheckboxSelectAll {
36
36
  variantIds: Object,
37
37
  currentStockLocationId: String,
38
38
  stockLocations: Array,
39
- optionValuesSelectOptions: Array
39
+ optionValuesSelectOptions: Array,
40
+ locale: String
40
41
  }
41
42
 
42
43
  connect() {
@@ -403,7 +404,7 @@ export default class extends CheckboxSelectAll {
403
404
  pricesVariation.delete(null)
404
405
 
405
406
  if (pricesVariation.size === 0) {
406
- parentPriceEl.value = this.priceForVariant(variantName, currency).amount
407
+ parentPriceEl.value = this.priceForVariant(variantName, currency).amount?.toLocaleString(this.localeValue) || ''
407
408
  parentPriceEl.placeholder = ''
408
409
  return
409
410
  }
@@ -668,7 +669,7 @@ export default class extends CheckboxSelectAll {
668
669
  }
669
670
 
670
671
  const existingPrice = this.priceForVariant(internalName, currency)
671
- priceInput.value = existingPrice.amount
672
+ priceInput.value = existingPrice.amount?.toLocaleString(this.localeValue) || ''
672
673
  currencyInput.value = currency
673
674
  if (existingPrice.id) {
674
675
  idInput.value = existingPrice.id
@@ -6,6 +6,8 @@
6
6
  </head>
7
7
 
8
8
  <body class="admin min-vh-100 <%= controller_name %> <%= action_name %>">
9
+ <%= render_admin_partials(:body_start_partials) %>
10
+
9
11
  <%= render "spree/admin/shared/header" %>
10
12
  <%= render "spree/admin/shared/sidebar" %>
11
13
  <main id="content">
@@ -17,5 +19,7 @@
17
19
  </main>
18
20
  <%= render "spree/admin/shared/modal" %>
19
21
  <%= render "spree/admin/shared/alerts" %>
22
+
23
+ <%= render_admin_partials(:body_end_partials) %>
20
24
  </body>
21
25
  </html>
@@ -0,0 +1,2 @@
1
+ <%= render 'updater' %>
2
+ <%= render 'store_preview' %>
@@ -32,40 +32,50 @@
32
32
  </tr>
33
33
  </thead>
34
34
  <tbody>
35
- <% @top_products.each do |list_item| %>
36
- <% product = list_item[:product] %>
37
- <tr>
38
- <% cache_unless @vendor, spree_base_cache_scope.call(product) do %>
39
- <td>
40
- <%= link_to spree.edit_admin_product_path(product), class: 'd-flex align-items-center font-weight-bold', data: { 'turbo-frame': '_top' } do %>
41
- <div class="mr-3">
42
- <%= render 'spree/admin/shared/product_image', object: product %>
43
- </div>
44
- <%= product.name %>
35
+ <% if @top_products.any? %>
36
+ <% @top_products.each do |list_item| %>
37
+ <% product = list_item[:product] %>
38
+ <tr>
39
+ <% cache_unless @vendor, spree_base_cache_scope.call(product) do %>
40
+ <td>
41
+ <%= link_to spree.edit_admin_product_path(product), class: 'd-flex align-items-center font-weight-bold', data: { 'turbo-frame': '_top' } do %>
42
+ <div class="mr-3">
43
+ <%= render 'spree/admin/shared/product_image', object: product %>
44
+ </div>
45
+ <%= product.name %>
46
+ <% end %>
47
+ </td>
48
+ <% if enterprise_edition? && defined?(vendor_logo_link) && !@vendor %>
49
+ <td>
50
+ <%= vendor_logo_link(product.vendor) if product.vendor.present? %>
51
+ </td>
45
52
  <% end %>
46
- </td>
47
- <% if enterprise_edition? && defined?(vendor_logo_link) && !@vendor %>
48
53
  <td>
49
- <%= vendor_logo_link(product.vendor) if product.vendor.present? %>
54
+ <%= display_admin_price(product) %>
50
55
  </td>
51
56
  <% end %>
52
- <td>
53
- <%= display_admin_price(product) %>
57
+ <td class="text-center">
58
+ <%= list_item[:quantity] %>
54
59
  </td>
55
- <% end %>
56
- <td class="text-center">
57
- <%= list_item[:quantity] %>
58
- </td>
59
- <td class="text-right">
60
- <%= list_item[:amount] %>
60
+ <td class="text-right">
61
+ <%= list_item[:amount] %>
62
+ </td>
63
+ </tr>
64
+ <% end %>
65
+ <% else %>
66
+ <tr>
67
+ <td colspan="5" class="text-center text-muted py-5">
68
+ <%= Spree.t(:no_resource_found, resource: Spree::Product.name.demodulize.underscore.humanize) %>
61
69
  </td>
62
70
  </tr>
63
71
  <% end %>
64
72
  </tbody>
65
73
  </table>
66
74
  </div>
67
- <p class="text-center mt-0 border-top py-2 mb-0">
68
- <%= link_to Spree.t('admin.dashboard.view_report'), report_link, class: 'm-2 w-50 btn btn-light mt-2', data: { turbo_frame: '_top' } %>
69
- </p>
75
+ <% if @top_products.any? %>
76
+ <p class="text-center mt-0 border-top py-2 mb-0">
77
+ <%= link_to Spree.t('admin.dashboard.view_report'), report_link, class: 'm-2 w-50 btn btn-light mt-2', data: { turbo_frame: '_top' } %>
78
+ </p>
79
+ <% end %>
70
80
  </div>
71
81
  </div>
@@ -113,6 +113,8 @@
113
113
  </div>
114
114
  </div>
115
115
 
116
- <%= render 'top_products' if @top_products.present? %>
116
+ <%= render 'top_products' if @top_products %>
117
117
  <%= render 'visits' if @visits %>
118
+
119
+ <%= render_admin_partials(:dashboard_analytics_partials) %>
118
120
  <% end %>
@@ -23,11 +23,7 @@
23
23
  <%= render 'analytics' %>
24
24
  </div>
25
25
  <div class="col-lg-4">
26
- <% if defined?(current_vendor) && current_vendor %>
27
- <%= render 'spree/admin/shared/vendor_faq' %>
28
- <% else %>
29
- <%= render 'updater' %>
30
- <%= render 'store_preview' %>
31
- <%= render 'vendors' if defined?(Spree::Vendor) %>
32
- <% end %>
26
+ <%= render 'sidebar' %>
27
+ <%= render_admin_partials(:dashboard_sidebar_partials) %>
28
+ </div>
33
29
  </div>
@@ -1,8 +1,6 @@
1
1
  <% if order %>
2
2
  <% if order.user %>
3
3
  <span class="d-flex">
4
- <%#= image_tag(avatar_url_for( order.user), width: 24, height: 24, class: 'mr-2 rounded') %>
5
-
6
4
  <% if can?(:manage, order.user) %>
7
5
  <%= link_to order.full_name, spree.admin_user_path(order.user), class: 'text-dark', data: { 'turbo-frame': '_top' } %>
8
6
  <% else %>
@@ -89,7 +89,7 @@
89
89
  </div>
90
90
  </div>
91
91
 
92
- <%= render "spree/admin/orders/extra_filters", f: f %>
92
+ <%= render_admin_partials(:orders_filters_partials, f: f) %>
93
93
  </div>
94
94
 
95
95
  <div class="form-actions">
@@ -63,6 +63,8 @@
63
63
  <% end %>
64
64
  <% end %>
65
65
 
66
+ <%= render_admin_partials(:order_page_dropdown_partials, order: @order) %>
67
+
66
68
  <% if can?(:cancel, @order) %>
67
69
  <div class="dropdown-divider"></div>
68
70
  <%= link_to spree.cancel_admin_order_path(@order),
@@ -74,7 +74,7 @@
74
74
  <%= render 'tax_lines', tax_lines: tax_lines, id: 'tax-lines-additional' %>
75
75
  </li>
76
76
 
77
- <%= render 'summary_custom', order: @order %>
77
+ <%= render_admin_partials(:order_page_body_partials, order: @order) %>
78
78
 
79
79
  <li class="list-group-item d-flex justify-content-between align-items-center border-0">
80
80
  <span data-hook='admin_order_tab_total_title'><%= Spree.t(:total) %></span>
@@ -1,23 +1,21 @@
1
1
  <%= render 'header' %>
2
- <%= render 'header_custom' %>
2
+ <%= render_admin_partials(:order_page_header_partials, order: @order) %>
3
3
 
4
4
  <div class="container px-0">
5
5
  <div class="row">
6
6
  <div class="col-lg-8">
7
-
8
7
  <%= render 'line_items' %>
9
8
  <%= render 'shipments' %>
10
9
  <%= render 'customer_returns' %>
11
10
  <%= render 'return_authorizations' %>
12
11
  <%= render 'payments'%>
13
12
  <%= render 'refunds'%>
14
-
15
- <%= render 'body_custom' %>
13
+ <%= render_admin_partials(:order_page_body_partials, order: @order) %>
16
14
  <%= render 'summary' %>
17
15
  </div>
18
16
  <div class="col-lg-4">
19
- <!-- TODO: add notes -->
20
17
  <%= render 'customer' %>
18
+ <%= render_admin_partials(:order_page_sidebar_partials, order: @order) %>
21
19
  </div>
22
20
  </div>
23
21
  </div>
@@ -43,7 +43,7 @@
43
43
  } %>
44
44
  </div>
45
45
  </div>
46
- <%= render partial: "spree/admin/products/form/extra_filters", locals: { f: f } %>
46
+ <%= render_admin_partials(:products_filters_partials, f: f) %>
47
47
  </div>
48
48
 
49
49
  <div class="form-actions">
@@ -9,13 +9,13 @@
9
9
  <%= render 'spree/admin/products/form/inventory', f: f unless @product.has_variants? %>
10
10
  <%= render 'spree/admin/products/form/shipping', f: f %>
11
11
  <%= render 'spree/admin/products/form/properties', f: f %>
12
- <%= render 'spree/admin/products/form/extra_form', f: f %>
12
+ <%= render_admin_partials(:product_form_partials, f: f, product: @product) %>
13
13
  </div>
14
14
  <div class="col-md-4">
15
15
  <%= render 'spree/admin/products/form/status', f: f %>
16
16
  <%= render 'spree/admin/products/form/categorization', f: f %>
17
- <%= render 'spree/admin/products/form/stores', f: f if Spree::Store.accessible_by(current_ability).count > 1 %>
18
- <%= render 'spree/admin/products/form/extra_form_sidebar', f: f %>
17
+ <%= render 'spree/admin/products/form/stores', f: f if available_stores.count > 1 %>
18
+ <%= render_admin_partials(:product_form_sidebar_partials, f: f, product: @product) %>
19
19
 
20
20
  <%= render 'spree/admin/shared/seo',
21
21
  f: f,
@@ -6,6 +6,9 @@
6
6
  spree.admin_product_digital_assets_path(@product),
7
7
  class: "dropdown-item",
8
8
  ) if can?(:manage, Spree::Digital) %>
9
+
10
+ <%= render_admin_partials(:product_dropdown_partials, product: @product) %>
11
+
9
12
  <div class="dropdown-divider"></div>
10
13
 
11
14
  <%= external_page_preview_link(@product) %>
@@ -9,6 +9,7 @@
9
9
  data-controller="variants-form"
10
10
  class="variants-form"
11
11
  data-action="product-form:toggle-quantity-tracked@window->variants-form#toggleQuantityTracked"
12
+ data-variants-form-locale-value="<%= I18n.locale %>"
12
13
  <% if @product.persisted? %> data-variants-form-product-id-value="<%= @product.slug %>" <% end %>
13
14
  data-variants-form-current-currency-value="<%= current_currency %>"
14
15
  data-variants-form-currencies-value="<%= supported_currencies.map(&:to_s).to_json %>"
@@ -2,6 +2,6 @@
2
2
  <%= Spree.t(:developers) %>
3
3
  <% end %>
4
4
  <%= content_for :page_tabs do %>
5
- <%= nav_pill_list_item(:api_keys, label: Spree.t(:api_keys), url: spree.admin_oauth_applications_path) if can?(:manage, Spree::OauthApplication) %>
6
- <%= nav_pill_list_item(:webhooks, label: Spree.t(:webhooks), url: spree.admin_webhooks_subscribers_path) if can?(:manage, Spree::Webhooks::Subscriber) %>
5
+ <%= nav_item(Spree.t(:api_keys), spree.admin_oauth_applications_path) if can?(:manage, Spree::OauthApplication) %>
6
+ <%= nav_item(Spree.t(:webhooks), spree.admin_webhooks_subscribers_path) if can?(:manage, Spree::Webhooks::Subscriber) %>
7
7
  <% end %>
@@ -49,4 +49,6 @@
49
49
  </style>
50
50
  <% end %>
51
51
 
52
- <%= render 'spree/shared/google_places_api_loader' %>
52
+ <%= render 'spree/shared/google_places_api_loader' %>
53
+
54
+ <%= render_admin_partials(:head_partials) %>
@@ -3,6 +3,6 @@
3
3
  <% end %>
4
4
 
5
5
  <% content_for(:page_tabs) do %>
6
- <%= nav_pill_list_item(:posts) if can?(:manage, Spree::Post) %>
7
- <%= nav_pill_list_item(:post_categories, label: Spree.t(:categories)) if can?(:manage, Spree::PostCategory) %>
6
+ <%= nav_item(Spree.t(:posts), spree.admin_posts_path) if can?(:manage, Spree::Post) %>
7
+ <%= nav_item(Spree.t(:categories), spree.admin_post_categories_path) if can?(:manage, Spree::PostCategory) %>
8
8
  <% end %>
@@ -3,7 +3,7 @@
3
3
  <% end %>
4
4
 
5
5
  <% content_for(:page_tabs) do %>
6
- <%= nav_pill_list_item(:return_authorization_reasons, url: spree.admin_return_authorization_reasons_path) if can?(:manage, Spree::ReturnAuthorizationReason) %>
7
- <%= nav_pill_list_item(:refund_reasons, url: spree.admin_refund_reasons_path) if can?(:manage, Spree::RefundReason) %>
8
- <%= nav_pill_list_item(:reimbursement_types, url: spree.admin_reimbursement_types_path) if can?(:manage, Spree::ReimbursementType) %>
6
+ <%= nav_item(Spree.t(:return_authorization_reasons), spree.admin_return_authorization_reasons_path) if can?(:manage, Spree::ReturnAuthorizationReason) %>
7
+ <%= nav_item(Spree.t(:refund_reasons), spree.admin_refund_reasons_path) if can?(:manage, Spree::RefundReason) %>
8
+ <%= nav_item(Spree.t(:reimbursement_types), spree.admin_reimbursement_types_path) if can?(:manage, Spree::ReimbursementType) %>
9
9
  <% end %>
@@ -1,4 +1,4 @@
1
1
  <%= content_for(:page_tabs) do %>
2
- <%= nav_pill_list_item(:shipping_methods, url: spree.admin_shipping_methods_path, active: controller_name == 'shipping_methods' && action_name == 'index') if can?(:manage, Spree::ShippingMethod) %>
3
- <%= nav_pill_list_item(:shipping_categories, url: spree.admin_shipping_categories_path) if can?(:manage, Spree::ShippingCategory) %>
2
+ <%= nav_item(Spree.t(:shipping_methods), spree.admin_shipping_methods_path, active: controller_name == 'shipping_methods' && action_name == 'index') if can?(:manage, Spree::ShippingMethod) %>
3
+ <%= nav_item(Spree.t(:shipping_categories), spree.admin_shipping_categories_path) if can?(:manage, Spree::ShippingCategory) %>
4
4
  <% end %>
@@ -1,4 +1,4 @@
1
1
  <ul class="nav mb-0" id="pills-tab" role="tablist">
2
- <%= nav_pill_list_item(:stock_items) if can?(:manage, Spree::StockItem) %>
3
- <%= nav_pill_list_item(:stock_transfers) if can?(:manage, Spree::StockTransfer) %>
2
+ <%= nav_item(Spree.t(:stock_items), spree.admin_stock_items_path) if can?(:manage, Spree::StockItem) %>
3
+ <%= nav_item(Spree.t(:stock_transfers), spree.admin_stock_transfers_path) if can?(:manage, Spree::StockTransfer) %>
4
4
  </ul>
@@ -1,4 +1,4 @@
1
1
  <%= content_for(:page_tabs) do %>
2
- <%= nav_pill_list_item(:tax_rates, url: spree.admin_tax_rates_path) if can?(:manage, Spree::TaxRate) %>
3
- <%= nav_pill_list_item(:tax_categories, url: spree.admin_tax_categories_path) if can?(:manage, Spree::TaxCategory) %>
2
+ <%= nav_item(Spree.t(:tax_rates), spree.admin_tax_rates_path) if can?(:manage, Spree::TaxRate) %>
3
+ <%= nav_item(Spree.t(:tax_categories), spree.admin_tax_categories_path) if can?(:manage, Spree::TaxCategory) %>
4
4
  <% end %>
@@ -1,8 +1,8 @@
1
1
  <%= link_to spree.admin_user_path(user), class: 'rounded hover-light p-2 d-flex justify-content-start align-items-center', data: {turbo_frame: :_top} do %>
2
2
  <% if user.name.present? %>
3
- <%= image_tag(avatar_url_for(user), width: 48, height: 48, class: 'mr-3 rounded-lg') %>
3
+ <%= render_avatar(user, width: 48, height: 48, class: 'mr-3 avatar') %>
4
4
  <% else %>
5
- <div style="width: 48px; height: 48px" class="mr-3 rounded-lg bg-light"></div>
5
+ <div style="width: 48px; height: 48px" class="mr-3 avatar bg-light"></div>
6
6
  <% end %>
7
7
  <div class="text-left">
8
8
  <% if customer_full_name(user) %>
@@ -4,8 +4,8 @@
4
4
  class="btn d-flex align-items-center justify-content-between text-left w-100"
5
5
  data-toggle="dropdown" aria-expanded="false" id="accountNav">
6
6
  <div class="d-flex align-items-center">
7
- <%= image_tag(avatar_url_for(try_spree_current_user), width: 34, height: 34, class: 'rounded-circle mr-lg-2') %>
8
- <span class="d-none d-lg-inline">
7
+ <%= render_avatar(try_spree_current_user, width: 34, height: 34) %>
8
+ <span class="d-none d-lg-inline ml-lg-2">
9
9
  <%= try_spree_current_user.name&.full&.truncate(15)&.presence || try_spree_current_user.email.truncate(15) %><br />
10
10
  <span class="text-muted small"><%= try_spree_current_user.email.truncate(22) %></span>
11
11
  </span>
@@ -1,35 +1,25 @@
1
1
  <% orders_active = %[orders checkouts].include?(controller_name) || @order %>
2
2
  <% if can?(:manage, Spree::Order) %>
3
- <li class="nav-item">
4
- <%= active_link_to spree.admin_orders_path, class: 'nav-link', active: orders_active do %>
5
- <%= icon 'inbox' %>
6
- <%= Spree.t(:orders) %>
7
-
3
+ <% orders_label = Spree.t(:orders) %>
4
+ <% if ready_to_ship_orders_count&.positive? %>
5
+ <% orders_label += content_tag(:span, ready_to_ship_orders_count, class: 'badge ml-auto') %>
6
+ <% end %>
7
+
8
+ <%= nav_item(orders_label.html_safe, spree.admin_orders_path, icon: 'inbox', active: orders_active) %>
9
+
10
+ <% if orders_active && (ready_to_ship_orders_count&.positive? || can?(:manage, :checkouts)) %>
11
+ <ul class="ml-4 pl-1 mb-2 nav-submenu mt-1">
8
12
  <% if ready_to_ship_orders_count&.positive? %>
9
- <span class="badge ml-auto">
10
- <%= ready_to_ship_orders_count %>
11
- </span>
13
+ <% fulfill_label = Spree.t('admin.orders.orders_to_fulfill') %>
14
+ <% fulfill_label += content_tag(:span, ready_to_ship_orders_count, class: 'badge ml-auto') %>
15
+ <%= nav_item(fulfill_label.html_safe, spree.admin_orders_path(q: {shipment_state_not_in: [:shipped, :canceled]}), active: params.dig(:q, :shipment_state_not_in).present?) %>
16
+ <% end %>
17
+
18
+ <% if can?(:manage, :checkouts) %>
19
+ <%= nav_item(Spree.t(:draft_orders), spree.admin_checkouts_path, active: params[:controller] == 'checkouts') %>
12
20
  <% end %>
13
- <% end %>
14
- <% if orders_active && (ready_to_ship_orders_count&.positive? || can?(:manage, :checkouts)) %>
15
- <ul class="ml-4 pl-1 mb-2 nav-submenu mt-1">
16
- <% if ready_to_ship_orders_count&.positive? %>
17
- <li class="nav-item">
18
- <%= active_link_to spree.admin_orders_path(q: {shipment_state_not_in: [:shipped, :canceled]}), class: 'nav-link', active: params.dig(:q, :shipment_state_not_in).present? do %>
19
- <span><%= Spree.t('admin.orders.orders_to_fulfill') %></span>
20
- <span class="badge ml-auto">
21
- <%= ready_to_ship_orders_count %>
22
- </span>
23
- <% end %>
24
- </li>
25
- <% end %>
26
21
 
27
- <% if can?(:manage, :checkouts) %>
28
- <li class="nav-item">
29
- <%= active_link_to Spree.t(:draft_orders), spree.admin_checkouts_path, class: 'nav-link' %>
30
- </li>
31
- <% end %>
32
- </ul>
33
- <% end %>
34
- </li>
22
+ <%= render_admin_partials(:store_orders_nav_partials) %>
23
+ </ul>
24
+ <% end %>
35
25
  <% end %>
@@ -1,41 +1,22 @@
1
1
  <% products_active = %w[products external_categories taxons taxonomies option_types option_values properties stock_items stock_transfers].include?(controller_name) || request.path.include?('products') %>
2
2
  <% if can?(:manage, Spree::Product) %>
3
- <li class="nav-item">
4
- <%= active_link_to spree.admin_products_path, class: 'nav-link', active: products_active do %>
5
- <span class="position-relative">
6
- <%= icon 'box-seam' %>
7
- </span>
8
- <%= Spree.t(:products) %>
9
- <% end %>
3
+ <%= nav_item(Spree.t(:products), spree.admin_products_path, icon: 'box-seam', active: products_active) %>
10
4
  <% if products_active %>
11
5
  <ul class="ml-4 pl-1 mb-2 nav-submenu mt-1">
12
6
  <% if can?(:manage, Spree::StockItem) || can?(:manage, Spree::StockTransfer) %>
13
- <li class="nav-item">
14
- <%= active_link_to Spree.t(:stock), spree.admin_stock_items_path, class: 'nav-link', active: %w[stock_items stock_transfers].include?(controller_name) %>
15
- </li>
7
+ <%= nav_item(Spree.t(:stock), spree.admin_stock_items_path, active: %w[stock_items stock_transfers].include?(controller_name)) %>
16
8
  <% end %>
17
9
  <% if can?(:manage, Spree::Taxonomy) && can?(:manage, Spree::Taxon) %>
18
- <li class="nav-item">
19
- <%= active_link_to Spree.t(:taxonomies), spree.admin_taxonomies_path, class: 'nav-link' %>
20
- </li>
10
+ <%= nav_item(Spree.t(:taxonomies), spree.admin_taxonomies_path) %>
21
11
  <% end %>
22
12
  <% if can?(:manage, Spree::OptionType) %>
23
- <li class="nav-item">
24
- <%= active_link_to Spree.t(:options), spree.admin_option_types_path, class: 'nav-link', active: %w[option_types option_values].include?(controller_name) %>
25
- </li>
13
+ <%= nav_item(Spree.t(:options), spree.admin_option_types_path, active: %w[option_types option_values].include?(controller_name)) %>
26
14
  <% end %>
27
15
  <% if can?(:manage, Spree::Property) %>
28
- <li class="nav-item">
29
- <%= active_link_to Spree.t(:properties), spree.admin_properties_path, class: 'nav-link' %>
30
- </li>
16
+ <%= nav_item(Spree.t(:properties), spree.admin_properties_path) %>
31
17
  <% end %>
32
18
 
33
- <% if defined?(Spree::ExternalCategory) && can?(:manage, Spree::ExternalCategory) %>
34
- <li class="nav-item">
35
- <%= active_link_to 'Category mapper', spree.admin_external_categories_path, class: 'nav-link' %>
36
- </li>
37
- <% end %>
19
+ <%= render_admin_partials(:store_products_nav_partials) %>
38
20
  </ul>
39
21
  <% end %>
40
- </li>
41
22
  <% end %>
@@ -1,20 +1,13 @@
1
1
  <% returns_active = %[customer_returns return_authorizations].include?(controller_name) %>
2
2
 
3
3
  <% if can?(:manage, Spree::CustomerReturn) || can?(:manage, Spree::ReturnAuthorization) %>
4
- <li class="nav-item">
5
- <%= active_link_to spree.admin_customer_returns_path, class: 'nav-link', active: returns_active do %>
6
- <%= icon 'receipt-refund' %>
7
- <%= Spree.t(:returns) %>
8
- <% end %>
4
+ <%= nav_item(Spree.t(:returns), spree.admin_customer_returns_path, icon: 'receipt-refund', active: returns_active) %>
9
5
 
10
- <% if returns_active %>
11
- <ul class="ml-4 pl-1 mb-2 nav-submenu mt-1">
12
- <% if can?(:manage, Spree::ReturnAuthorization) %>
13
- <li class="nav-item">
14
- <%= active_link_to Spree.t(:return_authorizations), spree.admin_return_authorizations_path, class: 'nav-link' %>
15
- </li>
16
- <% end %>
17
- </ul>
18
- <% end %>
19
- </li>
6
+ <% if returns_active %>
7
+ <ul class="ml-4 pl-1 mb-2 nav-submenu mt-1">
8
+ <% if can?(:manage, Spree::ReturnAuthorization) %>
9
+ <%= nav_item(Spree.t(:return_authorizations), spree.admin_return_authorizations_path) %>
10
+ <% end %>
11
+ </ul>
12
+ <% end %>
20
13
  <% end %>
@@ -5,79 +5,51 @@
5
5
  </li>
6
6
 
7
7
  <% if can?(:manage, current_store) %>
8
- <li class="nav-item">
9
- <%= active_link_to_with_icon('building-store', Spree.t(:store_details), spree.edit_admin_store_path(section: 'general-settings'), class: 'nav-link', active: params[:section] == 'general-settings') %>
10
- </li>
8
+ <%= nav_item(Spree.t(:store_details), spree.edit_admin_store_path(section: 'general-settings'), icon: 'building-store', active: params[:section] == 'general-settings') %>
11
9
  <% end %>
12
10
 
13
11
  <% if defined?(current_account) && current_account.present? && can?(:manage, current_account) %>
14
- <li class="nav-item">
15
- <%= active_link_to_with_icon 'receipt', Spree.t(:account), main_app.edit_account_path(current_account), class: 'nav-link' %>
16
- </li>
17
- <li class="nav-item">
18
- <%= active_link_to_with_icon 'users', Spree.t(:account_members), main_app.account_members_path(current_account), class: 'nav-link rounded-lg ' %>
19
- </li>
12
+ <%= nav_item(Spree.t(:account), main_app.edit_account_path(current_account), icon: 'receipt') %>
13
+ <%= nav_item(Spree.t(:account_members), main_app.account_members_path(current_account), icon: 'users') %>
20
14
  <% end %>
21
15
 
22
16
  <% if can?(:manage, current_store) %>
23
- <li class="nav-item">
24
- <%= active_link_to_with_icon('send', Spree.t(:emails), spree.edit_admin_store_path(section: 'emails'), class: 'nav-link', active: params[:section] == 'emails') %>
25
- </li>
26
- <li class="nav-item">
27
- <%= active_link_to_with_icon('list-check', Spree.t(:policies), spree.edit_admin_store_path(section: 'policies'), class: 'nav-link', active: params[:section] == 'policies') %>
28
- </li>
29
- <li class="nav-item">
30
- <%= active_link_to_with_icon('shopping-cart', Spree.t(:checkout), spree.edit_admin_store_path(section: 'checkout'), class: 'nav-link', active: params[:section] == 'checkout') %>
31
- </li>
17
+ <%= nav_item(Spree.t(:emails), spree.edit_admin_store_path(section: 'emails'), icon: 'send', active: params[:section] == 'emails') %>
18
+ <%= nav_item(Spree.t(:policies), spree.edit_admin_store_path(section: 'policies'), icon: 'list-check', active: params[:section] == 'policies') %>
19
+ <%= nav_item(Spree.t(:checkout), spree.edit_admin_store_path(section: 'checkout'), icon: 'shopping-cart', active: params[:section] == 'checkout') %>
32
20
  <% end %>
33
21
 
34
22
  <% if can?(:manage, Spree::CustomDomain) %>
35
- <li class="nav-item">
36
- <%= active_link_to_with_icon('world-www', Spree.t(:domains), spree.admin_custom_domains_path, class: 'nav-link') %>
37
- </li>
23
+ <%= nav_item(Spree.t(:domains), spree.admin_custom_domains_path, icon: 'world-www') %>
38
24
  <% end %>
39
25
 
40
26
  <% if can?(:manage, Spree::PaymentMethod) %>
41
- <li class="nav-item">
42
- <%= active_link_to_with_icon('credit-card', Spree.t(:payments), spree.admin_payment_methods_path, class: 'nav-link') %>
43
- </li>
27
+ <%= nav_item(Spree.t(:payments), spree.admin_payment_methods_path, icon: 'credit-card') %>
44
28
  <% end %>
45
29
 
46
30
  <% if can?(:manage, Spree::Zone) %>
47
- <li class="nav-item">
48
- <%= active_link_to_with_icon('world', Spree.t(:zones), spree.admin_zones_path, { active: %w[zones countries states].include?(controller_name), class: 'nav-link' }) %>
49
- </li>
31
+ <%= nav_item(Spree.t(:zones), spree.admin_zones_path, icon: 'world', active: %w[zones countries states].include?(controller_name)) %>
50
32
  <% end %>
51
33
 
52
34
  <% if can?(:manage, Spree::ShippingMethod) %>
53
- <li class="nav-item">
54
- <%= active_link_to_with_icon('truck', Spree.t(:shipping), spree.admin_shipping_methods_path, { active: %w[shipping_methods shipping_categories].include?(controller_name), class: 'nav-link' }) %>
55
- </li>
35
+ <%= nav_item(Spree.t(:shipping), spree.admin_shipping_methods_path, icon: 'truck', active: %w[shipping_methods shipping_categories].include?(controller_name)) %>
56
36
  <% end %>
57
37
 
58
38
  <% if can?(:manage, Spree::TaxRate) %>
59
- <li class="nav-item">
60
- <%= active_link_to_with_icon('receipt-tax', Spree.t(:tax), spree.admin_tax_rates_path, active: %w[tax_rates tax_categories stripe_tax_registrations].include?(controller_name), class: 'nav-link') %>
61
- </li>
39
+ <%= nav_item(Spree.t(:tax), spree.admin_tax_rates_path, icon: 'receipt-tax', active: %w[tax_rates tax_categories stripe_tax_registrations].include?(controller_name)) %>
62
40
  <% end %>
63
41
 
64
42
  <% if can?(:manage, Spree::ReturnAuthorizationReason) %>
65
- <li class="nav-item">
66
- <%= active_link_to_with_icon('receipt-refund', Spree.t(:returns), spree.admin_return_authorization_reasons_path, active: %w[refund_reasons reimbursement_types return_authorization_reasons].include?(controller_name), class: 'nav-link') %>
67
- </li>
43
+ <%= nav_item(Spree.t(:returns), spree.admin_return_authorization_reasons_path, icon: 'receipt-refund', active: %w[refund_reasons reimbursement_types return_authorization_reasons].include?(controller_name)) %>
68
44
  <% end %>
69
45
 
70
46
  <% if can?(:manage, Spree::StockLocation) %>
71
- <li class="nav-item">
72
- <%= active_link_to_with_icon('map-pin', Spree.t(:stock_locations), spree.admin_stock_locations_path, class: 'nav-link') %>
73
- </li>
47
+ <%= nav_item(Spree.t(:stock_locations), spree.admin_stock_locations_path, icon: 'map-pin') %>
74
48
  <% end %>
75
49
 
76
50
  <% if can?(:manage, Spree::Store) %>
77
51
  <% if enterprise_edition? %>
78
- <li class="nav-item">
79
- <%= active_link_to_with_icon('history', Spree.t('admin.audit_log'), spree.admin_audits_path, class: 'nav-link w-auto', active: %w[audits exports imports].include?(controller_name)) %>
80
- </li>
52
+ <%= nav_item(Spree.t('admin.audit_log'), spree.admin_audits_path, icon: 'history', active: %w[audits exports imports].include?(controller_name)) %>
81
53
  <% else %>
82
54
  <li class="nav-item">
83
55
  <%= external_link_to nil, 'https://spreecommerce.org/pricing', class: 'nav-link d-flex align-items-center w-100' do %>
@@ -91,10 +63,10 @@
91
63
  <% end %>
92
64
 
93
65
  <% if can?(:manage, Spree::OauthApplication) %>
94
- <li class="nav-item">
95
- <%= active_link_to_with_icon('terminal', Spree.t(:developers), spree.admin_oauth_applications_path, class: 'nav-link', active: %w[oauth_applications webhooks_subscribers].include?(controller_name)) %>
96
- </li>
66
+ <%= nav_item(Spree.t(:developers), spree.admin_oauth_applications_path, icon: 'terminal', active: %w[oauth_applications webhooks_subscribers].include?(controller_name)) %>
97
67
  <% end %>
68
+
69
+ <%= render_admin_partials(:store_settings_nav_partials) %>
98
70
  </ul>
99
71
  <% else %>
100
72
  <%= render 'spree/admin/shared/sidebar/store_dropdown' %>
@@ -159,18 +131,18 @@
159
131
 
160
132
  <%= render 'spree/admin/shared/sidebar/custom_nav' %>
161
133
 
134
+ <%= render_admin_partials(:store_nav_partials) %>
135
+
162
136
  <li class="nav-item border-top border-top-dashed my-1"></li>
163
137
  <%= render 'spree/admin/shared/sidebar/storefront_nav' %>
164
138
  <%= render 'spree/admin/shared/sidebar/integrations_nav' %>
165
139
 
166
- <li class="nav-item border-top border-top-dashed my-1"></li>
167
- <li class="nav-item">
168
- <%= active_link_to_with_icon('settings', Spree.t(:settings), spree.edit_admin_store_path(section: 'general-settings'), class: 'nav-link', active: params[:section] == 'general-settings') %>
169
- </li>
140
+ <% if can?(:manage, current_store) %>
141
+ <li class="nav-item border-top border-top-dashed my-1"></li>
142
+ <%= nav_item(Spree.t(:settings), spree.edit_admin_store_path(section: 'general-settings'), icon: 'settings', active: params[:section] == 'general-settings') %>
143
+ <% end %>
170
144
  <% if defined?(current_account) && current_account.present? && can?(:manage, current_account) %>
171
- <li class="nav-item">
172
- <%= active_link_to_with_icon 'users', Spree.t(:account_members), main_app.account_members_path(current_account), class: 'nav-link' %>
173
- </li>
145
+ <%= nav_item(Spree.t(:account_members), main_app.account_members_path(current_account), icon: 'users') %>
174
146
  <% end %>
175
147
  </ul>
176
148
  <% end %>
@@ -1,29 +1,22 @@
1
1
  <% if can?(:manage, Spree::Theme) %>
2
- <li class="nav-item">
3
- <% storefront_active = %w[themes posts post_categories pages storefront].include?(controller_name) %>
4
- <%= active_link_to_with_icon('building-store', Spree.t('admin.storefront'), spree.admin_themes_path, class: 'nav-link', active: storefront_active) %>
2
+ <% storefront_active = %w[themes posts post_categories pages storefront].include?(controller_name) %>
3
+ <%= nav_item(Spree.t('admin.storefront'), spree.admin_themes_path, icon: 'building-store', active: storefront_active) %>
5
4
 
6
- <% if storefront_active %>
7
- <ul class="ml-4 pl-1 mb-2 nav-submenu mt-1">
8
- <li class="nav-item">
9
- <%= active_link_to Spree.t(:themes), spree.admin_themes_path, class: 'nav-link' %>
10
- </li>
11
- <% if can?(:manage, Spree::Page) %>
12
- <li class="nav-item">
13
- <%= active_link_to Spree.t(:pages), spree.admin_pages_path, class: 'nav-link' %>
14
- </li>
15
- <% end %>
16
- <% if can?(:manage, Spree::Post) %>
17
- <li class="nav-item">
18
- <%= active_link_to Spree.t(:posts), spree.admin_posts_path, class: 'nav-link', active: %w[posts post_categories].include?(controller_name) %>
19
- </li>
20
- <% end %>
21
- <% if can?(:manage, current_store) %>
22
- <li class="nav-item">
23
- <%= active_link_to Spree.t(:settings), spree.edit_admin_storefront_path, class: 'nav-link' %>
24
- </li>
25
- <% end %>
26
- </ul>
27
- <% end %>
28
- </li>
5
+ <% if storefront_active %>
6
+ <ul class="ml-4 pl-1 mb-2 nav-submenu mt-1">
7
+ <%= nav_item(Spree.t(:themes), spree.admin_themes_path) %>
8
+
9
+ <% if can?(:manage, Spree::Page) %>
10
+ <%= nav_item(Spree.t(:pages), spree.admin_pages_path) %>
11
+ <% end %>
12
+
13
+ <% if can?(:manage, Spree::Post) %>
14
+ <%= nav_item(Spree.t(:posts), spree.admin_posts_path, active: %w[posts post_categories].include?(controller_name)) %>
15
+ <% end %>
16
+
17
+ <% if can?(:manage, current_store) %>
18
+ <%= nav_item(Spree.t(:settings), spree.edit_admin_storefront_path) %>
19
+ <% end %>
20
+ </ul>
21
+ <% end %>
29
22
  <% end %>
@@ -155,6 +155,6 @@
155
155
  </div>
156
156
  </div>
157
157
  </div>
158
-
159
- <%= render "spree/admin/stores/form/custom", f: f %>
160
158
  </div>
159
+
160
+ <%= render_admin_partials(:store_form_partials, f: f) %>
@@ -1,5 +1,11 @@
1
1
  <% cache variant do %>
2
- <%= link_to spree.edit_admin_product_variant_path(variant.product, variant), id: spree_dom_id(variant), data: { turbo_permanent: true, turbo_frame: :_top }, class: 'd-flex align-items-center justify-content-start text-decoration-none' do %>
2
+ <% if variant.is_master? %>
3
+ <% variant_url = spree.edit_admin_product_path(variant.product) %>
4
+ <% else %>
5
+ <% variant_url = spree.edit_admin_product_variant_path(variant.product, variant) %>
6
+ <% end %>
7
+
8
+ <%= link_to variant_url, id: spree_dom_id(variant), data: { turbo_permanent: true, turbo_frame: :_top }, class: 'd-flex align-items-center justify-content-start text-decoration-none' do %>
3
9
  <%= render 'spree/admin/shared/product_image', object: variant %>
4
10
  <div class="ml-3">
5
11
  <strong><%= variant.name %></strong>
@@ -10,4 +16,4 @@
10
16
  <% end %>
11
17
  </div>
12
18
  <% end %>
13
- <% end %>
19
+ <% end %>
@@ -30,13 +30,13 @@
30
30
  <td><%= price_form.object.currency %></td>
31
31
  <td>
32
32
  <div class="form-control align-items-center py-0 focus-shadow focus-border mr-2 price-input-container d-flex">
33
- <%= price_form.text_field :amount, class: 'form-control-plaintext px-0', disabled: !can?(:manage, price_form.object) %>
33
+ <%= price_form.text_field :amount, class: 'form-control-plaintext px-0', disabled: !can?(:manage, price_form.object), value: price_form.object.amount.present? ? Spree::Money.new(price_form.object.amount, currency: price_form.object.currency, symbol: '').to_s : '' %>
34
34
  <span><%= currency_symbol(price_form.object.currency) %></span>
35
35
  </div>
36
36
  </td>
37
37
  <td>
38
38
  <div class="form-control align-items-center py-0 focus-shadow focus-border mr-2 price-input-container d-flex">
39
- <%= price_form.text_field :compare_at_amount, class: 'form-control-plaintext px-0', disabled: !can?(:manage, price_form.object) %>
39
+ <%= price_form.text_field :compare_at_amount, class: 'form-control-plaintext px-0', disabled: !can?(:manage, price_form.object), value: price_form.object.compare_at_amount.present? ? Spree::Money.new(price_form.object.compare_at_amount, currency: price_form.object.currency, symbol: '').to_s : '' %>
40
40
  <span><%= currency_symbol(price_form.object.currency) %></span>
41
41
  </div>
42
42
  </td>
@@ -45,4 +45,5 @@
45
45
  </tbody>
46
46
  </table>
47
47
  </div>
48
- </div>
48
+ </div>
49
+
@@ -251,54 +251,11 @@ en:
251
251
  stock_locations_link: To add more stock locations please go to <a href="%{link}">Stock Locations</a>
252
252
  total_inventory_html: 'Total inventory at %{stock_location} location: %{count} available'
253
253
  webhooks_subscribers:
254
- addresses: Addresses
255
254
  all_events: All Events
256
- assets: Assets
257
- credit_cards: Credit Cards
258
- customer_returns: Customer Returns
259
- digital_links: Digital Links
260
- digitals: Digitals
261
- inventory_units: Inventory Units
262
- line_items: Line Items
263
255
  new_webhooks_subscriber: New Webhooks Subscriber
264
256
  no_events: No Events
265
- option_types: Option Types
266
- option_values: Option Values
267
- orders: Orders
268
- payment_capture_events: Payment Capture Events
269
- payments: Payments
270
- prices: Prices
271
- products: Products
272
- promotions: Promotions
273
- properties: Properties
274
- prototypes: Prototypes
275
- refunds: Refunds
276
- reimbursements: Reimbursements
277
- return_authorizations: Return Authorizations
278
- return_items: Return Items
279
- roles: Roles
280
257
  select_events: Select events
281
- shipment_transfer:
282
- wrong_destination: Selected location is not a valid destination
283
- shipments: Shipments
284
- shipping_categories: Shipping Categories
285
- shipping_methods: Shipping Methods
286
- shipping_rates: Shipping Rates
287
- stock_items: Stock Items
288
- stock_locations: Stock Locations
289
- stock_movements: Stock Movements
290
- stock_transfers: Stock Transfers
291
- store_credits: Store Credits
292
- stores: Stores
293
258
  subscribe_to_all_events: Subscribe to all events
294
259
  subscriptions: Subscriptions
295
- tax_rates: Tax Rates
296
- taxonomies: Taxonomies
297
- taxons: Taxons
298
260
  time_of_last_event: Time of Last Event
299
- variants: Variants
300
261
  webhooks_events: Webhooks Events
301
- webhooks_subscribers: Webhooks Subscribers
302
- wished_items: Wished Items
303
- wishlists: Wishlists
304
- zones: Zones
@@ -3,6 +3,33 @@ require_relative 'runtime_configuration'
3
3
  module Spree
4
4
  module Admin
5
5
  class Engine < ::Rails::Engine
6
+ Environment = Struct.new(
7
+ :head_partials,
8
+ :body_start_partials,
9
+ :body_end_partials,
10
+ :dashboard_analytics_partials,
11
+ :dashboard_sidebar_partials,
12
+ :product_dropdown_partials,
13
+ :product_form_partials,
14
+ :product_form_sidebar_partials,
15
+ :products_filters_partials,
16
+ :order_page_header_partials,
17
+ :order_page_body_partials,
18
+ :order_page_summary_partials,
19
+ :order_page_sidebar_partials,
20
+ :order_page_dropdown_partials,
21
+ :orders_filters_partials,
22
+ :store_form_partials,
23
+ :store_nav_partials,
24
+ :store_settings_nav_partials,
25
+ :store_orders_nav_partials,
26
+ :store_products_nav_partials
27
+ )
28
+
29
+ # accessible via Rails.application.config.spree_admin
30
+ initializer 'spree.admin.environment', before: :load_config_initializers do |app|
31
+ app.config.spree_admin = Environment.new
32
+ end
6
33
 
7
34
  initializer 'spree.admin.configuration', before: :load_config_initializers do |_app|
8
35
  Spree::Admin::RuntimeConfig = Spree::Admin::RuntimeConfiguration.new
@@ -46,6 +73,29 @@ module Spree
46
73
  end
47
74
  end
48
75
  end
76
+
77
+ config.after_initialize do
78
+ Rails.application.config.spree_admin.head_partials = []
79
+ Rails.application.config.spree_admin.body_start_partials = []
80
+ Rails.application.config.spree_admin.body_end_partials = []
81
+ Rails.application.config.spree_admin.dashboard_analytics_partials = []
82
+ Rails.application.config.spree_admin.dashboard_sidebar_partials = []
83
+ Rails.application.config.spree_admin.product_form_partials = []
84
+ Rails.application.config.spree_admin.product_form_sidebar_partials = []
85
+ Rails.application.config.spree_admin.product_dropdown_partials = []
86
+ Rails.application.config.spree_admin.products_filters_partials = []
87
+ Rails.application.config.spree_admin.order_page_header_partials = []
88
+ Rails.application.config.spree_admin.order_page_body_partials = []
89
+ Rails.application.config.spree_admin.order_page_sidebar_partials = []
90
+ Rails.application.config.spree_admin.order_page_summary_partials = []
91
+ Rails.application.config.spree_admin.order_page_dropdown_partials = []
92
+ Rails.application.config.spree_admin.orders_filters_partials = []
93
+ Rails.application.config.spree_admin.store_form_partials = []
94
+ Rails.application.config.spree_admin.store_nav_partials = []
95
+ Rails.application.config.spree_admin.store_settings_nav_partials = []
96
+ Rails.application.config.spree_admin.store_orders_nav_partials = []
97
+ Rails.application.config.spree_admin.store_products_nav_partials = []
98
+ end
49
99
  end
50
100
  end
51
101
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.rc1
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vendo Connect Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-01 00:00:00.000000000 Z
11
+ date: 2025-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.0.rc1
19
+ version: 5.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 5.0.0.rc1
26
+ version: 5.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: spree_api
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 5.0.0.rc1
33
+ version: 5.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 5.0.0.rc1
40
+ version: 5.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: active_link_to
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -498,6 +498,7 @@ files:
498
498
  - app/views/spree/admin/dashboard/_analytics.html.erb
499
499
  - app/views/spree/admin/dashboard/_setup_progress.html.erb
500
500
  - app/views/spree/admin/dashboard/_setup_tasks.html.erb
501
+ - app/views/spree/admin/dashboard/_sidebar.html.erb
501
502
  - app/views/spree/admin/dashboard/_store_preview.html.erb
502
503
  - app/views/spree/admin/dashboard/_top_products.html.erb
503
504
  - app/views/spree/admin/dashboard/_updater.html.erb
@@ -541,7 +542,6 @@ files:
541
542
  - app/views/spree/admin/orders/_customer.html.erb
542
543
  - app/views/spree/admin/orders/_customer_returns.html.erb
543
544
  - app/views/spree/admin/orders/_customer_summary.html.erb
544
- - app/views/spree/admin/orders/_extra_filters.html.erb
545
545
  - app/views/spree/admin/orders/_filters.html.erb
546
546
  - app/views/spree/admin/orders/_header.html.erb
547
547
  - app/views/spree/admin/orders/_header_custom.html.erb
@@ -740,9 +740,6 @@ files:
740
740
  - app/views/spree/admin/products/edit.html.erb
741
741
  - app/views/spree/admin/products/form/_base.html.erb
742
742
  - app/views/spree/admin/products/form/_categorization.html.erb
743
- - app/views/spree/admin/products/form/_extra_filters.html.erb
744
- - app/views/spree/admin/products/form/_extra_form.html.erb
745
- - app/views/spree/admin/products/form/_extra_form_sidebar.erb
746
743
  - app/views/spree/admin/products/form/_inventory.html.erb
747
744
  - app/views/spree/admin/products/form/_properties.html.erb
748
745
  - app/views/spree/admin/products/form/_shipping.html.erb
@@ -928,7 +925,6 @@ files:
928
925
  - app/views/spree/admin/stores/form/_basic.html.erb
929
926
  - app/views/spree/admin/stores/form/_buttons.html.erb
930
927
  - app/views/spree/admin/stores/form/_checkout.html.erb
931
- - app/views/spree/admin/stores/form/_custom.html.erb
932
928
  - app/views/spree/admin/stores/form/_emails.html.erb
933
929
  - app/views/spree/admin/stores/form/_policies.html.erb
934
930
  - app/views/spree/admin/stores/new.html.erb
@@ -1059,9 +1055,9 @@ licenses:
1059
1055
  - AGPL-3.0-or-later
1060
1056
  metadata:
1061
1057
  bug_tracker_uri: https://github.com/spree/spree/issues
1062
- changelog_uri: https://github.com/spree/spree/releases/tag/v5.0.0.rc1
1058
+ changelog_uri: https://github.com/spree/spree/releases/tag/v5.0.0
1063
1059
  documentation_uri: https://docs.spreecommerce.org/
1064
- source_code_uri: https://github.com/spree/spree/tree/v5.0.0.rc1
1060
+ source_code_uri: https://github.com/spree/spree/tree/v5.0.0
1065
1061
  post_install_message:
1066
1062
  rdoc_options: []
1067
1063
  require_paths:
File without changes
File without changes