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
@@ -24,51 +24,53 @@ locals: {
24
24
  </div>
25
25
  <% end %>
26
26
 
27
- <div class="table-responsive card-lg p-0 mb-4">
28
- <table class="table table-condensed return-items-table">
29
- <thead class="text-muted">
30
- <tr>
31
- <th><%= Spree.t(:product) %></th>
32
- <th><%= Spree.t(:status) %></th>
33
- <th><%= Spree.t(:purchased_quantity) %></th>
34
- <th><%= Spree.t(:return_quantity) %></th>
35
- <th><%= Spree.t(:total) %></th>
36
- <th><%= Spree.t(:refund_amount) %></th>
37
- <th><%= Spree.t(:reimbursement_type) %></th>
38
- <th><%= Spree.t(:exchange_for) %></th>
39
- </tr>
40
- </thead>
41
- <tbody>
42
- <% @return_authorization.return_items.each do |return_item| %>
27
+ <div class="card-lg mb-4">
28
+ <div class="table-responsive">
29
+ <table class="table table-condensed return-items-table">
30
+ <thead class="text-muted">
43
31
  <tr>
44
- <td>
45
- <div class="variant-name">
46
- <%= link_to return_item.inventory_unit.variant.name,
47
- spree.edit_admin_product_path(return_item.inventory_unit.variant.product) %>
48
- </div>
49
- <div class="variant-options"><%= return_item.inventory_unit.variant.options_text %></div>
50
- </td>
51
- <td><%= return_item.inventory_unit.state.humanize %></td>
52
- <td class="purchased-quantity">
53
- <%= return_item.line_item.quantity %>
54
- </td>
55
- <td><%= return_item.return_quantity %></td>
56
- <td><%= return_item.pre_tax_amount %></td>
57
- <td><%= return_item.display_total %></td>
58
- <td><%= if return_item.preferred_reimbursement_type.present?
59
- return_item.preferred_reimbursement_type.name.humanize
60
- else
61
- "-"
62
- end %></td>
63
- <td><%= if return_item.exchange_processed?
64
- return_item.exchange_variant.exchange_name
65
- else
66
- "-"
67
- end %></td>
32
+ <th><%= Spree.t(:product) %></th>
33
+ <th><%= Spree.t(:status) %></th>
34
+ <th><%= Spree.t(:purchased_quantity) %></th>
35
+ <th><%= Spree.t(:return_quantity) %></th>
36
+ <th><%= Spree.t(:total) %></th>
37
+ <th><%= Spree.t(:refund_amount) %></th>
38
+ <th><%= Spree.t(:reimbursement_type) %></th>
39
+ <th><%= Spree.t(:exchange_for) %></th>
68
40
  </tr>
69
- <% end %>
70
- </tbody>
71
- </table>
41
+ </thead>
42
+ <tbody>
43
+ <% @return_authorization.return_items.each do |return_item| %>
44
+ <tr>
45
+ <td>
46
+ <div class="variant-name">
47
+ <%= link_to return_item.inventory_unit.variant.name,
48
+ spree.edit_admin_product_path(return_item.inventory_unit.variant.product) %>
49
+ </div>
50
+ <div class="variant-options"><%= return_item.inventory_unit.variant.options_text %></div>
51
+ </td>
52
+ <td><%= return_item.inventory_unit.state.humanize %></td>
53
+ <td class="purchased-quantity">
54
+ <%= return_item.line_item.quantity %>
55
+ </td>
56
+ <td><%= return_item.return_quantity %></td>
57
+ <td><%= return_item.pre_tax_amount %></td>
58
+ <td><%= return_item.display_total %></td>
59
+ <td><%= if return_item.preferred_reimbursement_type.present?
60
+ return_item.preferred_reimbursement_type.name.humanize
61
+ else
62
+ "-"
63
+ end %></td>
64
+ <td><%= if return_item.exchange_processed?
65
+ return_item.exchange_variant.exchange_name
66
+ else
67
+ "-"
68
+ end %></td>
69
+ </tr>
70
+ <% end %>
71
+ </tbody>
72
+ </table>
73
+ </div>
72
74
  </div>
73
75
 
74
76
  <% if @return_authorization.reason.present? %>
@@ -1,15 +1,12 @@
1
1
  <%= turbo_stream.update :dialog_modal do %>
2
2
  <%= form_for @address, url: spree.admin_order_shipping_address_path(@order), data: {turbo_frame: :_top}, method: :post do |f| %>
3
3
  <div class="modal-content">
4
- <div class="modal-header">
5
- <h5 class="modal-title" id="exampleModalLabel"><%= Spree.t(:new_shipping_address) %></h5>
6
- <button type="button" class="btn-close" data-dismiss="modal" aria-label="<%= Spree.t(:close) %>" ></button>
7
- </div>
4
+ <%= modal_header(Spree.t(:new_shipping_address)) %>
8
5
  <div class="modal-body d-flex flex-col gap-3">
9
6
  <%= render 'form', address: @address, f: f%>
10
7
  </div>
11
- <div class="modal-footer d-flex justify-content-between">
12
- <button type="button" class="btn btn-light" data-dismiss="modal"><%= Spree.t('actions.discard') %></button>
8
+ <div class="modal-footer">
9
+ <%= modal_discard_button %>
13
10
  <%= turbo_save_button_tag Spree.t('actions.save') %>
14
11
  </div>
15
12
  </div>
@@ -1,15 +1,12 @@
1
1
  <%= turbo_frame_tag :dialog_modal do %>
2
2
  <%= form_for @address, url: spree.admin_order_shipping_address_path(@order), data: {controller: 'auto-submit', form_target: 'form', turbo_frame: :_top}, method: :put do |f| %>
3
3
  <div class="modal-content">
4
- <div class="modal-header">
5
- <h5 class="modal-title" id="exampleModalLabel"><%= Spree.t(:update_shipping_address) %></h5>
6
- <button type="button" class="btn-close" data-dismiss="modal" aria-label="<%= Spree.t(:close) %>" ></button>
7
- </div>
4
+ <%= modal_header(Spree.t(:update_shipping_address)) %>
8
5
  <div class="modal-body d-flex flex-col gap-3">
9
6
  <%= render 'form', address: @address, f: f %>
10
7
  </div>
11
- <div class="modal-footer d-flex justify-content-between">
12
- <button type="button" class="btn btn-light" data-dismiss="modal"><%= Spree.t('actions.discard') %></button>
8
+ <div class="modal-footer">
9
+ <%= modal_discard_button %>
13
10
  <%= turbo_save_button_tag Spree.t('actions.update') %>
14
11
  </div>
15
12
  </div>
@@ -1,15 +1,12 @@
1
1
  <%= turbo_frame_tag :dialog_modal do %>
2
2
  <%= form_for @address, url: spree.admin_order_shipping_address_path(@order), data: {turbo_frame: :_top}, method: :post do |f| %>
3
3
  <div class="modal-content">
4
- <div class="modal-header">
5
- <h5 class="modal-title" id="exampleModalLabel"><%= Spree.t(:new_shipping_address) %></h5>
6
- <button type="button" class="btn-close" data-dismiss="modal" aria-label="<%= Spree.t(:close) %>" ></button>
7
- </div>
4
+ <%= modal_header(Spree.t(:new_shipping_address)) %>
8
5
  <div class="modal-body d-flex flex-col gap-3">
9
6
  <%= render 'form', address: @address, f: f%>
10
7
  </div>
11
- <div class="modal-footer d-flex justify-content-between">
12
- <button type="button" class="btn btn-light" data-dismiss="modal"><%= Spree.t('actions.discard') %></button>
8
+ <div class="modal-footer">
9
+ <%= modal_discard_button %>
13
10
  <%= turbo_save_button_tag Spree.t('actions.save') %>
14
11
  </div>
15
12
  </div>
@@ -1,15 +1,12 @@
1
1
  <%= turbo_stream.update :dialog_modal do %>
2
2
  <%= form_for @address, url: spree.admin_order_shipping_address_path(@order), data: {controller: 'auto-submit', form_target: 'form', turbo_frame: :_top}, method: :put do |f| %>
3
3
  <div class="modal-content">
4
- <div class="modal-header">
5
- <h5 class="modal-title" id="exampleModalLabel"><%= Spree.t(:update_shipping_address) %></h5>
6
- <button type="button" class="btn-close" data-dismiss="modal" aria-label="<%= Spree.t(:close) %>" ></button>
7
- </div>
4
+ <%= modal_header(Spree.t(:update_shipping_address)) %>
8
5
  <div class="modal-body d-flex flex-col gap-3">
9
6
  <%= render 'form', address: @address, f: f %>
10
7
  </div>
11
- <div class="modal-footer d-flex justify-content-between">
12
- <button type="button" class="btn btn-light" data-dismiss="modal"><%= Spree.t('actions.discard') %></button>
8
+ <div class="modal-footer">
9
+ <%= modal_discard_button %>
13
10
  <%= turbo_save_button_tag Spree.t('actions.update') %>
14
11
  </div>
15
12
  </div>
@@ -1,4 +1,4 @@
1
- <%= search_form_for [:admin, @search], url: spree.admin_pages_path , class: "filter-wrap border-bottom", data: {controller: "filters reveal", reveal_hidden_class: "d-none"} do |f| %>
1
+ <%= search_form_for [:admin, @search], url: spree.admin_pages_path , class: "filter-wrap", data: {controller: "filters reveal", reveal_hidden_class: "d-none"} do |f| %>
2
2
  <%= render 'spree/admin/shared/filters_search_bar', param: :name_cont, label: Spree.t(:name) %>
3
3
 
4
4
  <%= render "spree/admin/shared/filter_badge_template" %>
@@ -1,15 +1,12 @@
1
1
  <%= turbo_frame_tag :dialog_modal do %>
2
2
  <%= form_with model: @page, url: spree.admin_page_path(@page), data: { controller: 'slug-form seo-form' }, scope: :page do |f| %>
3
3
  <div class="modal-content">
4
- <div class="modal-header">
5
- <h5 class="modal-title" id="exampleModalLabel"><%= Spree.t(:page_settings) %></h5>
6
- <button type="button" class="btn-close" data-dismiss="modal" aria-label="<%= Spree.t(:close) %>"></button>
7
- </div>
4
+ <%= modal_header(Spree.t(:page_settings)) %>
8
5
  <div class="modal-body">
9
6
  <%= render 'spree/admin/shared/error_messages', target: @page %>
10
7
  <%= render 'form', f: f, vertical: true %>
11
8
  </div>
12
- <div class="modal-footer d-flex justify-content-between">
9
+ <div class="modal-footer">
13
10
  <%= turbo_save_button_tag Spree.t('actions.save'), data: {turbo_frame: :_top} %>
14
11
  <%= link_to Spree.t('actions.destroy'), spree.admin_page_path(@page.id), data: { turbo_method: :delete, turbo_frame: '_top', turbo_confirm: Spree.t(:are_you_sure )}, class: 'btn btn-danger' %>
15
12
  </div>
@@ -5,9 +5,9 @@
5
5
  <%= link_to_with_icon 'plus', Spree.t(:add_new_page), spree.new_admin_page_path, class: "btn btn-primary" if can?(:create, Spree::Page.new) %>
6
6
  <% end %>
7
7
 
8
- <div class="card-lg p-0">
8
+ <div class="card-lg">
9
9
  <%= render "spree/admin/pages/filters" %>
10
- <% if @pages.any? %>
10
+ <% if @collection.any? %>
11
11
  <div class="table-responsive">
12
12
  <table class="table">
13
13
  <thead class="text-muted">
@@ -17,10 +17,10 @@
17
17
  </tr>
18
18
  </thead>
19
19
  <tbody>
20
- <%= render collection: @pages, partial: "spree/admin/pages/page", cached: spree_base_cache_scope %>
20
+ <%= render collection: @collection, partial: "spree/admin/pages/page", cached: spree_base_cache_scope %>
21
21
  </tbody>
22
22
  </table>
23
- <%= render partial: "spree/admin/shared/index_table_options", locals: { collection: @pages } %>
23
+ <%= render "spree/admin/shared/index_table_options", collection: @collection %>
24
24
  </div>
25
25
  <% else %>
26
26
  <%= render 'spree/admin/shared/no_resource_found' %>
@@ -2,15 +2,16 @@
2
2
  <%= Spree.t(:payment_methods) %>
3
3
  <% end %>
4
4
 
5
- <div class="table-responsive card-lg p-0 mb-4">
6
- <table class="table" id='listing_shipping_methods'>
7
- <thead class="text-muted">
5
+ <div class="card-lg">
6
+ <div class="table-responsive">
7
+ <table class="table">
8
+ <thead class="text-muted">
8
9
  <tr>
9
10
  <th></th>
10
11
  <th><%= Spree.t(:payment_method) %></th>
11
12
  <th><%= Spree.t(:visibility) %></th>
12
13
  <th class="text-center"><%= Spree.t(:active) %></th>
13
- <th class="actions"></th>
14
+ <th></th>
14
15
  </tr>
15
16
  </thead>
16
17
  <tbody data-controller="sortable" data-sortable-handle-value=".move-handle" data-sortable-resource-name-value="payment_method" data-sortable-response-kind-value="turbo-stream">
@@ -21,13 +22,14 @@
21
22
 
22
23
  <% if available_payment_methods.present? && can?(:create, Spree::PaymentMethod) %>
23
24
  <h5 class="pb-2 pt-3">Available Payment Methods</h5>
24
- <div class="table-responsive card-lg p-0">
25
- <table class="table" id='listing_shipping_methods'>
26
- <thead class="text-muted">
25
+ <div class="card-lg">
26
+ <div class="table-responsive">
27
+ <table class="table">
28
+ <thead class="text-muted">
27
29
  <tr>
28
30
  <th><%= Spree.t(:name) %></th>
29
31
  <th><%= Spree.t(:description) %></th>
30
- <th class="actions"></th>
32
+ <th></th>
31
33
  </tr>
32
34
  </thead>
33
35
  <tbody>
@@ -4,8 +4,8 @@
4
4
 
5
5
  <%= render 'spree/admin/shared/posts_tabs' %>
6
6
 
7
- <% if @post_categories.any? %>
8
- <div class="card-lg p-0">
7
+ <% if @collection.any? %>
8
+ <div class="card-lg">
9
9
  <div class="table-responsive rounded-lg">
10
10
  <table class="table">
11
11
  <thead class="text-muted">
@@ -15,13 +15,11 @@
15
15
  </tr>
16
16
  </thead>
17
17
  <tbody>
18
- <%= render partial: 'spree/admin/post_categories/post_category', collection: @post_categories, cached: spree_base_cache_scope %>
18
+ <%= render collection: @collection, partial: 'spree/admin/post_categories/post_category', cached: spree_base_cache_scope %>
19
19
  </tbody>
20
20
  </table>
21
21
  </div>
22
22
  </div>
23
23
  <% else %>
24
- <div class="text-muted p-5 d-flex align-items-center w-100 justify-content-center">
25
- <%= Spree.t(:no_resource_found, resource: Spree.t(:post_categories)) %>
26
- </div>
24
+ <%= render 'spree/admin/shared/no_resource_found' %>
27
25
  <% end %>
@@ -1,4 +1,4 @@
1
- <%= search_form_for [:admin, @search], class: "filter-wrap border-bottom", data: {controller: "filters reveal", reveal_hidden_class: "d-none"} do |f| %>
1
+ <%= search_form_for [:admin, @search], class: "filter-wrap", data: {controller: "filters reveal", reveal_hidden_class: "d-none"} do |f| %>
2
2
  <div class="d-flex flex-column flex-lg-row gap-2">
3
3
  <%= render 'spree/admin/shared/filters_search_bar', param: :search_by_title, label: Spree.t(:title) %>
4
4
 
@@ -26,12 +26,7 @@
26
26
  </div>
27
27
  </div>
28
28
  </div>
29
- <div class="form-actions">
30
- <%= turbo_save_button_tag Spree.t(:filter_results) do %>
31
- <%= icon("search") %>
32
- <%= Spree.t(:filter_results) %>
33
- <% end %>
34
- </div>
29
+ <%= render 'spree/admin/shared/filter_submit' %>
35
30
  </div>
36
31
 
37
32
  <%= render "spree/admin/shared/filter_badge_template" %>
@@ -3,17 +3,7 @@
3
3
  <%= link_to spree.edit_admin_post_path(post), class: 'text-decoration-none d-flex align-items-center font-weight-bold text-dark gap-3', data: { row_link_target: :link, 'turbo-frame': '_top' } do %>
4
4
  <% if post.image.attached? && post.image.variable? %>
5
5
  <div class="admin-product-image-container">
6
- <%= image_tag(
7
- main_app.cdn_image_url(
8
- post.image.variant(
9
- spree_image_variant_options(resize_to_fill: [200, 130])
10
- )
11
- ),
12
- class: 'img-fluid',
13
- loading: :lazy,
14
- width: 100,
15
- height: 65
16
- ) %>
6
+ <%= spree_image_tag(post.image, width: 100, height: 65, class: 'img-fluid', loading: :lazy) %>
17
7
  </div>
18
8
  <% else %>
19
9
  <%= render 'spree/admin/shared/no_image', width: 100, height: 65 %>
@@ -6,10 +6,9 @@
6
6
 
7
7
  <%= render 'spree/admin/shared/posts_tabs' %>
8
8
 
9
- <div class="card-lg p-0">
9
+ <div class="card-lg">
10
10
  <%= render "spree/admin/posts/filters" %>
11
-
12
- <% if @posts.any? %>
11
+ <% if @collection.any? %>
13
12
  <div class="table-responsive rounded-lg">
14
13
  <table class="table">
15
14
  <thead class="text-muted">
@@ -22,15 +21,12 @@
22
21
  </tr>
23
22
  </thead>
24
23
  <tbody>
25
- <%= render partial: "spree/admin/posts/post", collection: @posts, cached: spree_base_cache_scope %>
24
+ <%= render collection: @collection, partial: "spree/admin/posts/post", cached: spree_base_cache_scope %>
26
25
  </tbody>
27
26
  </table>
28
27
  </div>
29
-
30
- <%= render partial: "spree/admin/shared/index_table_options", locals: { collection: @posts } %>
28
+ <%= render "spree/admin/shared/index_table_options", collection: @collection %>
31
29
  <% else %>
32
- <div class="text-muted p-5 d-flex align-items-center w-100 justify-content-center">
33
- <%= Spree.t(:no_resource_found, resource: Spree.t(:posts)) %>
34
- </div>
30
+ <%= render 'spree/admin/shared/no_resource_found' %>
35
31
  <% end %>
36
32
  </div>
@@ -1,35 +1,22 @@
1
1
  <div id="bulk-panel" class="d-none" data-bulk-operation-target="panel">
2
- <div
3
- class="
4
- bulk-panel-container animate__animated animate__bounceInUp animate__faster
5
- "
6
- >
7
- <div data-toggle="modal" data-target="#bulk-modal">
8
- <% if can?(:activate, Spree::Product) %>
9
- <a
10
- href="<%= spree.bulk_modal_admin_products_path(kind: :set_status, status: :active) %>"
11
- data-turbo-frame="bulk_modal"
12
- class="btn btn-light mr-2 d-vendor"
13
- data-action="click->bulk-operation#setBulkAction"
14
- data-url="<%= spree.bulk_status_update_admin_products_path(status: :active) %>"
15
- >
16
- <%= icon("circle-check") %>
17
- <%= Spree.t("admin.bulk_ops.products.title.set_status", status: :active) %>
18
- </a>
19
- <% end %>
20
- <a
21
- href="<%= spree.bulk_modal_admin_products_path(kind: :set_status, status: :draft) %>"
22
- data-turbo-frame="bulk_modal"
23
- class="btn btn-light mr-2"
24
- data-action="click->bulk-operation#setBulkAction"
25
- data-url="<%= spree.bulk_status_update_admin_products_path(status: :draft) %>"
26
- >
27
- <%= icon("circle-dotted") %>
28
- <%= Spree.t("admin.bulk_ops.products.title.set_status", status: :draft) %>
29
- </a>
30
- </div>
2
+ <div class="bulk-panel-container">
3
+ <% if can?(:activate, Spree::Product) %>
4
+ <%= bulk_action_link(
5
+ Spree.t("admin.bulk_ops.products.title.set_status", status: :active),
6
+ spree.bulk_modal_admin_products_path(kind: :set_status, status: :active),
7
+ icon: "circle-check",
8
+ url: spree.bulk_status_update_admin_products_path(status: :active)
9
+ ) %>
10
+ <% end %>
11
+
12
+ <%= bulk_action_link(
13
+ Spree.t("admin.bulk_ops.products.title.set_status", status: :draft),
14
+ spree.bulk_modal_admin_products_path(kind: :set_status, status: :draft),
15
+ icon: "circle-dotted",
16
+ url: spree.bulk_status_update_admin_products_path(status: :draft)
17
+ ) %>
31
18
 
32
- <div class="dropdown dropup mr-3 ml-1" role="group">
19
+ <div class="dropdown dropup" role="group">
33
20
  <button
34
21
  type="button"
35
22
  data-display="static"
@@ -43,80 +30,58 @@
43
30
  <div
44
31
  class="dropdown-menu dropdown-menu-left"
45
32
  aria-labelledby="btnGroupDrop1"
46
- data-toggle="modal"
47
- data-target="#bulk-modal"
48
33
  >
49
- <a
50
- href="<%= spree.bulk_modal_admin_products_path(kind: :set_status, status: :archived) %>"
51
- data-turbo-frame="bulk_modal"
52
- class="dropdown-item"
53
- data-action="click->bulk-operation#setBulkAction"
54
- data-url="<%= spree.bulk_status_update_admin_products_path(status: :archived) %>"
55
- >
56
- <%= icon("archive") %>
57
- <%= Spree.t("admin.bulk_ops.products.title.set_status", status: :archived) %>
58
- </a>
34
+ <%= bulk_action_link(
35
+ Spree.t("admin.bulk_ops.products.title.set_status", status: :archived),
36
+ spree.bulk_modal_admin_products_path(kind: :set_status, status: :archived),
37
+ icon: "archive",
38
+ url: spree.bulk_status_update_admin_products_path(status: :archived),
39
+ class: "dropdown-item"
40
+ ) %>
41
+
59
42
  <% if can?(:manage, Spree::Classification) %>
60
43
  <div class="dropdown-divider"></div>
61
- <a
62
- href="<%= spree.bulk_modal_admin_products_path(kind: :add_to_taxons) %>"
63
- data-turbo-frame="bulk_modal"
64
- class="dropdown-item"
65
- data-action="click->bulk-operation#setBulkAction"
66
- data-url="<%= spree.bulk_add_to_taxons_admin_products_path %>"
67
- >
68
- <%= icon("category-plus") %>
69
- <%= Spree.t("admin.bulk_ops.products.title.add_to_taxons") %>
70
- </a>
71
- <a
72
- href="<%= spree.bulk_modal_admin_products_path(kind: :remove_from_taxons) %>"
73
- data-turbo-frame="bulk_modal"
74
- class="dropdown-item"
75
- data-action="click->bulk-operation#setBulkAction"
76
- data-url="<%= spree.bulk_remove_from_taxons_admin_products_path %>"
77
- >
78
- <%= icon("category-minus") %>
79
- <%= Spree.t("admin.bulk_ops.products.title.remove_from_taxons") %>
80
- </a>
44
+
45
+ <%= bulk_action_link(
46
+ Spree.t("admin.bulk_ops.products.title.add_to_taxons"),
47
+ spree.bulk_modal_admin_products_path(kind: :add_to_taxons),
48
+ icon: "category-plus",
49
+ url: spree.bulk_add_to_taxons_admin_products_path,
50
+ class: "dropdown-item"
51
+ ) %>
52
+
53
+ <%= bulk_action_link(
54
+ Spree.t("admin.bulk_ops.products.title.remove_from_taxons"),
55
+ spree.bulk_modal_admin_products_path(kind: :remove_from_taxons),
56
+ icon: "category-minus",
57
+ url: spree.bulk_remove_from_taxons_admin_products_path,
58
+ class: "dropdown-item"
59
+ ) %>
81
60
  <% end %>
82
61
 
83
62
  <% if can?(:manage_tags, Spree::Product) %>
84
63
  <div class="dropdown-divider"></div>
85
- <a
86
- href="<%= spree.bulk_modal_admin_products_path(kind: :add_tags) %>"
87
- data-turbo-frame="bulk_modal"
88
- class="dropdown-item"
89
- data-action="click->bulk-operation#setBulkAction"
90
- data-url="<%= spree.bulk_add_tags_admin_products_path %>"
91
- >
92
- <%= icon("tag-plus") %>
93
- <%= Spree.t("admin.bulk_ops.products.title.add_tags") %>
94
- </a>
95
- <a
96
- href="<%= spree.bulk_modal_admin_products_path(kind: :remove_tags) %>"
97
- data-turbo-frame="bulk_modal"
98
- class="dropdown-item"
99
- data-action="click->bulk-operation#setBulkAction"
100
- data-url="<%= spree.bulk_remove_tags_admin_products_path %>"
101
- >
102
- <%= icon("tag-minus") %>
103
- <%= Spree.t("admin.bulk_ops.products.title.remove_tags") %>
104
- </a>
64
+
65
+ <%= bulk_action_link(
66
+ Spree.t("admin.bulk_ops.products.title.add_tags"),
67
+ spree.bulk_modal_admin_products_path(kind: :add_tags),
68
+ icon: "tag-plus",
69
+ url: spree.bulk_add_tags_admin_products_path,
70
+ class: "dropdown-item"
71
+ ) %>
72
+
73
+ <%= bulk_action_link(
74
+ Spree.t("admin.bulk_ops.products.title.remove_tags"),
75
+ spree.bulk_modal_admin_products_path(kind: :remove_tags),
76
+ icon: "tag-minus",
77
+ url: spree.bulk_remove_tags_admin_products_path,
78
+ class: "dropdown-item"
79
+ ) %>
105
80
  <% end %>
106
81
  </div>
107
82
  </div>
108
83
 
109
- <span>
110
- <strong data-bulk-operation-target="counter"></strong>
111
- <%= Spree.t("admin.products.selected") %>
112
- </span>
113
-
114
- <button
115
- type="button"
116
- class="btn-close ml-2"
117
- data-dismiss="modal"
118
- aria-label="<%= Spree.t(:close) %>"
119
- data-action="bulk-operation#cancel"
120
- />
84
+ <%= bulk_operations_counter %>
85
+ <%= bulk_operations_close_button %>
121
86
  </div>
122
87
  </div>
@@ -1,4 +1,14 @@
1
- <%= search_form_for product_list_filters_search_form_path, class: "filter-wrap border-bottom", data: {controller: "filters reveal", reveal_hidden_class: "d-none"} do |f| %>
1
+ <% frame_name ||= nil %>
2
+
3
+ <%= search_form_for product_list_filters_search_form_path,
4
+ class: "filter-wrap",
5
+ data: {
6
+ controller: "filters reveal",
7
+ reveal_hidden_class: "d-none",
8
+ filters_url_value: request.url
9
+ } do |f| %>
10
+ <%= hidden_field_tag :frame_name, frame_name if frame_name.present? %>
11
+
2
12
  <div class="d-flex flex-column flex-lg-row gap-2">
3
13
  <%= render 'spree/admin/shared/filters_search_bar', param: :multi_search %>
4
14
 
@@ -43,15 +53,10 @@
43
53
  } %>
