spree_admin 5.0.0 → 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 (127) 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 +8 -1
  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/controllers/spree/admin/products_controller.rb +1 -8
  9. data/app/controllers/spree/admin/storefront_controller.rb +1 -1
  10. data/app/controllers/spree/admin/translations_controller.rb +1 -1
  11. data/app/helpers/spree/admin/base_helper.rb +49 -57
  12. data/app/helpers/spree/admin/bulk_operations_helper.rb +86 -0
  13. data/app/helpers/spree/admin/modal_helper.rb +29 -0
  14. data/app/helpers/spree/admin/navigation_helper.rb +76 -1
  15. data/app/helpers/spree/admin/orders_helper.rb +0 -19
  16. data/app/helpers/spree/admin/stores_helper.rb +5 -34
  17. data/app/javascript/spree/admin/controllers/variants_form_controller.js +6 -0
  18. data/app/views/active_storage/_upload_form.html.erb +4 -8
  19. data/app/views/spree/admin/assets/edit.html.erb +3 -8
  20. data/app/views/spree/admin/coupon_codes/index.html.erb +4 -6
  21. data/app/views/spree/admin/custom_domains/_custom_domains.html.erb +1 -1
  22. data/app/views/spree/admin/custom_domains/index.html.erb +1 -1
  23. data/app/views/spree/admin/customer_returns/index.html.erb +4 -17
  24. data/app/views/spree/admin/dashboard/_setup_progress.html.erb +4 -2
  25. data/app/views/spree/admin/dashboard/show.html.erb +1 -1
  26. data/app/views/spree/admin/digital_assets/_table.html.erb +1 -1
  27. data/app/views/spree/admin/digital_assets/edit.html.erb +3 -11
  28. data/app/views/spree/admin/digital_assets/new.html.erb +3 -11
  29. data/app/views/spree/admin/exports/index.html.erb +22 -24
  30. data/app/views/spree/admin/exports/new.html.erb +3 -9
  31. data/app/views/spree/admin/line_items/new.html.erb +2 -5
  32. data/app/views/spree/admin/oauth_applications/index.html.erb +57 -58
  33. data/app/views/spree/admin/option_types/_filter.html.erb +1 -1
  34. data/app/views/spree/admin/option_types/index.html.erb +7 -11
  35. data/app/views/spree/admin/orders/_filters.html.erb +2 -7
  36. data/app/views/spree/admin/orders/_list.html.erb +2 -4
  37. data/app/views/spree/admin/orders/billing_address/create.turbo_stream.erb +3 -6
  38. data/app/views/spree/admin/orders/billing_address/edit.html.erb +3 -6
  39. data/app/views/spree/admin/orders/billing_address/new.html.erb +3 -6
  40. data/app/views/spree/admin/orders/billing_address/update.turbo_stream.erb +3 -6
  41. data/app/views/spree/admin/orders/contact_information/edit.html.erb +3 -6
  42. data/app/views/spree/admin/orders/customer_returns/edit.html.erb +1 -10
  43. data/app/views/spree/admin/orders/index.html.erb +1 -1
  44. data/app/views/spree/admin/orders/return_authorizations/_form.html.erb +1 -1
  45. data/app/views/spree/admin/orders/return_authorizations/show.html.erb +45 -43
  46. data/app/views/spree/admin/orders/shipping_address/create.turbo_stream.erb +3 -6
  47. data/app/views/spree/admin/orders/shipping_address/edit.html.erb +3 -6
  48. data/app/views/spree/admin/orders/shipping_address/new.html.erb +3 -6
  49. data/app/views/spree/admin/orders/shipping_address/update.turbo_stream.erb +3 -6
  50. data/app/views/spree/admin/pages/_filters.html.erb +1 -1
  51. data/app/views/spree/admin/pages/edit.html.erb +2 -5
  52. data/app/views/spree/admin/pages/index.html.erb +4 -4
  53. data/app/views/spree/admin/payment_methods/index.html.erb +10 -8
  54. data/app/views/spree/admin/post_categories/index.html.erb +4 -6
  55. data/app/views/spree/admin/posts/_filters.html.erb +2 -7
  56. data/app/views/spree/admin/posts/_post.html.erb +1 -11
  57. data/app/views/spree/admin/posts/index.html.erb +5 -9
  58. data/app/views/spree/admin/products/_bulk_operations.html.erb +59 -94
  59. data/app/views/spree/admin/products/_filters.html.erb +12 -7
  60. data/app/views/spree/admin/products/_list.html.erb +2 -10
  61. data/app/views/spree/admin/products/_product.html.erb +1 -4
  62. data/app/views/spree/admin/products/bulk_modal.html.erb +3 -8
  63. data/app/views/spree/admin/products/index.html.erb +5 -5
  64. data/app/views/spree/admin/promotion_actions/new.html.erb +7 -12
  65. data/app/views/spree/admin/promotion_rules/new.html.erb +7 -12
  66. data/app/views/spree/admin/promotions/_filters.html.erb +27 -0
  67. data/app/views/spree/admin/promotions/index.html.erb +7 -35
  68. data/app/views/spree/admin/properties/index.html.erb +10 -9
  69. data/app/views/spree/admin/refund_reasons/index.html.erb +37 -35
  70. data/app/views/spree/admin/refunds/edit.html.erb +3 -8
  71. data/app/views/spree/admin/reimbursement_types/index.html.erb +42 -40
  72. data/app/views/spree/admin/reports/_report.html.erb +1 -1
  73. data/app/views/spree/admin/return_authorization_reasons/index.html.erb +41 -41
  74. data/app/views/spree/admin/return_authorizations/_filters.html.erb +1 -1
  75. data/app/views/spree/admin/return_authorizations/_list.html.erb +1 -10
  76. data/app/views/spree/admin/return_authorizations/index.html.erb +1 -1
  77. data/app/views/spree/admin/roles/_form.html.erb +1 -1
  78. data/app/views/spree/admin/roles/index.html.erb +26 -24
  79. data/app/views/spree/admin/shared/_bulk_modal.html.erb +6 -7
  80. data/app/views/spree/admin/shared/_filter_submit.html.erb +6 -0
  81. data/app/views/spree/admin/shared/_modal.html.erb +2 -8
  82. data/app/views/spree/admin/shared/_multi_product_picker.html.erb +2 -4
  83. data/app/views/spree/admin/shared/_no_resource_found.html.erb +1 -1
  84. data/app/views/spree/admin/shared/_product_image.html.erb +1 -10
  85. data/app/views/spree/admin/shared/_refunds.html.erb +1 -1
  86. data/app/views/spree/admin/shared/sidebar/_orders_nav.html.erb +1 -1
  87. data/app/views/spree/admin/shared/sidebar/_store_dropdown.html.erb +36 -7
  88. data/app/views/spree/admin/shared/sidebar/_store_nav.html.erb +4 -0
  89. data/app/views/spree/admin/shared/sortable_tree/_taxonomy.html.erb +3 -23
  90. data/app/views/spree/admin/shipping_categories/index.html.erb +28 -26
  91. data/app/views/spree/admin/shipping_methods/_actions.html.erb +1 -1
  92. data/app/views/spree/admin/shipping_methods/index.html.erb +23 -21
  93. data/app/views/spree/admin/stock_items/_filters.html.erb +2 -7
  94. data/app/views/spree/admin/stock_items/index.html.erb +5 -8
  95. data/app/views/spree/admin/stock_locations/_stock_location.html.erb +16 -13
  96. data/app/views/spree/admin/stock_locations/index.html.erb +24 -21
  97. data/app/views/spree/admin/stock_transfers/_filters.html.erb +1 -1
  98. data/app/views/spree/admin/stock_transfers/_new_variant_modal.html.erb +3 -5
  99. data/app/views/spree/admin/stock_transfers/index.html.erb +6 -6
  100. data/app/views/spree/admin/store_credit_categories/_form.html.erb +1 -1
  101. data/app/views/spree/admin/store_credit_categories/edit.html.erb +6 -4
  102. data/app/views/spree/admin/store_credit_categories/index.html.erb +28 -24
  103. data/app/views/spree/admin/store_credits/index.html.erb +2 -2
  104. data/app/views/spree/admin/storefront/edit.html.erb +7 -9
  105. data/app/views/spree/admin/stores/form/_policies.html.erb +1 -1
  106. data/app/views/spree/admin/stores/new.html.erb +8 -6
  107. data/app/views/spree/admin/tax_categories/index.html.erb +24 -22
  108. data/app/views/spree/admin/tax_rates/index.html.erb +26 -24
  109. data/app/views/spree/admin/taxonomies/index.html.erb +4 -4
  110. data/app/views/spree/admin/taxonomies/show.html.erb +2 -2
  111. data/app/views/spree/admin/themes/_theme_preview_image.html.erb +1 -10
  112. data/app/views/spree/admin/themes/index.html.erb +2 -2
  113. data/app/views/spree/admin/translations/_translations_unavailable.html.erb +6 -8
  114. data/app/views/spree/admin/users/_filters.html.erb +2 -7
  115. data/app/views/spree/admin/users/_tabs.html.erb +4 -4
  116. data/app/views/spree/admin/users/_user.html.erb +1 -4
  117. data/app/views/spree/admin/users/bulk_modal.html.erb +3 -8
  118. data/app/views/spree/admin/users/index.html.erb +25 -58
  119. data/app/views/spree/admin/variants/form/_media_asset.html.erb +1 -7
  120. data/app/views/spree/admin/variants/form/_pricing.html.erb +1 -1
  121. data/app/views/spree/admin/webhooks_subscribers/_form.html.erb +1 -1
  122. data/app/views/spree/admin/webhooks_subscribers/index.html.erb +25 -22
  123. data/app/views/spree/admin/webhooks_subscribers/show.html.erb +3 -3
  124. data/app/views/spree/admin/zones/index.html.erb +34 -32
  125. data/config/locales/en.yml +1 -3
  126. metadata +12 -9
  127. data/app/views/spree/admin/products/_empty_list.html.erb +0 -1
