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
@@ -1,6 +1,8 @@
1
1
  module Spree
2
2
  module Admin
3
3
  module StoresHelper
4
+ include Spree::ImagesHelper
5
+
4
6
  def available_stores
5
7
  @available_stores ||= Spree::Store.accessible_by(current_ability)
6
8
  end
@@ -18,31 +20,9 @@ module Spree
18
20
 
19
21
  Rails.cache.fetch(["#{store.cache_key_with_version}/admin_icon", opts.to_param]) do
20
22
  if store.logo&.attached? && store.logo&.variable?
21
- image_tag(
22
- main_app.cdn_image_url(
23
- store.logo.variant(
24
- spree_image_variant_options(
25
- resize_to_fill: [opts[:width] * 2, opts[:height] * 2]
26
- )
27
- )
28
- ),
29
- class: opts[:class],
30
- width: opts[:width],
31
- height: opts[:height]
32
- )
23
+ spree_image_tag(store.logo, class: opts[:class], width: opts[:width], height: opts[:height])
33
24
  elsif store.favicon_image&.attached? && store.favicon_image&.variable?
34
- image_tag(
35
- main_app.cdn_image_url(
36
- store.favicon_image.variant(
37
- spree_image_variant_options(
38
- resize_to_fill: [opts[:width] * 2, opts[:height] * 2]
39
- )
40
- )
41
- ),
42
- class: opts[:class],
43
- width: opts[:width],
44
- height: opts[:height]
45
- )
25
+ spree_image_tag(store.favicon_image, class: opts[:class], width: opts[:width], height: opts[:height])
46
26
  else
47
27
  first_letter_icon(store.name, opts)
48
28
  end
@@ -65,16 +45,7 @@ module Spree
65
45
  opts.merge!(options)
66
46
 
67
47
  if store.is_a?(Spree::Store) && store.logo&.attached? && store.logo&.variable?
68
- image_tag(
69
- main_app.cdn_image_url(
70
- store.logo.variant(
71
- spree_image_variant_options(
72
- resize_to_fill: [opts[:width] * 2, opts[:height] * 2]
73
- )
74
- )
75
- ),
76
- opts
77
- )
48
+ spree_image_tag(store.logo, class: opts[:class], width: opts[:width], height: opts[:height])
78
49
  else
79
50
  initials = store.name.split.map(&:first).join.upcase
