spree_admin 5.0.0.rc1 → 5.0.1

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 (161) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/spree/admin/components/_bulk_panel.scss +11 -1
  3. data/app/assets/stylesheets/spree/admin/components/_cards.scss +3 -4
  4. data/app/assets/stylesheets/spree/admin/components/_dropdowns.scss +1 -1
  5. data/app/assets/stylesheets/spree/admin/components/_main.scss +22 -5
  6. data/app/assets/stylesheets/spree/admin/components/_modals.scss +1 -1
  7. data/app/assets/stylesheets/spree/admin/global/_variables.scss +8 -2
  8. data/app/assets/stylesheets/spree/admin/shared/_base.scss +12 -1
  9. data/app/controllers/spree/admin/dashboard_controller.rb +4 -1
  10. data/app/controllers/spree/admin/products_controller.rb +1 -8
  11. data/app/controllers/spree/admin/storefront_controller.rb +1 -1
  12. data/app/controllers/spree/admin/translations_controller.rb +1 -1
  13. data/app/helpers/spree/admin/base_helper.rb +69 -63
  14. data/app/helpers/spree/admin/bulk_operations_helper.rb +86 -0
  15. data/app/helpers/spree/admin/modal_helper.rb +29 -0
  16. data/app/helpers/spree/admin/navigation_helper.rb +89 -11
  17. data/app/helpers/spree/admin/orders_helper.rb +0 -19
  18. data/app/helpers/spree/admin/stores_helper.rb +8 -36
  19. data/app/helpers/spree/admin/webhooks_subscribers_helper.rb +1 -1
  20. data/app/javascript/spree/admin/controllers/variants_form_controller.js +10 -3
  21. data/app/views/active_storage/_upload_form.html.erb +4 -8
  22. data/app/views/layouts/spree/admin.html.erb +4 -0
  23. data/app/views/spree/admin/assets/edit.html.erb +3 -8
  24. data/app/views/spree/admin/coupon_codes/index.html.erb +4 -6
  25. data/app/views/spree/admin/custom_domains/_custom_domains.html.erb +1 -1
  26. data/app/views/spree/admin/custom_domains/index.html.erb +1 -1
  27. data/app/views/spree/admin/customer_returns/index.html.erb +4 -17
  28. data/app/views/spree/admin/dashboard/_setup_progress.html.erb +4 -2
  29. data/app/views/spree/admin/dashboard/_sidebar.html.erb +2 -0
  30. data/app/views/spree/admin/dashboard/_top_products.html.erb +34 -24
  31. data/app/views/spree/admin/dashboard/analytics.html.erb +3 -1
  32. data/app/views/spree/admin/dashboard/show.html.erb +4 -8
  33. data/app/views/spree/admin/digital_assets/_table.html.erb +1 -1
  34. data/app/views/spree/admin/digital_assets/edit.html.erb +3 -11
  35. data/app/views/spree/admin/digital_assets/new.html.erb +3 -11
  36. data/app/views/spree/admin/exports/index.html.erb +22 -24
  37. data/app/views/spree/admin/exports/new.html.erb +3 -9
  38. data/app/views/spree/admin/line_items/new.html.erb +2 -5
  39. data/app/views/spree/admin/oauth_applications/index.html.erb +57 -58
  40. data/app/views/spree/admin/option_types/_filter.html.erb +1 -1
  41. data/app/views/spree/admin/option_types/index.html.erb +7 -11
  42. data/app/views/spree/admin/orders/_customer_summary.html.erb +0 -2
  43. data/app/views/spree/admin/orders/_filters.html.erb +3 -8
  44. data/app/views/spree/admin/orders/_header.html.erb +2 -0
  45. data/app/views/spree/admin/orders/_list.html.erb +2 -4
  46. data/app/views/spree/admin/orders/_summary.html.erb +1 -1
  47. data/app/views/spree/admin/orders/billing_address/create.turbo_stream.erb +3 -6
  48. data/app/views/spree/admin/orders/billing_address/edit.html.erb +3 -6
  49. data/app/views/spree/admin/orders/billing_address/new.html.erb +3 -6
  50. data/app/views/spree/admin/orders/billing_address/update.turbo_stream.erb +3 -6
  51. data/app/views/spree/admin/orders/contact_information/edit.html.erb +3 -6
  52. data/app/views/spree/admin/orders/customer_returns/edit.html.erb +1 -10
  53. data/app/views/spree/admin/orders/edit.html.erb +3 -5
  54. data/app/views/spree/admin/orders/index.html.erb +1 -1
  55. data/app/views/spree/admin/orders/return_authorizations/_form.html.erb +1 -1
  56. data/app/views/spree/admin/orders/return_authorizations/show.html.erb +45 -43
  57. data/app/views/spree/admin/orders/shipping_address/create.turbo_stream.erb +3 -6
  58. data/app/views/spree/admin/orders/shipping_address/edit.html.erb +3 -6
  59. data/app/views/spree/admin/orders/shipping_address/new.html.erb +3 -6
  60. data/app/views/spree/admin/orders/shipping_address/update.turbo_stream.erb +3 -6
  61. data/app/views/spree/admin/pages/_filters.html.erb +1 -1
  62. data/app/views/spree/admin/pages/edit.html.erb +2 -5
  63. data/app/views/spree/admin/pages/index.html.erb +4 -4
  64. data/app/views/spree/admin/payment_methods/index.html.erb +10 -8
  65. data/app/views/spree/admin/post_categories/index.html.erb +4 -6
  66. data/app/views/spree/admin/posts/_filters.html.erb +2 -7
  67. data/app/views/spree/admin/posts/_post.html.erb +1 -11
  68. data/app/views/spree/admin/posts/index.html.erb +5 -9
  69. data/app/views/spree/admin/products/_bulk_operations.html.erb +59 -94
  70. data/app/views/spree/admin/products/_filters.html.erb +13 -8
  71. data/app/views/spree/admin/products/_form.html.erb +3 -3
  72. data/app/views/spree/admin/products/_list.html.erb +2 -10
  73. data/app/views/spree/admin/products/_product.html.erb +1 -4
  74. data/app/views/spree/admin/products/bulk_modal.html.erb +3 -8
  75. data/app/views/spree/admin/products/edit.html.erb +3 -0
  76. data/app/views/spree/admin/products/form/_variants.html.erb +1 -0
  77. data/app/views/spree/admin/products/index.html.erb +5 -5
  78. data/app/views/spree/admin/promotion_actions/new.html.erb +7 -12
  79. data/app/views/spree/admin/promotion_rules/new.html.erb +7 -12
  80. data/app/views/spree/admin/promotions/_filters.html.erb +27 -0
  81. data/app/views/spree/admin/promotions/index.html.erb +7 -35
  82. data/app/views/spree/admin/properties/index.html.erb +10 -9
  83. data/app/views/spree/admin/refund_reasons/index.html.erb +37 -35
  84. data/app/views/spree/admin/refunds/edit.html.erb +3 -8
  85. data/app/views/spree/admin/reimbursement_types/index.html.erb +42 -40
  86. data/app/views/spree/admin/reports/_report.html.erb +1 -1
  87. data/app/views/spree/admin/return_authorization_reasons/index.html.erb +41 -41
  88. data/app/views/spree/admin/return_authorizations/_filters.html.erb +1 -1
  89. data/app/views/spree/admin/return_authorizations/_list.html.erb +1 -10
  90. data/app/views/spree/admin/return_authorizations/index.html.erb +1 -1
  91. data/app/views/spree/admin/roles/_form.html.erb +1 -1
  92. data/app/views/spree/admin/roles/index.html.erb +26 -24
  93. data/app/views/spree/admin/shared/_bulk_modal.html.erb +6 -7
  94. data/app/views/spree/admin/shared/_developers_nav.html.erb +2 -2
  95. data/app/views/spree/admin/shared/_filter_submit.html.erb +6 -0
  96. data/app/views/spree/admin/shared/_head.html.erb +3 -1
  97. data/app/views/spree/admin/shared/_modal.html.erb +2 -8
  98. data/app/views/spree/admin/shared/_multi_product_picker.html.erb +2 -4
  99. data/app/views/spree/admin/shared/_no_resource_found.html.erb +1 -1
  100. data/app/views/spree/admin/shared/_posts_tabs.html.erb +2 -2
  101. data/app/views/spree/admin/shared/_product_image.html.erb +1 -10
  102. data/app/views/spree/admin/shared/_refunds.html.erb +1 -1
  103. data/app/views/spree/admin/shared/_returns_and_refunds_nav.html.erb +3 -3
  104. data/app/views/spree/admin/shared/_shipping_nav.html.erb +2 -2
  105. data/app/views/spree/admin/shared/_stock_nav.html.erb +2 -2
  106. data/app/views/spree/admin/shared/_tax_nav.html.erb +2 -2
  107. data/app/views/spree/admin/shared/_user.html.erb +2 -2
  108. data/app/views/spree/admin/shared/_user_dropdown.html.erb +2 -2
  109. data/app/views/spree/admin/shared/sidebar/_orders_nav.html.erb +19 -29
  110. data/app/views/spree/admin/shared/sidebar/_products_nav.html.erb +6 -25
  111. data/app/views/spree/admin/shared/sidebar/_returns_nav.html.erb +8 -15
  112. data/app/views/spree/admin/shared/sidebar/_store_dropdown.html.erb +36 -7
  113. data/app/views/spree/admin/shared/sidebar/_store_nav.html.erb +28 -52
  114. data/app/views/spree/admin/shared/sidebar/_storefront_nav.html.erb +19 -26
  115. data/app/views/spree/admin/shared/sortable_tree/_taxonomy.html.erb +3 -23
  116. data/app/views/spree/admin/shipping_categories/index.html.erb +28 -26
  117. data/app/views/spree/admin/shipping_methods/_actions.html.erb +1 -1
  118. data/app/views/spree/admin/shipping_methods/index.html.erb +23 -21
  119. data/app/views/spree/admin/stock_items/_filters.html.erb +2 -7
  120. data/app/views/spree/admin/stock_items/index.html.erb +5 -8
  121. data/app/views/spree/admin/stock_locations/_stock_location.html.erb +16 -13
  122. data/app/views/spree/admin/stock_locations/index.html.erb +24 -21
  123. data/app/views/spree/admin/stock_transfers/_filters.html.erb +1 -1
  124. data/app/views/spree/admin/stock_transfers/_new_variant_modal.html.erb +3 -5
  125. data/app/views/spree/admin/stock_transfers/index.html.erb +6 -6
  126. data/app/views/spree/admin/store_credit_categories/_form.html.erb +1 -1
  127. data/app/views/spree/admin/store_credit_categories/edit.html.erb +6 -4
  128. data/app/views/spree/admin/store_credit_categories/index.html.erb +28 -24
  129. data/app/views/spree/admin/store_credits/index.html.erb +2 -2
  130. data/app/views/spree/admin/storefront/edit.html.erb +7 -9
  131. data/app/views/spree/admin/stores/form/_basic.html.erb +2 -2
  132. data/app/views/spree/admin/stores/form/_policies.html.erb +1 -1
  133. data/app/views/spree/admin/stores/new.html.erb +8 -6
  134. data/app/views/spree/admin/tax_categories/index.html.erb +24 -22
  135. data/app/views/spree/admin/tax_rates/index.html.erb +26 -24
  136. data/app/views/spree/admin/taxonomies/index.html.erb +4 -4
  137. data/app/views/spree/admin/taxonomies/show.html.erb +2 -2
  138. data/app/views/spree/admin/themes/_theme_preview_image.html.erb +1 -10
  139. data/app/views/spree/admin/themes/index.html.erb +2 -2
  140. data/app/views/spree/admin/translations/_translations_unavailable.html.erb +6 -8
  141. data/app/views/spree/admin/users/_filters.html.erb +2 -7
  142. data/app/views/spree/admin/users/_tabs.html.erb +4 -4
  143. data/app/views/spree/admin/users/_user.html.erb +1 -4
  144. data/app/views/spree/admin/users/bulk_modal.html.erb +3 -8
  145. data/app/views/spree/admin/users/index.html.erb +25 -58
  146. data/app/views/spree/admin/variants/_variant.html.erb +8 -2
  147. data/app/views/spree/admin/variants/form/_media_asset.html.erb +1 -7
  148. data/app/views/spree/admin/variants/form/_pricing.html.erb +5 -4
  149. data/app/views/spree/admin/webhooks_subscribers/_form.html.erb +1 -1
  150. data/app/views/spree/admin/webhooks_subscribers/index.html.erb +25 -22
  151. data/app/views/spree/admin/webhooks_subscribers/show.html.erb +3 -3
  152. data/app/views/spree/admin/zones/index.html.erb +34 -32
  153. data/config/locales/en.yml +1 -46
  154. data/lib/spree/admin/engine.rb +50 -0
  155. metadata +13 -14
  156. data/app/views/spree/admin/orders/_extra_filters.html.erb +0 -0
  157. data/app/views/spree/admin/products/_empty_list.html.erb +0 -1
  158. data/app/views/spree/admin/products/form/_extra_filters.html.erb +0 -0
  159. data/app/views/spree/admin/products/form/_extra_form.html.erb +0 -0
  160. data/app/views/spree/admin/products/form/_extra_form_sidebar.erb +0 -0
  161. data/app/views/spree/admin/stores/form/_custom.html.erb +0 -0