@@ -11,24 +11,26 @@
11
11
  </div>
12
12
  <% end %>
13
13
 
14
- <% if @shipping_methods.any? %>
15
- <div class="table-responsive card-lg p-0">
16
- <table class="table" id='listing_shipping_methods'>
17
- <thead class="text-muted">
18
- <tr>
19
- <th><%= Spree.t(:name) %></th>
20
- <th><%= Spree.t(:zone) %></th>
21
- <th><%= Spree.t(:estimated_delivery_time) %></th>
22
- <th><%= Spree.t(:amount) %></th>
23
- <th><%= Spree.t(:visibility) %></th>
24
- <th class="actions"></th>
25
- </tr>
26
- </thead>
27
- <tbody>
28
- <%= render partial: 'spree/admin/shipping_methods/shipping_method', collection: @shipping_methods.includes(:zones, :calculator), as: :shipping_method %>
29
- </tbody>
30
- </table>
31
- </div>
32
- <% else %>
33
- <%= render 'spree/admin/shared/no_resource_found' %>
34
- <% end %>
14
+ <div class="card-lg">
15
+ <% if @collection.any? %>
16
+ <div class="table-responsive">
17
+ <table class="table">
18
+ <thead class="text-muted">
19
+ <tr>
20
+ <th><%= Spree.t(:name) %></th>
21
+ <th><%= Spree.t(:zone) %></th>
22
+ <th><%= Spree.t(:estimated_delivery_time) %></th>
23
+ <th><%= Spree.t(:amount) %></th>
24
+ <th><%= Spree.t(:visibility) %></th>
25
+ <th></th>
26
+ </tr>
27
+ </thead>
28
+ <tbody>
29
+ <%= render partial: 'spree/admin/shipping_methods/shipping_method', collection: @collection.includes(:zones, :calculator), as: :shipping_method %>
30
+ </tbody>
31
+ </table>
32
+ </div>
33
+ <% else %>
34
+ <%= render 'spree/admin/shared/no_resource_found' %>
35
+ <% end %>
36
+ </div>
@@ -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: :variant_product_name_cont, label: Spree.t(:product_name) %>
4
4
 