80
51
  content_tag(:div, initials, class: "avatar rounded with-tip bg-light",
@@ -587,6 +587,12 @@ export default class extends CheckboxSelectAll {
587
587
  }
588
588
 
589
589
  keys.forEach((key) => {
590
+ const idInput = document.createElement('input')
591
+ idInput.type = 'hidden'
592
+ idInput.name = `product[variants_attributes][${i}][options][][id]`
593
+ idInput.value = Object.entries(this.optionsValue).find((option) => option[1].name === key)?.[0]
594
+ inputs.push(idInput)
595
+
590
596
  const nameInput = document.createElement('input')
591
597
  nameInput.type = 'hidden'
592
598
  nameInput.name = `product[variants_attributes][${i}][options][][name]`
@@ -18,14 +18,10 @@
18
18
  data-action="click->active-storage-upload#open"
19
19
  >
20
20
  <% if form.object.send(field_name).attached? && form.object.send(field_name).variable? %>
21
- <%= image_tag(
22
- main_app.cdn_image_url(
23
- form.object.send(field_name).variant(
24
- spree_image_variant_options(
25
- resize_to_fill: [width, (crop ? height : nil)]
26
- )
27
- )
28
- ),
21
+ <%= spree_image_tag(
22
+ form.object.send(field_name),
23
+ width: width,
24
+ height: height,
29
25
  class: 'img-fluid rounded-lg',
30
26
  data: { active_storage_upload_target: 'thumb' },
31
27
  loading: :lazy
@@ -1,11 +1,6 @@
1
1
  <%= turbo_frame_tag :dialog_modal_lg do %>
2
- <div class="modal-content" >
3
- <div class="modal-header">
4
- <h5 class="modal-title" id="exampleModalLabel">
5
- <%= Spree.t(:edit) %> <%= Spree.t(:image) %>
6
- </h5>
7
- <button type="button" class="btn-close" data-dismiss="modal" aria-label="<%= Spree.t(:close) %>" />
8
- </div>
2
+ <div class="modal-content">
3
+ <%= modal_header(Spree.t(:edit) + ' ' + Spree.t(:image)) %>
9
4
  <%= form_with model: @asset, url: spree.admin_asset_path(@asset), method: :put, scope: :asset do |f| %>
10
5
  <div class="modal-body pb-0" data-turbo-permanent id="asset-<%= @asset.key.parameterize %>">
11
6
  <%= render 'active_storage/upload_form', form: f, field_name: :attachment, width: 200, height: 200, can_delete: false %>
@@ -16,7 +11,7 @@
16
11
  <%= f.text_area :alt, rows: 4, class: 'form-control' %>
17
12
  </div>
18
13
  </div>
19
- <div class="modal-footer d-flex justify-content-between">
14
+ <div class="modal-footer">
20
15
  <%= turbo_save_button_tag %>
21
16
  <%= link_to Spree.t('actions.destroy'), object_url(@asset),
22
17
  data: { turbo_method: :delete, turbo_confirm: Spree.t(:are_you_sure_delete), turbo_frame: '_top' },
@@ -2,8 +2,8 @@
2
2
 
3
3
  <div class="row">
4
4
  <div class="col-12 col-lg-8">
5
- <div class="card-lg p-0">
6
- <%= search_form_for [:admin, @promotion, @search], class: "filter-wrap border-bottom" do |f| %>
5
+ <div class="card-lg">
6
+ <%= search_form_for [:admin, @promotion, @search], class: "filter-wrap" do |f| %>
7
7
  <div class="d-flex flex-column flex-lg-row gap-2">
8
8
  <%= render 'spree/admin/shared/filters_search_bar', param: :code_eq %>
9
9
 
@@ -54,13 +54,11 @@
54
54
  </tbody>
55
55
  </table>
56
56
  <% else %>
57
- <div class="text-muted p-5 d-flex align-items-center w-100 justify-content-center">
58
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::CouponCode)) %>
59
- </div>
57
+ <%= render 'spree/admin/shared/no_resource_found', new_object_url: nil %>
60
58
  <% end %>
61
59
  </div>
62
60
 
63
- <%= render 'spree/admin/shared/index_table_options', collection: @coupon_codes, simple: true if @coupon_codes.any? %>
61
+ <%= render 'spree/admin/shared/index_table_options', collection: @coupon_codes if @coupon_codes.any? %>
64
62
  </div>
65
63
  </div>
66
64
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  <% unless entri_enabled? %>
10
10
  <th>Default</th>
11
- <th class="actions"></th>
11
+ <th></th>
12
12
  <% end %>
13
13
  </tr>
14
14
  </thead>
@@ -5,7 +5,7 @@
5
5
  <%= Spree.t(:domains) %>
6
6
  <% end %>
7
7
 
8
- <div class="card-lg">
8
+ <div class="card-lg p-4">
9
9
  <h5 class="mb-3">Internal URL</h5>
10
10
  <div class="row mb-4">
11
11
  <div class="col-lg-4">
@@ -5,9 +5,9 @@
5
5
  <% content_for :page_title do %>
6
6
  <%= Spree.t(:customer_returns) %>
7
7
  <% end %>
8
- <div class="card-lg p-0">
9
8
 
10
- <%= search_form_for [:admin, @search], url: spree.admin_customer_returns_path, 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], url: spree.admin_customer_returns_path, class: "filter-wrap", data: {controller: "filters reveal", reveal_hidden_class: "d-none"} do |f| %>
11
11
  <%= render "spree/admin/shared/filters_search_bar",
12
12
  param: :number_cont,
13
13
  label: Spree.t(:number) %>
@@ -37,21 +37,8 @@
37
37
  </tbody>
38
38
  </table>
39
39
  </div>
40
+ <%= render 'spree/admin/shared/index_table_options', collection: @collection %>
40
41
  <% else %>
41
- <div
42
- class="
43
- text-muted p-5 d-flex align-items-center w-100 justify-content-center
44
- "
45
- >
46
- <%= Spree.t(
47
- :no_resource_found,
48
- resource: plural_resource_name(Spree::CustomerReturn),
49
- ) %>
50
- </div>
42
+ <%= render 'spree/admin/shared/no_resource_found', new_object_url: nil %>
51
43
  <% end %>
52
-
53
- <%= render partial: "spree/admin/shared/index_table_options",
54
- locals: {
55
- collection: @collection,
56
- } %>
57
44
  </div>
@@ -2,12 +2,14 @@
2
2
  <div class="card-body">
3
3
  <div class="mb-3">
4
4
  Your overall setup progress
5
- <span class="float-right badge badge-<%= current_store.setup_completed? ? 'success' : 'light' %>">
5
+ <span class="float-right badge badge-<%= current_store.setup_completed? ? 'success' : 'info' %>">
6
6
  <% if current_store.setup_completed? %>
7
7
  <%= icon('check', class: 'text-success') %>
8
8
  <% end %>
9
9
 
10
- <%= current_store.setup_tasks_done %> of <%= current_store.setup_tasks_total %> steps done
10
+ <span>
11
+ <strong><%= current_store.setup_tasks_done %></strong> of <%= current_store.setup_tasks_total %> steps done
12
+ </span>
11
13
  </span>
12
14
  </div>
13
15
  <div class="progress">
@@ -17,7 +17,7 @@
17
17
  <%= render 'spree/admin/shared/calendar_range_picker',
18
18
  date_from_value: params[:date_from] || 1.month.ago.beginning_of_month,
19
19
  date_to_value: params[:date_to] || 1.month.ago.end_of_month,
20
- css_classes: "btn btn-sm border hover-light d-inline-flex align-items-center h-100 dropdown-toggle" %>
20
+ css_classes: "btn btn-sm border rounded-lg hover-light d-inline-flex align-items-center h-100 dropdown-toggle" %>
21
21
  <% end %>
22
22
  </div>
23
23
  <%= render 'analytics' %>
@@ -6,7 +6,7 @@
6
6
  <% end %>
7
7
  <th><%= Spree.t(:name) %></th>
8
8
  <th><%= Spree.t(:size) %></th>
9
- <th class="actions"></th>
9
+ <th></th>
10
10
  </tr>
11
11
  </thead>
12
12
  <tbody>
@@ -1,20 +1,12 @@
1
1
  <%= turbo_frame_tag :dialog_modal do %>
2
2
  <%= form_for :digital_asset, url: spree.admin_product_digital_asset_path(@product, @digital_asset), method: :put do |f| %>
3
3
  <div class="modal-content">
4
- <div class="modal-header">
5
- <h5 class="modal-title" id="exampleModalLabel"><%= @digital_asset.attachment.filename %></h5>
6
- <button
7
- type="button"
8
- class="btn-close"
9
- data-dismiss="modal"
10
- aria-label="<%= Spree.t(:close) %>"
11
- />
12
- </div>
4
+ <%= modal_header(@digital_asset.attachment.filename) %>
13
5
  <div class="modal-body">
14
6
  <%= render "spree/admin/digital_assets/form", f: f %>
15
7
  </div>
16
- <div class="modal-footer d-flex justify-content-between">
17
- <button type="button" class="btn btn-light" data-dismiss="modal"><%= Spree.t("actions.discard") %></button>
8
+ <div class="modal-footer">
9
+ <%= modal_discard_button %>
18
10
  <%= turbo_save_button_tag Spree.t("actions.save"), data: { turbo_frame: :_top } %>
19
11
  </div>
20
12
  </div>
@@ -1,20 +1,12 @@
1
1
  <%= turbo_frame_tag :dialog_modal do %>
2
2
  <%= form_for :digital_asset, url: spree.admin_product_digital_assets_path(@product) do |f| %>
3
3
  <div class="modal-content">
4
- <div class="modal-header">
5
- <h5 class="modal-title" id="exampleModalLabel"><%= Spree.t(:new_digital_asset) %></h5>
6
- <button
7
- type="button"
8
- class="btn-close"
9
- data-dismiss="modal"
10
- aria-label="<%= Spree.t(:close) %>"
11
- />
12
- </div>
4
+ <%= modal_header(Spree.t(:new_digital_asset)) %>
13
5
  <div class="modal-body">
14
6
  <%= render "spree/admin/digital_assets/form", f: f %>
15
7
  </div>
16
- <div class="modal-footer d-flex justify-content-between">
17
- <button type="button" class="btn btn-light" data-dismiss="modal"><%= Spree.t("actions.discard") %></button>
8
+ <div class="modal-footer">
9
+ <%= modal_discard_button %>
18
10
  <%= turbo_save_button_tag Spree.t("actions.save"), data: { turbo_frame: :_top } %>
19
11
  </div>
20
12
  </div>
@@ -1,30 +1,28 @@
1
1
  <%= render 'spree/admin/shared/audit_nav' %>
2
2
 
3
- <% if @collection.present? %>
4
- <div class="table-responsive card-lg p-0">
5
- <table class="table">
6
- <thead class="text-muted">
7
- <tr>
8
- <th><%= Spree.t(:number) %></th>
9
- <th class="text-center"><%= Spree.t(:kind) %></th>
10
- <th class="text-center"><%= Spree.t(:status) %></th>
11
- <th><%= Spree.t(:user) %></th>
12
- <th><%= Spree.t(:filename) %></th>
13
- <th><%= Spree.t(:date) %></th>
14
- <th><%= Spree.t(:size) %></th>
15
- <th class="text-center"><%= Spree.t(:download) %></th>
16
- </tr>
17
- </thead>
3
+ <div class="card-lg">
4
+ <% if @collection.any? %>
5
+ <div class="table-responsive">
6
+ <table class="table">
7
+ <thead class="text-muted">
8
+ <tr>
9
+ <th><%= Spree.t(:number) %></th>
10
+ <th class="text-center"><%= Spree.t(:kind) %></th>
11
+ <th class="text-center"><%= Spree.t(:status) %></th>
12
+ <th><%= Spree.t(:user) %></th>
13
+ <th><%= Spree.t(:filename) %></th>
14
+ <th><%= Spree.t(:date) %></th>
15
+ <th><%= Spree.t(:size) %></th>
16
+ <th class="text-center"><%= Spree.t(:download) %></th>
17
+ </tr>
18
+ </thead>
18
19
  <tbody>
19
- <%= render partial: 'export', collection: @exports, cached: true %>
20
+ <%= render partial: 'export', collection: @collection, cached: true %>
20
21
  </tbody>
21
22
  </table>
23
+ <%= render 'spree/admin/shared/index_table_options', collection: @collection %>
22
24
  </div>
23
- </div>
24
- <% else %>
25
- <div class="text-muted p-5 d-flex align-items-center w-100 justify-content-center">
26
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(model_class)) %>
27
- </div>
28
- <% end %>
29
-
30
- <%= render 'spree/admin/shared/index_table_options', collection: @imports, simple: true if @imports.present? %>
25
+ <% else %>
26
+ <%= render 'spree/admin/shared/no_resource_found', new_object_url: nil %>
27
+ <% end %>
28
+ </div>
@@ -3,13 +3,7 @@
3
3
  <%= f.hidden_field :type %>
4
4
  <%= f.hidden_field :search_params %>
5
5
  <div class="modal-content">
6
- <div class="modal-header">
7
- <h5 class="modal-title" id="exampleModalLabel">
8
- <%= Spree.t(:export) %>
9
- <%= plural_resource_name(@export.model_class) %>
10
- </h5>
11
- <button type="button" class="btn-close" data-dismiss="modal" aria-label="<%= Spree.t(:close) %>" />
12
- </div>
6
+ <%= modal_header(Spree.t(:export) + ' ' + plural_resource_name(@export.model_class)) %>
13
7
  <div class="modal-body">
14
8
  <%= render 'spree/admin/shared/error_messages', target: @export %>
15
9
  <div class="custom-control custom-radio">
@@ -33,8 +27,8 @@
33
27
  <% end %>
34
28
  </div>
35
29
  </div>
36
- <div class="modal-footer d-flex justify-content-between">
37
- <button type="button" class="btn btn-light" data-dismiss="modal"><%= Spree.t('actions.discard') %></button>
30
+ <div class="modal-footer">
31
+ <%= modal_discard_button %>
38
32
  <%= turbo_save_button_tag Spree.t(:export), class: 'btn btn-primary' %>
39
33
  </div>
40
34
  </div>
@@ -1,9 +1,6 @@
1
1
  <%= turbo_frame_tag :dialog_modal do %>
2
2
  <div class="modal-content" data-controller="search-picker">
3
- <div class="modal-header">
4
- <h5 class="modal-title" id="exampleModalLabel"><%= Spree.t(:add_variant) %></h5>
5
- <button type="button" class="btn-close" data-dismiss="modal" aria-label="<%= Spree.t(:close) %>" />
6
- </div>
3
+ <%= modal_header(Spree.t(:add_variant)) %>
7
4
  <div class="modal-body border-bottom">
8
5
  <%= form_with url: spree.admin_variants_search_path, method: :post, data: { controller: 'auto-submit', turbo_frame: '_top' } do |form| %>
9
6
  <%= form.hidden_field :omit_ids, value: @order.variant_ids.join(',') %>
@@ -20,7 +17,7 @@
20
17
  </p>
21
18
  </div>
22
19
  </div>
23
- <div class="modal-footer d-flex justify-content-between border-top">
20
+ <div class="modal-footer border-top">
24
21
  <div class="d-flex gap-2 m-0 align-items-center">
25
22
  <%= form.label :quantity, Spree.t(:quantity), class: "mb-0" %>
26
23
  <%= form.number_field :quantity, class: "form-control", min: 1 %>
@@ -3,7 +3,7 @@
3
3
  <%= content_for(:title, Spree.t('admin.oauth_applications.list')) %>
4
4
 
5
5
  <% content_for :page_actions do %>
6
- <%= button_link_to Spree.t('admin.oauth_applications.new'), new_object_url, class: "btn-primary", icon: 'plus' %>
6
+ <%= link_to_with_icon 'plus', Spree.t('admin.oauth_applications.new'), new_object_url, class: "btn btn-primary" %>
7
7
  <% end if can? :create, Spree::OauthApplication %>
8
8
 
9
9
  <%= content_for :page_alerts do %>
@@ -15,61 +15,60 @@
15
15
  </div>
16
16
  <% end %>
17
17
 
18
- <% if @oauth_applications.any? %>
19
- <div class="table-responsive rounded border mt-4 bg-white">
20
- <table class="table">
21
- <thead class="text-muted">
22
- <tr>
23
- <th><%= Spree.t(:name) %></th>
24
- <th>Client ID</th>
25
- <th><%= Spree.t('admin.oauth_applications.scopes') %></th>
26
- <th><%= Spree.t('admin.oauth_applications.last_used') %></th>
27
- <th class="actions"></th>
28
- </tr>
29
- </thead>
30
- <tbody>
31
- <% @oauth_applications.each do |application| %>
32
- <tr id="<%= spree_dom_id application %>">
33
- <td class="w-20"><code><%= application.name %></code></td>
34
- <td class="w-40">
35
- <div class="input-group" data-controller="password-toggle">
36
- <%= button_tag class: 'btn hover-gray px-1', data: { action: 'click->password-toggle#password' } do %>
37
- <%= icon 'eye', class: 'mr-0' %>
38
- <% end %>
39
- <%= password_field_tag :password, application.uid, class: 'form-control-plaintext', data: { password_toggle_target: 'unhide' }, readonly: true %>
40
- </div>
41
- </td>
42
- <td class="w-15">
43
- <% if application.scopes.include?('write') %>
44
- <span class="badge badge-warning">
45
- <%= icon('pencil', class: 'mr-1') %>
46
- <%= Spree.t('admin.oauth_applications.read_and_write') %>
47
- </span>
48
- <% else %>
49
- <span class="badge badge-light">
50
- <%= icon('eye', class: 'mr-1') %>
51
- <%= Spree.t('admin.oauth_applications.read_only') %>
52
- </span>
53
- <% end %>
54
- </td>
55
- <td class="w-15">
56
- <% if application.last_used_at %>
57
- <%= local_time(application.last_used_at) %>
58
- <% else %>
59
- <span class="text-muted"><%= Spree.t('admin.oauth_applications.never') %></span>
60
- <% end %>
61
- </td>
62
- <td class="actions w-10">
63
- <%= link_to_edit(application, no_text: true) if can? :edit, application %>
64
- </td>
18
+ <div class="card-lg">
19
+ <% if @collection.any? %>
20
+ <div class="table-responsive">
21
+ <table class="table">
22
+ <thead class="text-muted">
23
+ <tr>
24
+ <th><%= Spree.t(:name) %></th>
25
+ <th>Client ID</th>
26
+ <th><%= Spree.t('admin.oauth_applications.scopes') %></th>
27
+ <th><%= Spree.t('admin.oauth_applications.last_used') %></th>
28
+ <th></th>
65
29
  </tr>
66
- <% end %>
67
- </tbody>
68
- </table>
69
- </div>
70
- <% else %>
71
- <div class="text-muted p-5 d-flex align-items-center w-100 justify-content-center">
72
- <%= Spree.t(:no_resource_found, resource: 'API keys') %>
73
- <%= link_to_with_icon('plus', Spree.t(:add_one), new_object_url, class: 'btn btn-link ml-3') if can? :create, Spree::OauthApplication %>
74
- </div>
75
- <% end %>
30
+ </thead>
31
+ <tbody>
32
+ <% @collection.each do |application| %>
33
+ <tr id="<%= spree_dom_id application %>">
34
+ <td class="w-20"><code><%= application.name %></code></td>
35
+ <td class="w-40">
36
+ <div class="input-group" data-controller="password-toggle">
37
+ <%= button_tag class: 'btn hover-gray px-1', data: { action: 'click->password-toggle#password' } do %>
38
+ <%= icon 'eye', class: 'mr-0' %>
39
+ <% end %>
40
+ <%= password_field_tag :password, application.uid, class: 'form-control-plaintext', data: { password_toggle_target: 'unhide' }, readonly: true %>
41
+ </div>
42
+ </td>
43
+ <td class="w-15">
44
+ <% if application.scopes.include?('write') %>
45
+ <span class="badge badge-warning">
46
+ <%= icon('pencil', class: 'mr-1') %>
47
+ <%= Spree.t('admin.oauth_applications.read_and_write') %>
48
+ </span>
49
+ <% else %>
50
+ <span class="badge badge-light">
51
+ <%= icon('eye', class: 'mr-1') %>
52
+ <%= Spree.t('admin.oauth_applications.read_only') %>
53
+ </span>
54
+ <% end %>
55
+ </td>
56
+ <td class="w-15">
57
+ <% if application.last_used_at %>
58
+ <%= local_time(application.last_used_at) %>
59
+ <% else %>
60
+ <span class="text-muted"><%= Spree.t('admin.oauth_applications.never') %></span>
61
+ <% end %>
62
+ </td>
63
+ <td class="actions w-10">
64
+ <%= link_to_edit(application, no_text: true) if can? :edit, application %>
65
+ </td>
66
+ </tr>
67
+ <% end %>
68
+ </tbody>
69
+ </table>
70
+ </div>
71
+ <% else %>
72
+ <%= render 'spree/admin/shared/no_resource_found', resource_name: 'API keys' %>
73
+ <% end %>
74
+ </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
  <%= 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" %>
@@ -3,11 +3,7 @@
3
3
  <% end %>
4
4
 
5
5
  <% content_for :page_actions do %>
6
- <span id="new_ot_link">
7
- <%= button_link_to Spree.t(:new_option_type),
8
- new_object_url,
9
- { class: "btn-primary", icon: "plus", id: "new_option_type_link" } %>
10
- </span>
6
+ <%= link_to_with_icon 'plus', Spree.t(:new_option_type), new_object_url, class: 'btn btn-primary' %>
11
7
  <% end if can?(:create, Spree::OptionType) %>
12
8
 
13
9
  <%= content_for(:page_alerts) do %>
@@ -17,12 +13,8 @@
17
13
  </div>
18
14
  <% end %>
19
15
 
20
- <div id="new_option_type"></div>
21
-
22
- <div class="card-lg p-0">
23
-
16
+ <div class="card-lg">
24
17
  <%= render partial: "spree/admin/option_types/filter" %>
25
-
26
18
  <% if @option_types.any? %>
27
19
  <div class="table-responsive">
28
20
  <table class="table" id="listing_option_types">
@@ -44,7 +36,7 @@
44
36
  <th>
45
37
  <%= Spree.t(:products) %>
46
38
  </th>
47
- <th class="actions"></th>
39
+ <th></th>
48
40
  </tr>
49
41
  </thead>
50
42
  <tbody
@@ -61,3 +53,7 @@
61
53
  <%= render "spree/admin/shared/no_resource_found" %>
62
54
  <% end %>
63
55
  </div>
56
+
57
+ <p class="documentation-link-container">
58
+ <%= external_link_to "Learn more about options", "https://spreecommerce.org/docs/user/manage-products/product-options" %>
59
+ </p>
@@ -2,7 +2,7 @@
2
2
 
3
3
  <%= search_form_for [:admin, @vendor || @user, @search],
4
4
  url: controller_name == 'checkouts' ? spree.admin_checkouts_path : nil,
5
- class: "filter-wrap border-bottom",
5
+ class: "filter-wrap",
6
6
  data: {
7
7
  controller: "filters reveal",
8
8
  reveal_hidden_class: "d-none",
@@ -92,12 +92,7 @@
92
92
  <%= render_admin_partials(:orders_filters_partials, f: f) %>
93
93
  </div>
94
94
 
95
- <div class="form-actions">
96
- <%= turbo_save_button_tag Spree.t(:filter_results) do %>
97
- <%= icon("search") %>
98
- <%= Spree.t(:filter_results) %>
99
- <% end %>
100
- </div>
95
+ <%= render 'spree/admin/shared/filter_submit' %>
101
96
  </div>
102
97
 
103
98
  <%= render "spree/admin/shared/filter_badge_template" %>
@@ -23,8 +23,6 @@
23
23
  </table>
24
24
  </div>
25
25
  <% else %>
26
- <div class="text-muted p-5 d-flex align-items-center w-100 justify-content-center">
27
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Order)) %>
28
- </div>
26
+ <%= render 'spree/admin/shared/no_resource_found', new_object_url: nil, model_class: Spree::Order %>
29
27
  <% end %>
30
- <%= render 'spree/admin/shared/index_table_options', collection: @orders, simple: true if @orders.any? %>
28
+ <%= render 'spree/admin/shared/index_table_options', collection: @orders if @orders.any? %>
@@ -1,10 +1,7 @@
1
1
  <%= turbo_stream.update :dialog_modal do %>
2
2
  <%= form_for @address, url: spree.admin_order_billing_address_path(@order), data: {controller: 'auto-submit', form_target: 'form', 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_billing_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_billing_address)) %>
8
5
  <div class="modal-body d-flex flex-col gap-3" data-controller="order-billing-address">
9
6
  <div>
10
7
  <% if @order.shipping_address.present? %>
@@ -26,8 +23,8 @@
26
23
  </div>
27
24
  <%= render 'form', address: @address, f: f %>
28
25
  </div>
29
- <div class="modal-footer d-flex justify-content-between">
30
- <button type="button" class="btn btn-light" data-dismiss="modal"><%= Spree.t('actions.discard') %></button>
26
+ <div class="modal-footer">
27
+ <%= modal_discard_button %>
31
28
  <%= turbo_save_button_tag Spree.t('actions.save') %>
32
29
  </div>
33
30
  </div>