spree_admin 5.0.0 → 5.0.2

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 (140) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/spree/admin/components/_alerts.scss +6 -3
  3. data/app/assets/stylesheets/spree/admin/components/_bulk_panel.scss +11 -1
  4. data/app/assets/stylesheets/spree/admin/components/_cards.scss +3 -4
  5. data/app/assets/stylesheets/spree/admin/components/_dropdowns.scss +1 -1
  6. data/app/assets/stylesheets/spree/admin/components/_main.scss +8 -1
  7. data/app/assets/stylesheets/spree/admin/components/_modals.scss +1 -1
  8. data/app/assets/stylesheets/spree/admin/global/_variables.scss +12 -6
  9. data/app/assets/stylesheets/spree/admin/shared/_base.scss +3 -5
  10. data/app/controllers/spree/admin/posts_controller.rb +6 -0
  11. data/app/controllers/spree/admin/products_controller.rb +7 -8
  12. data/app/controllers/spree/admin/storefront_controller.rb +1 -1
  13. data/app/controllers/spree/admin/translations_controller.rb +1 -1
  14. data/app/controllers/spree/admin/users_controller.rb +1 -1
  15. data/app/helpers/spree/admin/base_helper.rb +49 -57
  16. data/app/helpers/spree/admin/bulk_operations_helper.rb +86 -0
  17. data/app/helpers/spree/admin/modal_helper.rb +29 -0
  18. data/app/helpers/spree/admin/navigation_helper.rb +76 -1
  19. data/app/helpers/spree/admin/orders_helper.rb +0 -19
  20. data/app/helpers/spree/admin/stores_helper.rb +5 -34
  21. data/app/javascript/spree/admin/controllers/slug_form_controller.js +0 -3
  22. data/app/javascript/spree/admin/controllers/variants_form_controller.js +6 -0
  23. data/app/javascript/spree/admin/helpers/bootstrap.js +3 -3
  24. data/app/views/active_storage/_upload_form.html.erb +4 -8
  25. data/app/views/spree/admin/assets/edit.html.erb +3 -8
  26. data/app/views/spree/admin/coupon_codes/index.html.erb +4 -6
  27. data/app/views/spree/admin/custom_domains/_custom_domains.html.erb +1 -1
  28. data/app/views/spree/admin/custom_domains/index.html.erb +1 -1
  29. data/app/views/spree/admin/customer_returns/index.html.erb +4 -17
  30. data/app/views/spree/admin/dashboard/_setup_progress.html.erb +4 -2
  31. data/app/views/spree/admin/dashboard/show.html.erb +1 -1
  32. data/app/views/spree/admin/digital_assets/_table.html.erb +1 -1
  33. data/app/views/spree/admin/digital_assets/edit.html.erb +3 -11
  34. data/app/views/spree/admin/digital_assets/new.html.erb +3 -11
  35. data/app/views/spree/admin/errors/forbidden.html.erb +13 -0
  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/_filters.html.erb +2 -7
  43. data/app/views/spree/admin/orders/_list.html.erb +2 -4
  44. data/app/views/spree/admin/orders/billing_address/create.turbo_stream.erb +3 -6
  45. data/app/views/spree/admin/orders/billing_address/edit.html.erb +3 -6
  46. data/app/views/spree/admin/orders/billing_address/new.html.erb +3 -6
  47. data/app/views/spree/admin/orders/billing_address/update.turbo_stream.erb +3 -6
  48. data/app/views/spree/admin/orders/contact_information/edit.html.erb +3 -6
  49. data/app/views/spree/admin/orders/customer_returns/edit.html.erb +1 -10
  50. data/app/views/spree/admin/orders/index.html.erb +1 -1
  51. data/app/views/spree/admin/orders/return_authorizations/_form.html.erb +1 -1
  52. data/app/views/spree/admin/orders/return_authorizations/show.html.erb +45 -43
  53. data/app/views/spree/admin/orders/shipping_address/create.turbo_stream.erb +3 -6
  54. data/app/views/spree/admin/orders/shipping_address/edit.html.erb +3 -6
  55. data/app/views/spree/admin/orders/shipping_address/new.html.erb +3 -6
  56. data/app/views/spree/admin/orders/shipping_address/update.turbo_stream.erb +3 -6
  57. data/app/views/spree/admin/pages/_filters.html.erb +1 -1
  58. data/app/views/spree/admin/pages/_page.html.erb +26 -0
  59. data/app/views/spree/admin/pages/edit.html.erb +2 -5
  60. data/app/views/spree/admin/pages/index.html.erb +9 -7
  61. data/app/views/spree/admin/payment_methods/index.html.erb +10 -8
  62. data/app/views/spree/admin/post_categories/_post_category.html.erb +5 -2
  63. data/app/views/spree/admin/post_categories/index.html.erb +6 -7
  64. data/app/views/spree/admin/posts/_filters.html.erb +4 -9
  65. data/app/views/spree/admin/posts/_form.html.erb +2 -2
  66. data/app/views/spree/admin/posts/_post.html.erb +1 -11
  67. data/app/views/spree/admin/posts/index.html.erb +7 -11
  68. data/app/views/spree/admin/products/_bulk_operations.html.erb +59 -94
  69. data/app/views/spree/admin/products/_filters.html.erb +12 -7
  70. data/app/views/spree/admin/products/_list.html.erb +2 -10
  71. data/app/views/spree/admin/products/_product.html.erb +1 -4
  72. data/app/views/spree/admin/products/bulk_modal.html.erb +3 -8
  73. data/app/views/spree/admin/products/index.html.erb +5 -5
  74. data/app/views/spree/admin/promotion_actions/new.html.erb +7 -12
  75. data/app/views/spree/admin/promotion_rules/new.html.erb +7 -12
  76. data/app/views/spree/admin/promotions/_filters.html.erb +27 -0
  77. data/app/views/spree/admin/promotions/index.html.erb +7 -35
  78. data/app/views/spree/admin/properties/index.html.erb +10 -9
  79. data/app/views/spree/admin/refund_reasons/index.html.erb +37 -35
  80. data/app/views/spree/admin/refunds/edit.html.erb +3 -8
  81. data/app/views/spree/admin/reimbursement_types/index.html.erb +42 -40
  82. data/app/views/spree/admin/reports/_report.html.erb +1 -1
  83. data/app/views/spree/admin/return_authorization_reasons/index.html.erb +41 -41
  84. data/app/views/spree/admin/return_authorizations/_filters.html.erb +1 -1
  85. data/app/views/spree/admin/return_authorizations/_list.html.erb +1 -10
  86. data/app/views/spree/admin/return_authorizations/index.html.erb +1 -1
  87. data/app/views/spree/admin/roles/_form.html.erb +1 -1
  88. data/app/views/spree/admin/roles/index.html.erb +26 -24
  89. data/app/views/spree/admin/shared/_bulk_modal.html.erb +6 -7
  90. data/app/views/spree/admin/shared/_filter_submit.html.erb +6 -0
  91. data/app/views/spree/admin/shared/_modal.html.erb +2 -8
  92. data/app/views/spree/admin/shared/_multi_product_picker.html.erb +2 -4
  93. data/app/views/spree/admin/shared/_no_resource_found.html.erb +1 -1
  94. data/app/views/spree/admin/shared/_product_image.html.erb +1 -10
  95. data/app/views/spree/admin/shared/_refunds.html.erb +1 -1
  96. data/app/views/spree/admin/shared/sidebar/_orders_nav.html.erb +1 -1
  97. data/app/views/spree/admin/shared/sidebar/_store_dropdown.html.erb +36 -7
  98. data/app/views/spree/admin/shared/sidebar/_store_nav.html.erb +4 -0
  99. data/app/views/spree/admin/shared/sortable_tree/_taxonomy.html.erb +3 -23
  100. data/app/views/spree/admin/shipping_categories/index.html.erb +28 -26
  101. data/app/views/spree/admin/shipping_methods/_actions.html.erb +1 -1
  102. data/app/views/spree/admin/shipping_methods/index.html.erb +23 -21
  103. data/app/views/spree/admin/stock_items/_filters.html.erb +2 -7
  104. data/app/views/spree/admin/stock_items/index.html.erb +5 -8
  105. data/app/views/spree/admin/stock_locations/_stock_location.html.erb +16 -13
  106. data/app/views/spree/admin/stock_locations/index.html.erb +24 -21
  107. data/app/views/spree/admin/stock_transfers/_filters.html.erb +1 -1
  108. data/app/views/spree/admin/stock_transfers/_new_variant_modal.html.erb +3 -5
  109. data/app/views/spree/admin/stock_transfers/index.html.erb +6 -6
  110. data/app/views/spree/admin/store_credit_categories/_form.html.erb +1 -1
  111. data/app/views/spree/admin/store_credit_categories/edit.html.erb +6 -4
  112. data/app/views/spree/admin/store_credit_categories/index.html.erb +28 -24
  113. data/app/views/spree/admin/store_credits/index.html.erb +2 -2
  114. data/app/views/spree/admin/storefront/edit.html.erb +7 -9
  115. data/app/views/spree/admin/stores/form/_policies.html.erb +1 -1
  116. data/app/views/spree/admin/stores/new.html.erb +9 -6
  117. data/app/views/spree/admin/tax_categories/index.html.erb +24 -22
  118. data/app/views/spree/admin/tax_rates/index.html.erb +26 -24
  119. data/app/views/spree/admin/taxonomies/index.html.erb +4 -4
  120. data/app/views/spree/admin/taxonomies/show.html.erb +2 -2
  121. data/app/views/spree/admin/themes/_theme_preview_image.html.erb +1 -10
  122. data/app/views/spree/admin/themes/index.html.erb +2 -2
  123. data/app/views/spree/admin/translations/_translations_unavailable.html.erb +6 -8
  124. data/app/views/spree/admin/users/_filters.html.erb +2 -7
  125. data/app/views/spree/admin/users/_lifetime_stats.html.erb +1 -1
  126. data/app/views/spree/admin/users/_tabs.html.erb +4 -4
  127. data/app/views/spree/admin/users/_user.html.erb +1 -4
  128. data/app/views/spree/admin/users/bulk_modal.html.erb +3 -8
  129. data/app/views/spree/admin/users/index.html.erb +25 -58
  130. data/app/views/spree/admin/variants/form/_media_asset.html.erb +1 -7
  131. data/app/views/spree/admin/variants/form/_pricing.html.erb +1 -1
  132. data/app/views/spree/admin/webhooks_subscribers/_form.html.erb +1 -1
  133. data/app/views/spree/admin/webhooks_subscribers/index.html.erb +25 -22
  134. data/app/views/spree/admin/webhooks_subscribers/show.html.erb +3 -3
  135. data/app/views/spree/admin/zones/index.html.erb +34 -32
  136. data/config/initializers/chartkick.rb +1 -1
  137. data/config/locales/en.yml +3 -7
  138. metadata +14 -10
  139. data/app/views/spree/admin/pages/_page.erb +0 -8
  140. data/app/views/spree/admin/products/_empty_list.html.erb +0 -1