@@ -25,12 +25,7 @@
25
25
 
26
26
  </div>
27
27
 
28
- <div class="form-actions">
29
- <%= turbo_save_button_tag Spree.t(:filter_results) do %>
30
- <%= icon("search") %>
31
- <%= Spree.t(:filter_results) %>
32
- <% end %>
33
- </div>
28
+ <%= render 'spree/admin/shared/filter_submit' %>
34
29
  </div>
35
30
 
36
31
  <%= render "spree/admin/shared/filter_badge_template" %>
@@ -6,10 +6,10 @@
6
6
  <%= render "spree/admin/shared/stock_nav" %>
7
7
  <% end %>
8
8
 
9
- <div class="card-lg p-0">
9
+ <div class="card-lg">
10
10
  <%= render "filters" %>
11
11
 
12
- <% if @stock_items.any? %>
12
+ <% if @collection.any? %>
13
13
  <div class="table-responsive">
14
14
  <table class="table" id="listing_products">
15
15
  <thead class="text-muted">
@@ -24,15 +24,12 @@
24
24
  </tr>
25
25
  </thead>
26
26
  <tbody>
27
- <%= render partial: "stock_item", collection: @stock_items %>
27
+ <%= render collection: @collection, partial: "stock_item" %>
28
28
  </tbody>
29
29
  </table>
30
30
  </div>
31
+ <%= render "spree/admin/shared/index_table_options", collection: @collection %>
31
32
  <% 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(:stock)) %>
34
- </div>
33
+ <%= render 'spree/admin/shared/no_resource_found', new_object_url: nil %>
35
34
  <% end %>
36
-
37
- <%= render "spree/admin/shared/index_table_options", collection: @stock_items, simple: true if @stock_items.any? %>
38
35
  </div>
@@ -4,25 +4,28 @@
4
4
  <%= flag_emoji(stock_location.country_iso) %>
5
5
  <%= stock_location.country_name %>
6
6
  </td>
7
- <td data-action="click->row-link#openLink"><%= active_badge(stock_location.active?) %></td>
7
+ <td data-action="click->row-link#openLink">
8
+ <%= active_badge(stock_location.active?) %>
9
+ </td>
8
10
  <td data-action="click->row-link#openLink"><%= active_badge(stock_location.default?) %></td>