@@ -3,30 +3,32 @@
3
3
  <% end %>
4
4
 
5
5
  <% content_for :page_actions do %>
6
- <%= button_link_to Spree.t(:new_role), new_object_url, class: "btn-primary", icon: 'plus', id: 'admin_new_role_link' %>
6
+ <%= link_to_with_icon 'plus', Spree.t(:new_role), new_object_url, class: "btn btn-primary" %>
7
7
  <% end if can? :create, Spree::Role %>
8
8
 
9
- <% if @roles.any? %>
10
- <div class="table-responsive card-lg p-0">
11
- <table class="table">
12
- <thead class="text-muted">
13
- <tr>
14
- <th><%= Spree.t(:role_id) %></th>
15
- <th class="actions"></th>
16
- </tr>
17
- </thead>
18
- <tbody>
19
- <% @roles.each do |role| %>
20
- <tr id="<%= spree_dom_id role %>">
21
- <td><%= role.name %></td>
22
- <td class="actions">
23
- <%= link_to_edit(role, no_text: true) if can? :edit, role %>
24
- </td>
9
+ <div class="card-lg">
10
+ <% if @collection.any? %>
11
+ <div class="table-responsive">
12
+ <table class="table">
13
+ <thead class="text-muted">
14
+ <tr>
15
+ <th><%= Spree.t(:role_id) %></th>
16
+ <th></th>
25
17
  </tr>