@@ -5,22 +5,24 @@
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
- <thead class="text-muted">
13
+ <thead>
14
14
  <tr>
15
- <th><%= Spree.t(:name) %></th>
16
- <th><%= Spree.t(:updated) %></th>
15
+ <th><%= sort_link @search, :name, Spree.t(:name) %></th>
16
+ <th><%= sort_link @search, :created_at, Spree.t(:created_at) %></th>
17
+ <th><%= sort_link @search, :updated_at, Spree.t(:updated_at) %></th>
18
+ <th></th>
17
19
  </tr>
18
20
  </thead>
19
21
  <tbody>
20
- <%= render collection: @pages, partial: "spree/admin/pages/page", cached: spree_base_cache_scope %>
22
+ <%= render collection: @collection, partial: "spree/admin/pages/page", cached: spree_base_cache_scope %>
21
23
  </tbody>
22
24
  </table>
23
- <%= render partial: "spree/admin/shared/index_table_options", locals: { collection: @pages } %>
25
+ <%= render "spree/admin/shared/index_table_options", collection: @collection %>
24
26
  </div>
25
27
  <% else %>
26
28
  <%= 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>
@@ -1,6 +1,9 @@
1
1
  <tr data-controller="row-link" id="<%= dom_id(post_category) %>">
2
- <td><%= link_to post_category.title, spree.edit_admin_post_category_path(post_category), class: 'd-flex', data: { row_link_target: :link } %></td>
3
- <td class="actions cursor-pointer" data-action="click->row-link#openLink">
2
+ <td class="w-60 p-0">
3
+ <%= link_to post_category.title, spree.edit_admin_post_category_path(post_category), class: 'd-block w-100 h-100 px-3 py-2', data: { row_link_target: :link } %>
4
+ </td>
5
+ <td class="w-10 cursor-pointer" data-action="click->row-link#openLink"><%= post_category.posts.count %></td>
6
+ <td class="w-10 cursor-pointer text-right" data-action="click->row-link#openLink">
4
7
  <%= link_to_edit(post_category, class: 'btn btn-light btn-sm') if can? :edit, post_category %>