9
11
  <td class="actions">
10
12
  <% if can? :edit, stock_location %>
11
13
  <div class="d-flex justify-content-end align-items-center">
12
14
  <div><%= link_to_edit stock_location, data: { row_link_target: 'link' } %></div>
13
15
 
14
- <div class="dropdown">
15
- <button class="btn btn-sm btn-light h-100" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
16
- <%= icon('dots', class: 'mr-0') %>
17
- </button>
18
-
19
- <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
20
- <%= link_to_with_icon 'check',
21
- Spree.t(:mark_as_default),
22
- spree.mark_as_default_admin_stock_location_path(stock_location),
23
- class: 'dropdown-item',
24
- data: { turbo_method: :put } %>
25
- </div>
16
+ <% unless stock_location.default? %>
17
+ <div class="dropdown">
18
+ <button class="btn btn-sm btn-light h-100" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
19
+ <%= icon('dots', class: 'mr-0') %>
20
+ </button>
21
+ <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
22
+ <%= link_to_with_icon 'check',
23
+ Spree.t(:mark_as_default),
24
+ spree.mark_as_default_admin_stock_location_path(stock_location),
25
+ class: 'dropdown-item',
26
+ data: { turbo_method: :put } %>
27
+ </div>
28
+ <% end %>
26
29
  </div>
27
30
  </div>
28
31
  <% end %>
@@ -2,25 +2,28 @@
2
2
  <%= Spree.t(:stock_locations) %>
3
3
  <% end %>
4
4
  <% content_for :page_actions do %>
5
- <%= button_link_to Spree.t(:new_stock_location), new_object_url, class: "btn-primary", icon: 'plus' %>
5
+ <%= link_to_with_icon 'plus', Spree.t(:new_stock_location), new_object_url, class: "btn btn-primary" %>
6
6
  <% end if can? :create, Spree::StockLocation %>
7
- <% if @stock_locations.any? %>
8
- <div class="table-responsive card-lg p-0">
9
- <table class="table" id='listing_tax_rates'>
10
- <thead class="text-muted">
11
- <tr>
12
- <th><%= Spree.t(:name) %></th>
13
- <th><%= Spree.t(:country) %></th>
14
- <th><%= Spree.t(:status) %></th>
15
- <th><%= Spree.t(:default) %></th>
16
- <th></th>
17
- </tr>
18
- </thead>
19
- <tbody>
20
- <%= render partial: 'spree/admin/stock_locations/stock_location', collection: @stock_locations, cached: spree_base_cache_scope %>
21
- </tbody>
22
- </table>
23
- </div>
24
- <% else %>
25
- <%= render 'spree/admin/shared/no_resource_found' %>
26
- <% end %>
7
+
8
+ <div class="card-lg">
9
+ <% if @collection.any? %>
10
+ <div class="table-responsive">
11
+ <table class="table">
12
+ <thead class="text-muted">
13
+ <tr>
14
+ <th><%= Spree.t(:name) %></th>
15
+ <th><%= Spree.t(:country) %></th>
16
+ <th><%= Spree.t(:active) %>?</th>
17
+ <th><%= Spree.t(:default) %>?</th>
18
+ <th></th>
19
+ </tr>
20
+ </thead>
21
+ <tbody>
22
+ <%= render partial: 'spree/admin/stock_locations/stock_location', collection: @collection, cached: spree_base_cache_scope %>
23
+ </tbody>
24
+ </table>
25
+ </div>
26
+ <% else %>
27
+ <%= render 'spree/admin/shared/no_resource_found' %>
28
+ <% end %>
29
+ </div>
@@ -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: :number_cont, label: Spree.t(:number) %>
4
4
  <%= render 'spree/admin/shared/filters_button' %>
@@ -1,10 +1,7 @@
1
1
  <div class="modal fade" id="stock_transfer_modal" tabindex="-1" aria-labelledby="stock_transfer_modal_label" aria-hidden="true">
2
2
  <div class="modal-dialog modal-dialog-centered">
3
3
  <div class="modal-content" data-controller="search-picker">
4
- <div class="modal-header">
5
- <h5 class="modal-title" id="stock_transfer_modal_label"><%= Spree.t(:add_variant) %></h5>
6
- <button type="button" class="btn-close" data-action="search-picker#closeAndClear" data-dismiss="modal" aria-label="Close" />
7
- </div>
4
+ <%= modal_header(Spree.t(:add_variant)) %>
8
5
  <div class="modal-body">
9
6
  <%= form_with url: spree.admin_variants_search_path, method: :post, data: { controller: 'auto-submit', turbo_frame: '_top' } do |form| %>