26
- <% end %>
27
- </tbody>
28
- </table>
29
- </div>
30
- <% else %>
31
- <%= render 'spree/admin/shared/no_resource_found' %>
32
- <% end %>
18
+ </thead>
19
+ <tbody>
20
+ <% @collection.each do |role| %>
21
+ <tr id="<%= spree_dom_id role %>">
22
+ <td><%= role.name %></td>
23
+ <td class="actions">
24
+ <%= link_to_edit(role, no_text: true) if can? :edit, role %>
25
+ </td>
26
+ </tr>
27
+ <% end %>
28
+ </tbody>
29
+ </table>
30
+ </div>
31
+ <% else %>
32
+ <%= render 'spree/admin/shared/no_resource_found' %>
33
+ <% end %>
34
+ </div>
@@ -2,18 +2,17 @@
2
2
  <div class="modal-dialog modal-dialog-centered">
3
3
  <%= turbo_frame_tag :bulk_modal do %>
4
4
  <div class="modal-content">
5
- <div class="modal-header">
6
- <h5 class="modal-title" id="exampleModalLabel"><%= Spree.t(:loading) %>...</h5>
7
- <button type="button" class="btn-close" data-dismiss="modal" aria-label="<%= Spree.t(:close) %>" />
8
- </div>
5
+ <%= modal_header(Spree.t(:loading)) %>
9
6
  <div class="modal-body text-center">