5
8
  </td>
6
9
  </tr>
@@ -4,24 +4,23 @@
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">
12
12
  <tr>
13
- <th class="w-90"><%= Spree.t(:title) %></th>
13
+ <th><%= Spree.t(:title) %></th>
14
+ <th><%= Spree.t(:posts) %></th>
14
15
  <th></th>
15
16
  </tr>
16
17
  </thead>
17
18
  <tbody>
18
- <%= render partial: 'spree/admin/post_categories/post_category', collection: @post_categories, cached: spree_base_cache_scope %>
19
+ <%= render collection: @collection, partial: 'spree/admin/post_categories/post_category', cached: spree_base_cache_scope %>
19
20
  </tbody>
20
21
  </table>
21
22
  </div>
22
23
  </div>
23
24
  <% 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>
25
+ <%= render 'spree/admin/shared/no_resource_found' %>
27
26
  <% 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
 
@@ -20,18 +20,13 @@
20
20
  <div class="form-group">
21
21
  <%= f.label :post_category_id_eq, Spree.t(:category) %>
22
22
  <%= f.select :post_category_id_eq,
23
- options_for_select(Spree::PostCategory.all.pluck(:title, :id), params.dig(:q, :post_category_id_eq)),
23
+ options_for_select(@post_categories.pluck(:title, :id), params.dig(:q, :post_category_id_eq)),
24
24
  { include_blank: true },