10
7
  <%= form.search_field :q, value: params[:q], class: 'form-control', data: { search_picker_target: :search, action: 'auto-submit#submit' }, autofocus: true %>
@@ -22,7 +19,8 @@
22
19
  </p>
23
20
  </div>
24
21
  </div>
25
- <div class="modal-footer d-flex justify-content-between">
22
+ <div class="modal-footer">
23
+ <%= modal_discard_button %>
26
24
  <%= button_tag Spree.t(:add_selected_variant), class: "btn btn-primary text-center", disabled: true, data: { search_picker_target: :submit, action: 'stock-transfer#add search-picker#closeAndClear', dismiss: 'modal' } %>
27
25
  </div>
28
26
  </div>
@@ -5,14 +5,14 @@
5
5
  <%= render "spree/admin/shared/stock_nav" %>
6
6
  <% end %>
7
7
  <% content_for :page_actions do %>
8
- <%= if can?(:create, Spree::StockTransfer.new)
9
- link_to Spree.t(:new_stock_transfer), spree.new_admin_stock_transfer_path, class: "btn btn-primary"
8
+ <%= if can?(:create, Spree::StockTransfer)
9
+ link_to_with_icon 'plus', Spree.t(:new_stock_transfer), new_object_url, class: "btn btn-primary"
10
10
  end %>
11
11
  <% end %>
12
12
 
13
- <div class="card-lg p-0">
13
+ <div class="card-lg">
14
14
  <%= render "filters" %>
15
- <% if @stock_transfers.any? %>
15
+ <% if @collection.any? %>
16
16
  <div class="table-responsive">
17
17
  <table class="table" id="listing_products">
18
18
  <thead class="text-muted">
@@ -27,12 +27,12 @@
27
27
  </tr>
28
28
  </thead>
29
29
  <tbody>
30
- <%= render partial: 'stock_transfer', collection: @stock_transfers %>
30
+ <%= render collection: @collection, partial: 'stock_transfer' %>
31
31
  </tbody>
32
32
  </table>
33
33
  </div>
34
+ <%= render 'spree/admin/shared/index_table_options', collection: @collection %>
34
35
  <% else %>
35
36
  <%= render 'spree/admin/shared/no_resource_found' %>
36
37
  <% end %>
37
- <%= render 'spree/admin/shared/index_table_options', collection: @stock_transfers, simple: true if @stock_transfers.any? %>
38
38
  </div>
@@ -2,4 +2,4 @@
2
2
  <%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
3
3
  <%= f.text_field :name, class: 'form-control' %>
4
4
  <%= f.error_message_on :name %>
5
- <% end %>
5
+ </div>
@@ -6,8 +6,10 @@
6
6
  <%= render 'spree/admin/shared/error_messages', target: @store_credit_category %>
7
7
 
8
8
  <%= form_for [:admin, @store_credit_category] do |f| %>
9
- <fieldset>
10
- <%= render 'form', f: f %>
11
- <%= render 'spree/admin/shared/edit_resource_links', f: f %>
12
- </fieldset>
9
+ <div class="card mb-4">
10
+ <div class="card-body">
11
+ <%= render 'form', f: f %>
12
+ </div>
13
+ </div>
14
+ <%= render 'spree/admin/shared/edit_resource_links', f: f %>
13
15
  <% end %>
@@ -3,30 +3,34 @@
3
3
  <% end %>
4
4
 
5
5
  <% content_for :page_actions do %>
6
- <%= button_link_to Spree.t(:new_store_credit_category), new_object_url, class: "btn-primary", icon: 'plus', id: 'admin_new_store_credit_category_link' %>
6
+ <%= link_to_with_icon 'plus', Spree.t(:new_store_credit_category), new_object_url, class: "btn btn-primary" %>
7
7
  <% end if can? :create, Spree::StoreCreditCategory %>
8
8
 
9
- <% if @store_credit_categories.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(:name) %></th>
15
- <th class="actions"></th>
16
- </tr>
17
- </thead>
18
- <tbody>
19
- <% @store_credit_categories.each do |store_credit_category| %>
20
- <tr id="<%= spree_dom_id store_credit_category %>">
21
- <td><%= store_credit_category.name %></td>
22
- <td class="actions">
23
- <%= link_to_edit(store_credit_category, no_text: true) if can? :edit, store_credit_category %>
24
- </td>
25
- </tr>
26
- <% end %>
27
- </tbody>
28
- </table>
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(:name) %></th>
16
+ <th></th>
17
+ </tr>
18
+ </thead>
19
+ <tbody>
20
+ <% @collection.each do |store_credit_category| %>
21
+ <tr id="<%= spree_dom_id store_credit_category %>">
22
+ <td>
23
+ <%= store_credit_category.name %>
24
+ </td>
25
+ <td class="actions">
26
+ <%= link_to_edit(store_credit_category, no_text: true) if can? :edit, store_credit_category %>
27
+ </td>
28
+ </tr>
29
+ <% end %>
30
+ </tbody>
31
+ </table>
32
+ </div>
33
+ <% else %>
34
+ <%= render 'spree/admin/shared/no_resource_found' %>
35
+ <% end %>
29
36
  </div>