10
7
  <div class="spinner-border text-muted" role="status">
11
8
  <span class="sr-only"><%= Spree.t(:loading) %>...</span>
12
9
  </div>
13
10
  </div>
14
- <div class="modal-footer d-flex justify-content-between">
15
- <button type="button" class="btn btn-light" data-dismiss="modal"><%= Spree.t(:close) %></button>
16
- <button type="button" class="btn btn-primary" disabled="disabled"><%= Spree.t(:save_changes) %></button>
11
+ <div class="modal-footer">
12
+ <%= modal_discard_button %>
13
+ <button type="button" class="btn btn-primary" disabled="disabled">
14
+ <%= Spree.t('actions.save') %>
15
+ </button>
17
16
  </div>
18
17
  </div>
19
18
  <% end %>
@@ -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 %>
@@ -0,0 +1,6 @@
1
+ <div class="form-actions">
2
+ <%= turbo_save_button_tag Spree.t(:filter_results) do %>
3
+ <%= icon("search") %>
4
+ <%= Spree.t(:filter_results) %>
5
+ <% end %>
6
+ </div>
@@ -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) %>
@@ -2,10 +2,7 @@
2
2
  <div class="modal-dialog modal-dialog-centered">
3
3
  <%= turbo_frame_tag :dialog_modal do %>