25
- { class: "custom-select", data: { filters_target: :input } } %>
25
+ { data: { filters_target: :input, controller: 'autocomplete-select' } } %>
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" %>
@@ -48,12 +48,12 @@
48
48
  <div class="card-body">
49
49
  <div class="form-group">
50
50
  <%= f.label :author_id, Spree.t(:author) %>
51
- <%= f.select :author_id, options_for_select(post_authors_select_options, @post.author_id || try_spree_current_user.id), {}, { class: 'custom-select' } %>
51
+ <%= f.select :author_id, options_for_select(post_authors_select_options, @post.author_id || try_spree_current_user.id), {}, { data: { controller: 'autocomplete-select' } } %>
52
52
  </div>
53
53
 
54
54
  <div class="form-group">
55
55
  <%= f.label :post_category_id, Spree.t(:category) %>
56
- <%= f.select :post_category_id, options_for_select(current_store.post_categories.pluck(:title, :id), @post.post_category_id), { include_blank: true }, { class: 'custom-select' } %>
56
+ <%= f.select :post_category_id, options_for_select(@post_categories.pluck(:title, :id), @post.post_category_id), { include_blank: true }, { data: { controller: 'autocomplete-select' } } %>
57
57
  </div>
58
58
 
59
59
  <div class="form-group">
@@ -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,31 +6,27 @@
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">
16
15
  <tr>
17
- <th><%= Spree.t(:title) %></th>
16
+ <th><%= sort_link @search, :title, Spree.t(:title) %></th>
18
17
  <th><%= Spree.t(:category) %></th>
19
18
  <th><%= Spree.t(:author) %></th>
20
- <th><%= Spree.t(:published_at) %></th>
19
+ <th><%= sort_link @search, :published_at, Spree.t(:published_at) %></th>
21
20
  <th></th>
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
 