30
- <% else %>
31
- <%= render 'spree/admin/shared/no_resource_found' %>
32
- <% end %>
@@ -5,11 +5,11 @@
5
5
  <% end %>
6
6
 
7
7
  <% content_for :page_actions do %>
8
- <%= button_link_to Spree.t(:add_store_credit), spree.new_admin_user_store_credit_path(@user), class: "btn-primary", icon: 'plus' if can?(:create, Spree::StoreCredit) %>
8
+ <%= link_to_with_icon 'plus', Spree.t(:add_store_credit), spree.new_admin_user_store_credit_path(@user), class: "btn btn-primary" if can?(:create, Spree::StoreCredit) %>
9
9
  <% end %>
10
10
  <% end %>
11
11
 
12
- <div class="card-lg p-0">
12
+ <div class="card-lg">
13
13
  <% if params[:frame_name].present? %>
14
14
  <%= turbo_frame_tag params[:frame_name], autoscroll: true, data: { autoscroll_block: :nearest, autoscroll_behavior: :smooth } do %>
15
15
  <%= render 'list' %>
@@ -46,21 +46,19 @@
46
46
  <%= Spree.t(:security) %>
47
47
  </h5>
48
48
  </div>
49
- <div class="card-body">
49
+ <div class="card-body" data-controller="reveal" data-reveal-hidden-class="d-none">
50
50
  <div class="custom-control custom-checkbox mb-2">
51
- <%= f.check_box :preferred_password_protected, class: 'custom-control-input' %>
51
+ <%= f.check_box :preferred_password_protected, class: 'custom-control-input', data: { action: 'reveal#toggle' } %>
52
52
  <%= f.label :preferred_password_protected, Spree.t(:password_protected), class: 'custom-control-label' %>
53
53
  </div>
54
54
  <p class="text-muted small pl-4">
55
55
  Checking this box will put your storefront behind a password.
56
56
  </p>
57
-
58
- <% if @store.prefers_password_protected? %>
59
- <div class="form-group">
60
- <%= f.label :storefront_password, Spree.t(:password) %>
61
- <%= f.text_field :storefront_password, class: 'form-control' %>
62
- </div>
63
- <% end %>
57
+
58
+ <div class="form-group <%= @store.prefers_password_protected? ? '' : 'd-none' %>" data-reveal-target="item">
59
+ <%= f.label :storefront_password, Spree.t(:password) %>
60
+ <%= f.text_field :storefront_password, class: 'form-control' %>
61
+ </div>
64
62
  </div>
65
63
  </div>
66
64
 
@@ -8,7 +8,7 @@
8
8
  </div>
9
9
  <% end %>
10
10
 
11
- <div class="card-lg">
11
+ <div class="card-lg p-4">
12
12
  <h5 class="mb-3"><%= Spree.t(:terms_of_service) %></h5>
13
13
  <div class="row">
14
14
  <div class="col-lg-4">
@@ -3,10 +3,7 @@
3
3
  <%= turbo_frame_tag :dialog_modal_lg do %>
4
4
  <%= form_for @store, url: spree.admin_stores_path, data: { turbo_frame: '_top', controller: 'store-form enable-button' } do |f| %>
5
5
  <div class="modal-content">
6
- <div class="modal-header">
7
- <h5 class="modal-title" id="newStoreModalLabel"><%= Spree.t(:new_store) %></h5>
8
- <button type="button" class="btn-close" data-dismiss="modal" aria-label="<%= Spree.t(:close) %>"></button>
9
- </div>
6
+ <%= modal_header(Spree.t(:new_store)) %>
10
7
  <div class="modal-body">
11
8
  <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @store } %>
12
9
  <div class="row">
@@ -27,6 +24,11 @@
27
24
  <%= f.collection_select :default_country_iso, Spree::Country.order(:name), :iso, :name, { }, { data: { controller: 'autocomplete-select', enable_button_target: 'input', action: 'store-form#updateCurrency' } } %>
28
25
  </div>
29
26
 
27
+ <div class="form-group">
28
+ <%= f.label :default_locale %>
29
+ <%= f.select :default_locale, options_from_collection_for_select(all_locales_options, :last, :first, current_store.default_locale || I18n.locale), { }, { data: { controller: 'autocomplete-select', enable_button_target: 'input', action: 'store-form#updateCurrency' } } %>
30
+ </div>
31
+
30
32
  <div class="form-group">
31
33
  <%= f.label :default_currency, Spree.t(:currency) %>