4
4
  <div class="modal-content">
5
- <div class="modal-header">
6
- <h5 class="modal-title" id="exampleModalLabel"><%= Spree.t(:loading) %>...</h5>
7
- <button type="button" class="btn-close" data-dismiss="modal" aria-label="<%= Spree.t(:close) %>" />
8
- </div>
5
+ <%= modal_header(Spree.t(:loading)) %>
9
6
  <div class="modal-body text-center">
10
7
  <div class="spinner-border text-light mx-auto my-5" role="status">
11
8
  <span class="sr-only"><%= Spree.t(:loading) %>...</span>
@@ -20,10 +17,7 @@
20
17
  <div class="modal-dialog modal-dialog-centered modal-lg">
21
18
  <%= turbo_frame_tag :dialog_modal_lg do %>
22
19
  <div class="modal-content">
23
- <div class="modal-header">
24
- <h5 class="modal-title" id="exampleModalLabel"><%= Spree.t(:loading) %>...</h5>
25
- <button type="button" class="btn-close" data-dismiss="modal" aria-label="<%= Spree.t(:close) %>" />
26
- </div>
20
+ <%= modal_header(Spree.t(:loading)) %>
27
21
  <div class="modal-body text-center" style="min-height: 200px">
28
22
  <div class="spinner-border text-light" role="status">
29
23
  <span class="sr-only"><%= Spree.t(:loading) %>...</span>
@@ -1,9 +1,6 @@
1
1
  <%= turbo_frame_tag :dialog_modal do %>
2
2
  <div class="modal-content" data-controller="search-picker">
3
- <div class="modal-header">
4
- <h5 class="modal-title" id="exampleModalLabel"><%= Spree.t(:add_products) %></h5>
5
- <button type="button" class="btn-close" data-dismiss="modal" aria-label="<%= Spree.t(:close) %>" />
6
- </div>
3
+ <%= modal_header(Spree.t(:add_products)) %>
7
4
  <div class="modal-body border-bottom">
8
5
  <%= form_with url: spree.search_admin_products_path, method: :post, data: { controller: 'auto-submit'} do |form| %>
9
6
  <%= form.hidden_field :omit_ids, value: parent.product_ids.join(',') %>
@@ -19,6 +16,7 @@
19
16
  </div>
20
17
  </div>
21
18
  <div class="modal-footer border-top">
19
+ <%= modal_discard_button %>
22
20
  <%= turbo_save_button_tag Spree.t(:add_selected_products), class: 'btn btn-primary', disabled: true, data: { search_picker_target: :submit } %>
23
21
  </div>
24
22
  <% end %>
@@ -2,5 +2,5 @@
2
2
 
3
3
  <div class="text-muted p-5 d-flex align-items-center w-100 justify-content-center">
4
4
  <%= Spree.t(:no_resource_found, resource: resource_name) %>
5
- <%= link_to_with_icon 'plus', Spree.t(:add_one), new_object_url, class: 'btn btn-light ml-3' if can?(:create, model_class) && defined?(new_object_url) %>
5
+ <%= link_to_with_icon 'plus', Spree.t(:add_one), new_object_url, class: 'btn btn-light ml-3', data: { 'turbo-frame': '_top' } if can?(:create, model_class) && defined?(new_object_url) && new_object_url.present? %>
6
6
  </div>
@@ -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 %>
@@ -5,16 +5,7 @@
5
5
  <% if image.present? && image.attached? && image.variable? %>
6
6
  <% alt ||= image.alt || object.name %>
7
7
  <div class="admin-product-image-container">
8
- <%= image_tag(
9
- main_app.cdn_image_url(
10
- image.variant(
11
- spree_image_variant_options(resize_to_fill: [width * 2, height * 2])
12
- )
13
- ),
14
- width: width,
15
- height: height,
16
- alt: alt
17
- ) %>
8
+ <%= spree_image_tag(image, width: width, height: height, alt: alt) %>
18
9
  </div>
19
10
  <% else %>
20
11
  <%= render 'spree/admin/shared/no_image', width: width, height: height %>
@@ -1,4 +1,4 @@
1
- <div class="table-responsive card-lg p-0">
1
+ <div class="table-responsive card-lg">
2
2
  <table class="table table-condensed" id='refunds' data-order-id='<%= @order.number %>'>
3
3
  <thead class="text-muted">
4
4
  <tr data-hook="refunds_header" class="border-bottom">