44
54
  </div>
45
55
  </div>
46
- <%= render partial: "spree/admin/products/form/extra_filters", locals: { f: f } %>
56
+ <%= render_admin_partials(:products_filters_partials, f: f) %>
47
57
  </div>
48
58
 
49
- <div class="form-actions">
50
- <%= turbo_save_button_tag Spree.t(:filter_results) do %>
51
- <%= icon("search") %>
52
- <%= Spree.t(:filter_results) %>
53
- <% end %>
54
- </div>
59
+ <%= render 'spree/admin/shared/filter_submit' %>
55
60
  </div>
56
61
 
57
62
  <%= render "spree/admin/shared/filter_badge_template" %>
@@ -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,
@@ -9,15 +9,7 @@
9
9
  <thead class="text-muted">
10
10
  <tr>
11
11
  <th scope="col" class="pr-0 w-5">
12
- <div class="custom-control custom-checkbox ml-1">
13
- <input
14
- type="checkbox"
15
- class="custom-control-input"
16
- id="checkAllMasterCheckbox"
17
- data-bulk-operation-target="checkboxAll"
18
- >
19
- <label class="custom-control-label" for="checkAllMasterCheckbox"><span></span></label>
20
- </div>
12
+ <%= bulk_operations_select_all_checkbox %>
21
13
  </th>
22
14
  <th scope="col">
23
15
  <%= sort_link @search,
@@ -46,5 +38,5 @@
46
38
  </div>
47
39
  <%= render partial: 'spree/admin/shared/index_table_options', locals: { collection: @collection } %>
48
40
  <% else %>
49
- <%= render partial: 'spree/admin/products/empty_list' %>
41
+ <%= render 'spree/admin/shared/no_resource_found' %>
50
42
  <% end %>