32
34
  <%= f.currency_select :default_currency, preferred_currencies, {}, { data: { controller: 'autocomplete-select', enable_button_target: 'input', store_form_target: 'currency' } } %>
@@ -123,8 +125,8 @@
123
125
  </div>
124
126
  </div>
125
127
  </div>
126
- <div class="modal-footer justify-content-between">
127
- <button type="button" class="btn btn-light" data-dismiss="modal"><%= Spree.t('actions.discard') %></button>
128
+ <div class="modal-footer">
129
+ <%= modal_discard_button %>
128
130
  <%= turbo_save_button_tag Spree.t('actions.create') %>
129
131
  </div>
130
132
  </div>
@@ -3,28 +3,30 @@
3
3
  <% end %>
4
4
 
5
5
  <% content_for :page_actions do %>
6
- <%= button_link_to Spree.t(:new_tax_category), new_object_url, class: "btn-primary", icon: 'plus', id: 'admin_new_tax_categories_link' %>
6
+ <%= link_to_with_icon 'plus', Spree.t(:new_tax_category), new_object_url, class: "btn btn-primary" %>
7
7
  <% end if can? :create, Spree::TaxCategory %>
8
8
 
9
- <%= render partial: 'spree/admin/shared/tax_nav' %>
9
+ <%= render 'spree/admin/shared/tax_nav' %>
10
10
 
11
- <% if @tax_categories.any? %>
12
- <div class="table-responsive card-lg p-0">
13
- <table class="table" id='listing_tax_categories'>
14
- <thead class="text-muted">
15
- <tr>
16
- <th><%= Spree.t(:name) %></th>
17
- <th><%= Spree.t(:tax_code) %></th>
18
- <th><%= Spree.t(:description) %></th>
19
- <th><%= Spree.t(:default) %></th>
20
- <th></th>
21
- </tr>
22
- </thead>
23
- <tbody>
24
- <%= render collection: @tax_categories, partial: 'spree/admin/tax_categories/tax_category', cached: spree_base_cache_scope %>
25
- </tbody>
26
- </table>
27
- </div>
28
- <% else %>
29
- <%= render 'spree/admin/shared/no_resource_found' %>
30
- <% end %>
11
+ <div class="card-lg">
12
+ <% if @collection.any? %>
13
+ <div class="table-responsive">
14
+ <table class="table">
15
+ <thead class="text-muted">
16
+ <tr>
17
+ <th><%= Spree.t(:name) %></th>
18
+ <th><%= Spree.t(:tax_code) %></th>
19
+ <th><%= Spree.t(:description) %></th>
20
+ <th><%= Spree.t(:default) %></th>
21
+ <th></th>
22
+ </tr>
23
+ </thead>
24
+ <tbody>
25
+ <%= render collection: @collection, partial: 'spree/admin/tax_categories/tax_category', cached: spree_base_cache_scope %>
26
+ </tbody>
27
+ </table>
28
+ </div>
29
+ <% else %>
30
+ <%= render 'spree/admin/shared/no_resource_found' %>
31
+ <% end %>
32
+ </div>
@@ -3,30 +3,32 @@
3
3
  <% end %>
4
4
 
5
5
  <% content_for :page_actions do %>
6
- <%= button_link_to Spree.t(:new_tax_rate), new_object_url, class: "btn-primary", icon: 'plus' %>
6
+ <%= link_to_with_icon 'plus', Spree.t(:new_tax_rate), new_object_url, class: "btn btn-primary" %>
7
7
  <% end if can? :create, Spree::TaxRate %>
8
8
 
9
- <%= render partial: 'spree/admin/shared/tax_nav' %>
9
+ <%= render 'spree/admin/shared/tax_nav' %>
10
10
 
11
- <% if @tax_rates.any? %>
12
- <div class="table-responsive card-lg p-0">
13
- <table class="table" id='listing_tax_rates'>
14
- <thead class="text-muted">
15
- <tr data-hook="rate_header">
16
- <th><%= Spree.t(:name) %></th>
17
- <th><%= Spree.t(:tax_category) %></th>
18
- <th><%= Spree.t(:zone) %></th>
19
- <th><%= Spree.t(:amount) %></th>
20
- <th><%= Spree.t(:included_in_price) %></th>
21
- <th><%= Spree.t(:show_rate_in_label) %></th>
22
- <th></th>
23
- </tr>
24
- </thead>
25
- <tbody>
26
- <%= render partial: 'spree/admin/tax_rates/tax_rate', collection: @tax_rates, cached: spree_base_cache_scope %>
27
- </tbody>
28
- </table>
29
- </div>
30
- <% else %>
31
- <%= render 'spree/admin/shared/no_resource_found' %>
32
- <% end %>
11
+ <div class="card-lg">
12
+ <% if @collection.any? %>
13
+ <div class="table-responsive">
14
+ <table class="table">
15
+ <thead class="text-muted">
16
+ <tr data-hook="rate_header">
17
+ <th><%= Spree.t(:name) %></th>
18
+ <th><%= Spree.t(:tax_category) %></th>
19
+ <th><%= Spree.t(:zone) %></th>
20
+ <th><%= Spree.t(:amount) %></th>
21
+ <th><%= Spree.t(:included_in_price) %></th>
22
+ <th><%= Spree.t(:show_rate_in_label) %></th>
23
+ <th></th>
24
+ </tr>
25
+ </thead>
26
+ <tbody>
27
+ <%= render partial: 'spree/admin/tax_rates/tax_rate', collection: @collection, cached: spree_base_cache_scope %>
28
+ </tbody>
29
+ </table>
30
+ </div>
31
+ <% else %>
32
+ <%= render 'spree/admin/shared/no_resource_found' %>
33
+ <% end %>
34
+ </div>
@@ -3,11 +3,11 @@
3
3
  <% end %>