@@ -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) %>
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 %>
@@ -1,3 +1,36 @@
1
+ <% if available_stores.count > 1 %>
2
+ <div class="modal fade" id="switch-store-modal" tabindex="-1" role="dialog" aria-labelledby="switchStoreModalLabel" aria-hidden="true">
3
+ <div class="modal-dialog" role="document">
4
+ <div class="modal-content">
5
+ <%= modal_header(icon('switch-horizontal', class: 'mr-2') + Spree.t(:switch_store)) %>
6
+ <div class="modal-body">
7
+ <div class="list-group">
8
+ <% available_stores.each do |store| %>
9
+ <% if store.id != current_store.id %>
10
+ <%= link_to spree.admin_dashboard_url(host: store.url), class: 'list-group-item hover-light d-flex text-dark w-100 align-items-center text-primary' do %>
11
+ <%= store_admin_icon(current_store, height: 32, width: 32) %>
12
+ <span class="ml-3">
13
+ <%= store.name %>
14
+ </span>
15
+ <% end %>
16
+ <% else %>
17
+ <div class="list-group-item d-flex text-dark w-100 align-items-center cursor-disabled active">
18
+ <%= store_admin_icon(current_store, height: 32, width: 32) %>
19
+ <span class="ml-3">
20
+ <%= store.name %>
21
+ </span>
22
+
23
+ <%= icon('check', class: 'ml-auto') %>
24
+ </div>
25
+ <% end %>
26
+ <% end %>
27
+ </div>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ <% end %>
33
+
1
34
  <div class="border-bottom border-bottom-dashed pb-2 d-flex align-items-center justify-content-between pr-1" id="store-menu" data-turbo-permanent>
2
35
  <div class="dropdown">
3
36
  <button type="button" class="btn d-flex align-items-center justify-content-between text-left dropdown-toggle d-flex align-items-center gap-2"
@@ -18,15 +51,11 @@
18
51
  <% end if current_store.default_theme && can?(:manage, Spree::Theme) %>
19
52
 
20
53
  <% if available_stores.count > 1 %>
21
- <div class="dropdown-header">
54
+ <div class="dropdown-divider"></div>
55
+ <%= link_to "#", class: 'dropdown-item mb-0', data: { toggle: 'modal', target: '#switch-store-modal' } do %>
56
+ <%= icon 'switch-horizontal' %>
22
57
  <%= Spree.t(:switch_store) %>
23
- </div>
24
- <% available_stores.each do |store| %>
25
- <% next if store.id == current_store.id %>
26
- <%= link_to store.name, spree.admin_dashboard_url(host: store.url), class: 'dropdown-item' %>
27
58
  <% end %>
28
-
29
- <div class="dropdown-divider"></div>
30
59
  <% end %>
31
60
  </div>
32
61
  </div>
@@ -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' %>
@@ -105,6 +77,10 @@
105
77
  <%= active_link_to spree.admin_getting_started_path, class: 'nav-link' do %>
106
78
  <%= icon 'map' %>
107
79
  <%= Spree.t('admin.getting_started') %>
80
+
81
+ <span class="badge ml-auto badge-info">
82
+ <%= current_store.setup_tasks_done %><span class="opacity-50">/<%= current_store.setup_tasks_total %></span>
83
+ </span>
108
84
  <% end %>
109
85
  </li>
110
86
  <% end %>
@@ -159,18 +135,18 @@
159
135
 
160
136
  <%= render 'spree/admin/shared/sidebar/custom_nav' %>
161
137
 
138
+ <%= render_admin_partials(:store_nav_partials) %>
139
+
162
140
  <li class="nav-item border-top border-top-dashed my-1"></li>
163
141
  <%= render 'spree/admin/shared/sidebar/storefront_nav' %>
164
142
  <%= render 'spree/admin/shared/sidebar/integrations_nav' %>
165
143
 
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>
144
+ <% if can?(:manage, current_store) %>
145
+ <li class="nav-item border-top border-top-dashed my-1"></li>
146
+ <%= nav_item(Spree.t(:settings), spree.edit_admin_store_path(section: 'general-settings'), icon: 'settings', active: params[:section] == 'general-settings') %>
147
+ <% end %>
170
148
  <% 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>
149
+ <%= nav_item(Spree.t(:account_members), main_app.account_members_path(current_account), icon: 'users') %>
174
150
  <% end %>
175
151
  </ul>
176
152
  <% end %>