@@ -46,12 +56,7 @@
46
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,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 %>
@@ -1,9 +1,6 @@
1
1
  <tr id="<%= dom_id product %>" data-controller="row-link">
2
2
  <td class="pr-0 w-5">
3
- <div class="custom-control custom-checkbox ml-1">
4
- <%= check_box_tag "ids[]", product.id, false, class: "custom-control-input", id: "ids_#{product.id}", data: { bulk_operation_target: "checkbox" } %>
5
- <label class="custom-control-label" for="ids_<%= product.id %>"><span></span></label>
6
- </div>
3
+ <%= bulk_operations_checkbox(product) %>
7
4
  </td>
8
5
  <td scope="row" class="w-40 py-0 text-wrap" data-action="click->row-link#openLink">
9
6
  <%= link_to spree.edit_admin_product_path(product), class: 'd-flex align-items-center w-100 text-decoration-none h-100 py-2', data: { row_link_target: :link, 'turbo-frame': '_top' } do %>
@@ -1,11 +1,6 @@
1
1
  <%= turbo_frame_tag :bulk_modal do %>
2
2
  <div class="modal-content">
3
- <div class="modal-header">
4
- <h5 class="modal-title" id="exampleModalLabel">
5
- <%= @title %>
6
- </h5>
7
- <button type="button" class="btn-close" data-dismiss="modal" aria-label="<%= Spree.t(:close) %>" />
8
- </div>
3
+ <%= modal_header(@title) %>
9
4
  <div class="modal-body">
10
5
  <p><%= @body %></p>
11
6
 
@@ -15,8 +10,8 @@
15
10
  <%= tom_select_tag 'tags', multiple: true, class: 'w-100', options: tags_json_array, required: true, value_field: :name, create: params[:kind] == 'add_tags' %>
16
11
  <% end %>
17
12
  </div>
18
- <div class="modal-footer d-flex justify-content-between">
19
- <button type="button" class="btn btn-light" data-dismiss="modal"><%= Spree.t('actions.discard') %></button>
13
+ <div class="modal-footer">
14
+ <%= modal_discard_button %>
20
15
  <%= turbo_save_button_tag %>
21
16
  </div>
22
17
  </div>
@@ -1,9 +1,9 @@
1
1
  <%= render 'index_header' %>
2
2
 
3
- <div class="card-lg p-0">
3
+ <div class="card-lg">
4
4
  <% if params[:frame_name].present? %>
5
5
  <%= turbo_frame_tag params[:frame_name], autoscroll: true, data: { autoscroll_block: :start, autoscroll_behavior: :smooth } do %>
6
- <%= render 'filters' %>
6
+ <%= render 'filters', frame_name: params[:frame_name] %>
7
7
  <%= render 'list' %>
8
8
  <% end %>
9
9
  <% else %>
@@ -12,7 +12,7 @@
12
12
  <% end %>
13
13
  </div>
14
14
 
15
- <p class="text-muted small text-center py-2 px-3 mt-4 rounded-pill mx-auto d-flex-inline">
16
- Learn more about
17
- <%= external_link_to 'managing products', 'https://spreecommerce.org/docs/user/manage-products', class: 'text-decoration-none' %>
15
+ <p class="documentation-link-container">
16
+ Learn more about
17
+ <%= external_link_to 'managing products', 'https://spreecommerce.org/docs/user/manage-products' %>
18
18
  </p>
@@ -1,16 +1,11 @@
1
1
  <%= turbo_frame_tag :dialog_modal do %>
2
2
  <%= form_with model: @promotion_action, url: spree.admin_promotion_actions_path(@promotion), method: :post, scope: :promotion_action do |f| %>
3
3
  <div class="modal-content">
4
- <div class="modal-header">
5
- <h5 class="modal-title">
6
- <% if @promotion_action.type.nil? %>
7
- <%= Spree.t(:add_action_of_type) %>
8
- <% else %>
9
- <%= @promotion_action.human_name %>
10
- <% end %>
11
- </h5>
12
- <button type="button" class="btn-close" data-dismiss="modal" aria-label="<%= Spree.t(:close) %>" />
13
- </div>
4
+ <% if @promotion_action.type.nil? %>
5
+ <%= modal_header(Spree.t(:add_action_of_type)) %>
6
+ <% else %>
7
+ <%= modal_header(@promotion_action.human_name) %>
8
+ <% end %>
14
9
  <div class="modal-body">