4
4
 
5
5
  <% content_for :page_actions do %>
6
- <%= button_link_to Spree.t(:new_taxonomy), new_object_url, { class: "btn-primary", icon: "plus" } %>
6
+ <%= link_to_with_icon 'plus', Spree.t(:new_taxonomy), new_object_url, class: "btn btn-primary" %>
7
7
  <% end if can?(:create, Spree::Taxonomy) %>
8
8
 
9
- <div class="card-lg p-0">
10
- <%= search_form_for [:admin, @search], class: "filter-wrap border-bottom", data: {controller: "filters reveal", reveal_hidden_class: "d-none"} do |f| %>
9
+ <div class="card-lg">
10
+ <%= search_form_for [:admin, @search], class: "filter-wrap", data: {controller: "filters reveal", reveal_hidden_class: "d-none"} do |f| %>
11
11
  <%= render 'spree/admin/shared/filters_search_bar', param: :name_cont, label: Spree.t(:name) %>
12
12
 
13
13
  <%= render "spree/admin/shared/filter_badge_template" %>
@@ -22,7 +22,7 @@
22
22
  <th class="no-border handel-head"></th>
23
23
  <th><%= Spree.t(:name) %></th>
24
24
  <th><%= Spree.t(:taxons) %></th>
25
- <th class="actions"></th>
25
+ <th></th>
26
26
  </tr>
27
27
  </thead>
28
28
  <tbody
@@ -4,8 +4,8 @@
4
4
  <% end %>
5
5
 
6
6
  <% content_for :page_actions do %>
7
- <%= button_link_to Spree.t(:new_taxon), spree.new_admin_taxonomy_taxon_path(@taxonomy), icon: 'plus', class: 'no-wrap btn btn-primary align-self-center' %>
8
- <% end %>
7
+ <%= link_to_with_icon 'plus', Spree.t(:new_taxon), spree.new_admin_taxonomy_taxon_path(@taxonomy), class: 'btn btn-primary' %>
8
+ <% end if can?(:create, Spree::Taxon) %>
9
9
 
10
10
  <% content_for :page_actions_dropdown do %>
11
11
  <%= link_to_edit(@taxonomy.root, url: spree.edit_admin_taxonomy_taxon_path(@taxonomy, @taxonomy.root.id), class: 'text-left dropdown-item') %>
@@ -2,16 +2,7 @@
2
2
  <% height ||= 72 %>
3
3
 
4
4
  <% if theme.screenshot.attached? && theme.screenshot.variable? %>
5
- <%= image_tag(
6
- main_app.cdn_image_url(
7
- theme.screenshot.variant(
8
- spree_image_variant_options(resize_to_fill: [width * 2, height * 2])
9
- )
10
- ),
11
- class: 'img-thumbnail',
12
- style: "width: #{width}px; height: #{height}px",
13
- loading: :lazy
14
- ) %>
5
+ <%= spree_image_tag(theme.screenshot, width: width, height: height, class: 'img-thumbnail', style: "width: #{width}px; height: #{height}px", loading: :lazy) %>
15
6
  <% elsif theme.class.preview_image_url.present? %>
16
7
  <%= image_tag(
17
8
  theme.class.preview_image_url,
@@ -26,7 +26,7 @@
26
26
  <% end %>
27
27
  <% end %>
28
28
 
29
- <div class="card-lg p-0">
29
+ <div class="card-lg">
30
30
  <div class="table-responsive rounded-lg">
31
31
  <table class="table">
32
32
  <thead class="text-muted">
@@ -44,7 +44,7 @@
44
44
  </div>
45
45
 
46
46
  <% if available_themes.any? %>
47
- <div class="card-lg p-0">
47
+ <div class="card-lg">
48
48
  <div class="card-header">
49
49
  <h5 class="card-title">Add a new theme</h5>
50
50
  </div>