15
10
  <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @promotion_action } %>
16
11
  <% if @promotion_action.type.nil? %>
@@ -38,8 +33,8 @@
38
33
  <% end %>
39
34
  </div>
40
35
  <% if @promotion_action.type.present? %>
41
- <div class="modal-footer d-flex justify-content-between">
42
- <button type="button" class="btn btn-light" data-dismiss="modal"><%= Spree.t('actions.discard') %></button>
36
+ <div class="modal-footer">
37
+ <%= modal_discard_button %>
43
38
  <%= turbo_save_button_tag Spree.t('actions.create'), data: { turbo_frame: '_top' } %>
44
39
  </div>
45
40
  <% end %>
@@ -1,16 +1,11 @@
1
1
  <%= turbo_frame_tag :dialog_modal do %>
2
2
  <%= form_with model: @promotion_rule, url: spree.admin_promotion_rules_path(@promotion), method: :post, scope: :promotion_rule do |f| %>
3
3
  <div class="modal-content">
4
- <div class="modal-header">
5
- <h5 class="modal-title">
6
- <% if @promotion_rule.type.nil? %>
7
- <%= Spree.t(:add_rule_of_type) %>
8
- <% else %>
9
- <%= @promotion_rule.human_name %>
10
- <% end %>
11
- </h5>
12
- <button type="button" class="btn-close" data-dismiss="modal" aria-label="<%= Spree.t(:close) %>" />
13
- </div>
4
+ <% if @promotion_rule.type.nil? %>
5
+ <%= modal_header(Spree.t(:add_rule_of_type)) %>
6
+ <% else %>
7
+ <%= modal_header(@promotion_rule.human_name) %>
8
+ <% end %>
14
9
  <div class="modal-body">
15
10
  <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @promotion_rule } %>
16
11
  <% if @promotion_rule.type.nil? %>
@@ -38,8 +33,8 @@
38
33
  <% end %>
39
34
  </div>
40
35
  <% if @promotion_rule.type.present? %>
41
- <div class="modal-footer d-flex justify-content-between">
42
- <button type="button" class="btn btn-light" data-dismiss="modal"><%= Spree.t('actions.discard') %></button>
36
+ <div class="modal-footer">
37
+ <%= modal_discard_button %>
43
38
  <%= turbo_save_button_tag Spree.t('actions.create'), data: { turbo_frame: '_top' } %>
44
39
  </div>
45
40
  <% end %>
@@ -0,0 +1,27 @@
1
+ <%= search_form_for [:admin, @search], class: "filter-wrap", data: {controller: "filters reveal", reveal_hidden_class: "d-none"} do |f| %>
2
+ <div class="d-flex flex-column flex-lg-row gap-2">
3
+ <%= render 'spree/admin/shared/filters_search_bar', param: :name_cont, label: Spree.t(:name) %>
4
+
5
+ <div class="d-flex align-items-center justify-content-between">
6
+ <%= render "spree/admin/promotions/table_filter_dropdown" %>
7
+
8
+ <%= render 'spree/admin/shared/filters_button' %>
9
+ </div>
10
+ </div>
11
+ <div data-reveal-target="item" class="d-none" id="table-filter">
12
+ <div class="row">
13
+ <div class="col-12 col-lg-6">
14
+ <div class="form-group">
15
+ <%= label_tag :q_code_or_coupon_codes_code_eq, Spree.t(:code) %>
16
+ <%= f.search_field :code_or_coupon_codes_code_eq, class: "form-control", data: { filters_target: :input } %>
17
+ </div>
18
+ </div>
19
+ </div>
20
+
21
+ <%= render 'spree/admin/shared/filter_submit' %>
22
+ </div>
23
+
24
+ <%= render "spree/admin/shared/filter_badge_template" %>
25
+
26
+ <div data-filters-target="badgesContainer" class="filter-badges-container"></div>
27
+ <% end %>