Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

DRY-up admin views and utilize universal partials/components (#12991)

Damian Legawiec945a6252b57f
diff --git a/.claude/settings.local.json b/.claude/settings.local.json
index 8fd79474dc..80865b9403 100644
--- a/.claude/settings.local.json
+++ b/.claude/settings.local.json
@@ -5,8 +5,10 @@
"Bash(find:*)",
"Bash(bundle exec rspec:*)",
"Bash(bundle exec rails c:*)",
- "Bash(ruby test:*)"
+ "Bash(ruby test:*)",
+ "Bash(mv:*)"
],
"deny": []
- }
+ },
+ "$schema": "https://json.schemastore.org/claude-code-settings.json"
}
\ No newline at end of file
diff --git a/admin/app/controllers/spree/admin/return_authorizations_controller.rb b/admin/app/controllers/spree/admin/return_authorizations_controller.rb
index 1cacc562df..d9e73324be 100644
--- a/admin/app/controllers/spree/admin/return_authorizations_controller.rb
+++ b/admin/app/controllers/spree/admin/return_authorizations_controller.rb
@@ -1,6 +1,9 @@
module Spree
module Admin
class ReturnAuthorizationsController < ResourceController
+ add_breadcrumb_icon 'receipt-refund'
+ add_breadcrumb Spree.t(:returns), :admin_customer_returns_path
+
def index; end
def cancel
diff --git a/admin/app/views/spree/admin/admin_users/index.html.erb b/admin/app/views/spree/admin/admin_users/index.html.erb
index 66933b4f69..d7bc45cd21 100644
--- a/admin/app/views/spree/admin/admin_users/index.html.erb
+++ b/admin/app/views/spree/admin/admin_users/index.html.erb
@@ -11,9 +11,9 @@
<table class="table">
<thead>
<tr>
- <th class="rounded-lg-top-left"><%= Spree.t(:user) %></th>
- <th><%= Spree.t(:roles) %></th>
- <th class="rounded-lg-top-right"><%= sort_link @search, :created_at, Spree.t(:created_at) %></th>
+ <th scope="col" class="rounded-lg-top-left"><%= Spree.t(:user) %></th>
+ <th scope="col"><%= Spree.t(:roles) %></th>
+ <th scope="col" class="rounded-lg-top-right"><%= sort_link @search, :created_at, Spree.t(:created_at) %></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/coupon_codes/_coupon_code.html.erb b/admin/app/views/spree/admin/coupon_codes/_coupon_code.html.erb
deleted file mode 100644
index 3475122021..0000000000
--- a/admin/app/views/spree/admin/coupon_codes/_coupon_code.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-<tr id="spree_coupon_code_<%= coupon_code[0] %>">
- <td class="w-50">
- <code><%= coupon_code[1].upcase %></code>
- <%= clipboard_component(coupon_code[1].upcase) %>
- </td>
- <td class="w-25 font-size-sm"><%= active_badge(coupon_code[2] == 'used') %></td>
- <td class="w-25 font-size-sm"><%= local_time(coupon_code[3]) %></td>
-</tr>
diff --git a/admin/app/views/spree/admin/coupon_codes/_filters.html.erb b/admin/app/views/spree/admin/coupon_codes/_filters.html.erb
new file mode 100644
index 0000000000..18247fc64f
--- /dev/null
+++ b/admin/app/views/spree/admin/coupon_codes/_filters.html.erb
@@ -0,0 +1,38 @@
+<%= search_form_for [:admin, @promotion, @search], class: "filter-wrap", data: {controller: "filters"} do |f| %>
+ <div class="d-flex flex-column flex-lg-row gap-2">
+ <%= render 'spree/admin/shared/filters_search_bar', param: :code_i_cont %>
+
+ <div class="d-flex align-items-center justify-content-between">
+ <div class="dropdown">
+ <button class="btn btn-light dropdown-toggle" type="button" data-toggle="dropdown" data-display="static" data-flip="false" aria-expanded="false">
+ <span class="text-muted font-weight-normal mr-1">
+ <%= Spree.t(:show) %>
+ </span>
+ <%= Spree.t(:all) if (params[:q] || {}).values_at(:state_eq).all?(&:blank?) %>
+ <%= Spree.t('admin.coupon_codes.used') if params.dig(:q, :state_eq) == 'used' %>
+ <%= Spree.t('admin.coupon_codes.unused') if params.dig(:q, :state_eq) == 'unused' %>
+ </button>
+ <div class="dropdown-menu w-100 font-size-sm" style="min-width: 200px">
+ <%= active_link_to Spree.t(:all),
+ spree.admin_promotion_coupon_codes_path(@promotion),
+ class: 'dropdown-item',
+ active: (params[:q] || {}).values_at(:state_eq).all?(&:blank?) %>
+ <%= link_to Spree.t('admin.coupon_codes.used'),
+ spree.admin_promotion_coupon_codes_path(@promotion, q: {state_eq: :used}),
+ class: "dropdown-item #{'active' if params.dig(:q, :state_eq) == 'used'}" %>
+ <%= link_to Spree.t('admin.coupon_codes.unused'),
+ spree.admin_promotion_coupon_codes_path(@promotion, q: {state_eq: :unused}),
+ class: "dropdown-item #{'active' if params.dig(:q, :state_eq) == 'unused'}" %>
+ </div>
+ </div>
+ </div>
+
+ <%= link_to spree.admin_promotion_coupon_codes_path(@promotion, format: :csv), class: 'btn btn-light bg-transparent with-tip', title: 'Download coupons as a CSV file' do %>
+ <%= icon 'download' %>
+ <%= Spree.t(:download) %>
+ <% end %>
+ </div>
+
+ <%= render "spree/admin/shared/filter_badge_template" %>
+ <div data-filters-target="badgesContainer" class="filter-badges-container"></div>
+<% end %>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/coupon_codes/_table_header.html.erb b/admin/app/views/spree/admin/coupon_codes/_table_header.html.erb
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/admin/app/views/spree/admin/coupon_codes/_table_row.html.erb b/admin/app/views/spree/admin/coupon_codes/_table_row.html.erb
new file mode 100644
index 0000000000..81ddff6d7e
--- /dev/null
+++ b/admin/app/views/spree/admin/coupon_codes/_table_row.html.erb
@@ -0,0 +1,8 @@
+<tr id="<%= spree_dom_id coupon_code %>">
+ <td class="w-50">
+ <code><%= coupon_code.code.upcase %></code>
+ <%= clipboard_component(coupon_code.code.upcase) %>
+ </td>
+ <td class="w-25 font-size-sm"><%= active_badge(coupon_code.state == 'used') %></td>
+ <td class="w-25 font-size-sm"><%= local_time(coupon_code.created_at) %></td>
+</tr>
diff --git a/admin/app/views/spree/admin/coupon_codes/index.html.erb b/admin/app/views/spree/admin/coupon_codes/index.html.erb
index e9d9a27395..9e0c41b2d1 100644
--- a/admin/app/views/spree/admin/coupon_codes/index.html.erb
+++ b/admin/app/views/spree/admin/coupon_codes/index.html.erb
@@ -8,64 +8,7 @@
<div class="row">
<div class="col-12 col-lg-8">
- <div class="card-lg">
- <%= search_form_for [:admin, @promotion, @search], class: "filter-wrap" do |f| %>
- <div class="d-flex flex-column flex-lg-row gap-2">
- <%= render 'spree/admin/shared/filters_search_bar', param: :code_eq %>
-
- <div class="d-flex align-items-center justify-content-between">
- <div class="dropdown">
- <button class="btn btn-light dropdown-toggle" type="button" data-toggle="dropdown" data-display="static" data-flip="false" aria-expanded="false">
- <span class="text-muted font-weight-normal mr-1">
- <%= Spree.t(:show) %>
- </span>
- <%= Spree.t(:all) if (params[:q] || {}).values_at(:state_eq).all?(&:blank?) %>
- <%= Spree.t('admin.coupon_codes.used') if params.dig(:q, :state_eq) == 'used' %>
- <%= Spree.t('admin.coupon_codes.unused') if params.dig(:q, :state_eq) == 'unused' %>
- </button>
- <div class="dropdown-menu w-100 font-size-sm" style="min-width: 200px">
- <%= active_link_to Spree.t(:all),
- spree.admin_promotion_coupon_codes_path(@promotion),
- class: 'dropdown-item',
- active: (params[:q] || {}).values_at(:state_eq).all?(&:blank?) %>
- <%= link_to Spree.t('admin.coupon_codes.used'),
- spree.admin_promotion_coupon_codes_path(@promotion, q: {state_eq: :used}),
- class: "dropdown-item #{'active' if params.dig(:q, :state_eq) == 'used'}" %>
- <%= link_to Spree.t('admin.coupon_codes.unused'),
- spree.admin_promotion_coupon_codes_path(@promotion, q: {state_eq: :unused}),
- class: "dropdown-item #{'active' if params.dig(:q, :state_eq) == 'unused'}" %>
- </div>
- </div>
- </div>
-
- <%= link_to spree.admin_promotion_coupon_codes_path(@promotion, format: :csv), class: 'btn btn-light bg-transparent with-tip', title: 'Download coupons as a CSV file' do %>
- <%= icon 'download' %>
- <%= Spree.t(:download) %>
- <% end %>
- </div>
- <% end %>
-
- <div class="table-responsive">
- <% if @coupon_codes.any? %>
- <table class="table">
- <thead>
- <tr data-hook="rate_header">
- <th><%= Spree.t(:code) %></th>
- <th><%= Spree.t(:used) %></th>
- <th><%= Spree.t(:created_at) %></th>
- </tr>
- </thead>
- <tbody>
- <%= render collection: @coupon_codes.pluck(:id, :code, :state, :created_at), partial: 'spree/admin/coupon_codes/coupon_code', cached: spree_base_cache_scope %>
- </tbody>
- </table>
- <% else %>
- <%= render 'spree/admin/shared/no_resource_found', new_object_url: nil %>
- <% end %>
- </div>
-
- <%= render 'spree/admin/shared/index_table_options', collection: @coupon_codes if @coupon_codes.any? %>
- </div>
+ <%= render 'spree/admin/shared/index_table', new_object_url: nil %>
</div>
<div class="col-12 col-lg-4">
diff --git a/admin/app/views/spree/admin/custom_domains/_custom_domains.html.erb b/admin/app/views/spree/admin/custom_domains/_custom_domains.html.erb
index 082eab5755..bf0aa38a32 100644
--- a/admin/app/views/spree/admin/custom_domains/_custom_domains.html.erb
+++ b/admin/app/views/spree/admin/custom_domains/_custom_domains.html.erb
@@ -3,10 +3,10 @@
<table class="table">
<thead>
<tr>
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:active) %>?</th>
- <th><%= Spree.t(:default) %>?</th>
- <th></th>
+ <th scope="col"><%= Spree.t(:name) %></th>
+ <th scope="col"><%= Spree.t(:active) %>?</th>
+ <th scope="col"><%= Spree.t(:default) %>?</th>
+ <th scope="col"></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/customer_returns/_table_header.html.erb b/admin/app/views/spree/admin/customer_returns/_table_header.html.erb
new file mode 100644
index 0000000000..cc78dd4d8c
--- /dev/null
+++ b/admin/app/views/spree/admin/customer_returns/_table_header.html.erb
@@ -0,0 +1,8 @@
+<tr data-hook="rate_header">
+ <th scope="col"><%= Spree.t(:number) %></th>
+ <th scope="col"><%= Spree.t(:created_at) %></th>
+ <th scope="col"><%= Spree.t(:customer) %></th>
+ <th scope="col"><%= Spree.t(:order) %></th>
+ <th scope="col"><%= Spree.t(:reimbursement_status) %></th>
+ <th scope="col"><%= Spree.t(:pre_tax_total) %></th>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/customer_returns/_customer_return.html.erb b/admin/app/views/spree/admin/customer_returns/_table_row.html.erb
similarity index 100%
rename from admin/app/views/spree/admin/customer_returns/_customer_return.html.erb
rename to admin/app/views/spree/admin/customer_returns/_table_row.html.erb
diff --git a/admin/app/views/spree/admin/customer_returns/_filters.html.erb b/admin/app/views/spree/admin/customer_returns/filters.html.erb
similarity index 100%
rename from admin/app/views/spree/admin/customer_returns/_filters.html.erb
rename to admin/app/views/spree/admin/customer_returns/filters.html.erb
diff --git a/admin/app/views/spree/admin/customer_returns/index.html.erb b/admin/app/views/spree/admin/customer_returns/index.html.erb
index e395089a57..db2b1cbccd 100644
--- a/admin/app/views/spree/admin/customer_returns/index.html.erb
+++ b/admin/app/views/spree/admin/customer_returns/index.html.erb
@@ -12,31 +12,4 @@
<%= render_admin_partials(:customer_returns_header_partials) %>
-<div class="card-lg">
- <%= render 'filters' %>
-
- <% if @collection.any? %>
- <div class="table-responsive">
- <table class="table">
- <thead>
- <tr data-hook="rate_header">
- <th><%= Spree.t(:number) %></th>
- <th><%= Spree.t(:created_at) %></th>
- <th><%= Spree.t(:customer) %></th>
- <th><%= Spree.t(:order) %></th>
- <th><%= Spree.t(:reimbursement_status) %></th>
- <th><%= Spree.t(:pre_tax_total) %></th>
- </tr>
- </thead>
- <tbody>
- <%= render collection: @collection,
- partial: "spree/admin/customer_returns/customer_return",
- cached: spree_base_cache_scope %>
- </tbody>
- </table>
- </div>
- <%= render 'spree/admin/shared/index_table_options', collection: @collection %>
- <% else %>
- <%= render 'spree/admin/shared/no_resource_found', new_object_url: nil %>
- <% end %>
-</div>
+<%= render 'spree/admin/shared/index_table', new_object_url: nil %>
diff --git a/admin/app/views/spree/admin/dashboard/_top_products.html.erb b/admin/app/views/spree/admin/dashboard/_top_products.html.erb
index 318d65ebb2..22843fe0c9 100644
--- a/admin/app/views/spree/admin/dashboard/_top_products.html.erb
+++ b/admin/app/views/spree/admin/dashboard/_top_products.html.erb
@@ -14,15 +14,15 @@
<table class="table">
<thead>
<tr class="border-bottom">
- <th>
+ <th scope="col">
<%= Spree.t(:product) %>
</th>
<% if defined?(Spree::Vendor) && !@vendor %>
- <th>
+ <th scope="col">
<%= Spree.t(:vendor) %>
</th>
<% end %>
- <th>
+ <th scope="col">
<%= Spree.t(:price) %>
</th>
<th class="text-center">
diff --git a/admin/app/views/spree/admin/digital_assets/_table.html.erb b/admin/app/views/spree/admin/digital_assets/_table.html.erb
index 73eedc9087..6924b7ef51 100644
--- a/admin/app/views/spree/admin/digital_assets/_table.html.erb
+++ b/admin/app/views/spree/admin/digital_assets/_table.html.erb
@@ -2,11 +2,11 @@
<thead>
<tr>
<% if @product.has_variants? %>
- <th><%= Spree.t(:variant) %></th>
+ <th scope="col"><%= Spree.t(:variant) %></th>
<% end %>
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:size) %></th>
- <th></th>
+ <th scope="col"><%= Spree.t(:name) %></th>
+ <th scope="col"><%= Spree.t(:size) %></th>
+ <th scope="col"></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/exports/index.html.erb b/admin/app/views/spree/admin/exports/index.html.erb
index 72ff38101f..9f5f02c138 100644
--- a/admin/app/views/spree/admin/exports/index.html.erb
+++ b/admin/app/views/spree/admin/exports/index.html.erb
@@ -12,13 +12,13 @@
<table class="table">
<thead>
<tr>
- <th><%= Spree.t(:number) %></th>
+ <th scope="col"><%= Spree.t(:number) %></th>
<th class="text-center"><%= Spree.t(:kind) %></th>
<th class="text-center"><%= Spree.t(:status) %></th>
- <th><%= Spree.t(:user) %></th>
- <th><%= Spree.t(:filename) %></th>
- <th><%= Spree.t(:date) %></th>
- <th><%= Spree.t(:size) %></th>
+ <th scope="col"><%= Spree.t(:user) %></th>
+ <th scope="col"><%= Spree.t(:filename) %></th>
+ <th scope="col"><%= Spree.t(:date) %></th>
+ <th scope="col"><%= Spree.t(:size) %></th>
<th class="text-center"><%= Spree.t(:download) %></th>
</tr>
</thead>
diff --git a/admin/app/views/spree/admin/gift_cards/_list.html.erb b/admin/app/views/spree/admin/gift_cards/_list.html.erb
index 3877d6acc2..ba0d030154 100644
--- a/admin/app/views/spree/admin/gift_cards/_list.html.erb
+++ b/admin/app/views/spree/admin/gift_cards/_list.html.erb
@@ -3,13 +3,13 @@
<table class="table">
<thead class="text-muted">
<tr>
- <th><%= Spree.t(:code) %></th>
- <th><%= Spree.t(:amount) %></th>
- <th><%= Spree.t(:used) %></th>
- <th><%= Spree.t(:currency) %></th>
- <th><%= Spree.t(:status) %></th>
- <th><%= Spree.t(:expires_at) %></th>
- <th><%= Spree.t(:customer) %></th>
+ <th scope="col"><%= Spree.t(:code) %></th>
+ <th scope="col"><%= Spree.t(:amount) %></th>
+ <th scope="col"><%= Spree.t(:used) %></th>
+ <th scope="col"><%= Spree.t(:currency) %></th>
+ <th scope="col"><%= Spree.t(:status) %></th>
+ <th scope="col"><%= Spree.t(:expires_at) %></th>
+ <th scope="col"><%= Spree.t(:customer) %></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/gift_cards/show.html.erb b/admin/app/views/spree/admin/gift_cards/show.html.erb
index 970d07339b..7ba55654ec 100644
--- a/admin/app/views/spree/admin/gift_cards/show.html.erb
+++ b/admin/app/views/spree/admin/gift_cards/show.html.erb
@@ -41,9 +41,9 @@
<table class="table">
<thead>
<tr>
- <th><%= Spree.t(:order) %></th>
- <th><%= Spree.t(:status) %></th>
- <th><%= Spree.t(:customer) %></th>
+ <th scope="col"><%= Spree.t(:order) %></th>
+ <th scope="col"><%= Spree.t(:status) %></th>
+ <th scope="col"><%= Spree.t(:customer) %></th>
<th class="text-right"><%= I18n.t('activerecord.attributes.spree/gift_card.amount_used') %></th>
<th class="text-right"><%= Spree.t(:total) %></th>
</tr>
diff --git a/admin/app/views/spree/admin/invitations/index.html.erb b/admin/app/views/spree/admin/invitations/index.html.erb
index 17ddf6ec85..529f4a0433 100644
--- a/admin/app/views/spree/admin/invitations/index.html.erb
+++ b/admin/app/views/spree/admin/invitations/index.html.erb
@@ -11,12 +11,12 @@
<table class="table">
<thead>
<tr>
- <th class="rounded-lg-top-left"><%= Spree.t(:email) %></th>
- <th><%= I18n.t('activerecord.attributes.spree/invitation.inviter') %></th>
- <th><%= Spree.t(:role_id) %></th>
- <th><%= Spree.t(:status) %></th>
- <th class="rounded-lg-top-right"><%= sort_link @search, :created_at, Spree.t(:created_at) %></th>
- <th></th>
+ <th scope="col" class="rounded-lg-top-left"><%= Spree.t(:email) %></th>
+ <th scope="col"><%= I18n.t('activerecord.attributes.spree/invitation.inviter') %></th>
+ <th scope="col"><%= Spree.t(:role_id) %></th>
+ <th scope="col"><%= Spree.t(:status) %></th>
+ <th scope="col" class="rounded-lg-top-right"><%= sort_link @search, :created_at, Spree.t(:created_at) %></th>
+ <th scope="col"></th>
</tr>
</thead>
<tbody id="invitations">
diff --git a/admin/app/views/spree/admin/oauth_applications/_form.html.erb b/admin/app/views/spree/admin/oauth_applications/_form.html.erb
index b25e13030c..0ddab6fba7 100644
--- a/admin/app/views/spree/admin/oauth_applications/_form.html.erb
+++ b/admin/app/views/spree/admin/oauth_applications/_form.html.erb
@@ -1,11 +1,15 @@
-<div class="form-group">
- <%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
- <%= f.text_field :name, class: 'form-control', required: true, autofocus: f.object.new_record? %>
- <%= f.error_message_on :name %>
-</div>
+<div class="card mb-4">
+ <div class="card-body">
+ <div class="form-group">
+ <%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
+ <%= f.text_field :name, class: 'form-control', required: true, autofocus: f.object.new_record? %>
+ <%= f.error_message_on :name %>
+ </div>
-<div class="form-group">
- <%= f.label :scopes, raw(Spree.t(:scopes) + required_span_tag) %>
- <%= f.select :scopes, [['Read Only', 'admin read'], ['Read & Write', 'admin write']], { selected: @oauth_application.scopes.to_s }, { class: 'custom-select' } %>
- <%= f.error_message_on :scopes %>
+ <div class="form-group">
+ <%= f.label :scopes, raw(Spree.t(:scopes) + required_span_tag) %>
+ <%= f.select :scopes, [['Read Only', 'admin read'], ['Read & Write', 'admin write']], { selected: @oauth_application.scopes.to_s }, { class: 'custom-select' } %>
+ <%= f.error_message_on :scopes %>
+ </div>
+ </div>
</div>
diff --git a/admin/app/views/spree/admin/oauth_applications/_table_header.html.erb b/admin/app/views/spree/admin/oauth_applications/_table_header.html.erb
new file mode 100644
index 0000000000..41fdef37d5
--- /dev/null
+++ b/admin/app/views/spree/admin/oauth_applications/_table_header.html.erb
@@ -0,0 +1,7 @@
+<tr>
+ <th scope="col"><%= Spree.t(:name) %></th>
+ <th scope="col"><%= Spree.t('admin.oauth_applications.client_id') %></th>
+ <th scope="col"><%= Spree.t('admin.oauth_applications.scopes') %></th>
+ <th scope="col"><%= Spree.t('admin.oauth_applications.last_used') %></th>
+ <th scope="col"></th>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/oauth_applications/_table_row.html.erb b/admin/app/views/spree/admin/oauth_applications/_table_row.html.erb
new file mode 100644
index 0000000000..f6c6b25b8f
--- /dev/null
+++ b/admin/app/views/spree/admin/oauth_applications/_table_row.html.erb
@@ -0,0 +1,34 @@
+<tr id="<%= spree_dom_id oauth_application %>">
+ <td class="w-20"><code><%= oauth_application.name %></code></td>
+ <td class="w-40">
+ <div class="input-group" data-controller="password-toggle">
+ <%= button_tag class: 'btn hover-gray px-1', data: { action: 'click->password-toggle#password' } do %>
+ <%= icon 'eye', class: 'mr-0' %>
+ <% end %>
+ <%= password_field_tag :password, oauth_application.uid, class: 'form-control-plaintext', data: { password_toggle_target: 'unhide' }, readonly: true %>
+ </div>
+ </td>
+ <td class="w-15">
+ <% if oauth_application.scopes.include?('write') %>
+ <span class="badge badge-warning">
+ <%= icon('pencil', class: 'mr-1') %>
+ <%= Spree.t('admin.oauth_applications.read_and_write') %>
+ </span>
+ <% else %>
+ <span class="badge badge-light">
+ <%= icon('eye', class: 'mr-1') %>
+ <%= Spree.t('admin.oauth_applications.read_only') %>
+ </span>
+ <% end %>
+ </td>
+ <td class="w-15">
+ <% if oauth_application.last_used_at %>
+ <%= local_time(oauth_application.last_used_at) %>
+ <% else %>
+ <span class="text-muted"><%= Spree.t('admin.oauth_applications.never') %></span>
+ <% end %>
+ </td>
+ <td class="actions w-10">
+ <%= link_to_edit(oauth_application, no_text: true, data: { turbo_frame: '_top' }) if can? :edit, oauth_application %>
+ </td>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/oauth_applications/index.html.erb b/admin/app/views/spree/admin/oauth_applications/index.html.erb
index 86db681887..520c38b3da 100644
--- a/admin/app/views/spree/admin/oauth_applications/index.html.erb
+++ b/admin/app/views/spree/admin/oauth_applications/index.html.erb
@@ -4,8 +4,8 @@
<% content_for :page_actions do %>
<%= render_admin_partials(:oauth_applications_actions_partials) %>
- <%= link_to_with_icon 'plus', Spree.t('admin.oauth_applications.new'), new_object_url, class: "btn btn-primary" %>
-<% end if can? :create, Spree::OauthApplication %>
+ <%= link_to_with_icon 'plus', Spree.t('admin.oauth_applications.new'), new_object_url, class: "btn btn-primary" if can? :create, Spree::OauthApplication %>
+<% end %>
<%= content_for :page_alerts do %>
<div class="alert alert-info mb-3">
@@ -18,60 +18,4 @@
<%= render_admin_partials(:oauth_applications_header_partials) %>
-<div class="card-lg">
- <% if @collection.any? %>
- <div class="table-responsive">
- <table class="table">
- <thead>
- <tr>
- <th><%= Spree.t(:name) %></th>
- <th>Client ID</th>
- <th><%= Spree.t('admin.oauth_applications.scopes') %></th>
- <th><%= Spree.t('admin.oauth_applications.last_used') %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <% @collection.each do |application| %>
- <tr id="<%= spree_dom_id application %>">
- <td class="w-20"><code><%= application.name %></code></td>
- <td class="w-40">
- <div class="input-group" data-controller="password-toggle">
- <%= button_tag class: 'btn hover-gray px-1', data: { action: 'click->password-toggle#password' } do %>
- <%= icon 'eye', class: 'mr-0' %>
- <% end %>
- <%= password_field_tag :password, application.uid, class: 'form-control-plaintext', data: { password_toggle_target: 'unhide' }, readonly: true %>
- </div>
- </td>
- <td class="w-15">
- <% if application.scopes.include?('write') %>
- <span class="badge badge-warning">
- <%= icon('pencil', class: 'mr-1') %>
- <%= Spree.t('admin.oauth_applications.read_and_write') %>
- </span>
- <% else %>
- <span class="badge badge-light">
- <%= icon('eye', class: 'mr-1') %>
- <%= Spree.t('admin.oauth_applications.read_only') %>
- </span>
- <% end %>
- </td>
- <td class="w-15">
- <% if application.last_used_at %>
- <%= local_time(application.last_used_at) %>
- <% else %>
- <span class="text-muted"><%= Spree.t('admin.oauth_applications.never') %></span>
- <% end %>
- </td>
- <td class="actions w-10">
- <%= link_to_edit(application, no_text: true) if can? :edit, application %>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
- <% else %>
- <%= render 'spree/admin/shared/no_resource_found', resource_name: 'API keys' %>
- <% end %>
-</div>
+<%= render 'spree/admin/shared/index_table' %>
diff --git a/admin/app/views/spree/admin/option_types/_form.html.erb b/admin/app/views/spree/admin/option_types/_form.html.erb
index c46e994bbc..4b0f59bdf3 100644
--- a/admin/app/views/spree/admin/option_types/_form.html.erb
+++ b/admin/app/views/spree/admin/option_types/_form.html.erb
@@ -57,10 +57,10 @@
<table class="table">
<thead>
<tr class="border-bottom">
- <th></th>
- <th><%= raw(Spree.t(:presentation) + required_span_tag) %></th>
- <th><%= raw(Spree.t(:internal_name) + required_span_tag) %></th>
- <th></th>
+ <th scope="col"></th>
+ <th scope="col"><%= raw(Spree.t(:presentation) + required_span_tag) %></th>
+ <th scope="col"><%= raw(Spree.t(:internal_name) + required_span_tag) %></th>
+ <th scope="col"></th>
</tr>
</thead>
<tbody id="option_values" data-controller="sortable" data-sortable-handle-value=".move-handle" data-sortable-resource-name-value="option_value" data-sortable-response-kind-value="turbo-stream">
diff --git a/admin/app/views/spree/admin/option_types/_table_header.html.erb b/admin/app/views/spree/admin/option_types/_table_header.html.erb
index c438fae7d6..75a7f40a5a 100644
--- a/admin/app/views/spree/admin/option_types/_table_header.html.erb
+++ b/admin/app/views/spree/admin/option_types/_table_header.html.erb
@@ -1,19 +1,19 @@
<tr>
<th class="no-border handel-head"></th>
- <th><%= Spree.t(:internal_name) %></th>
- <th>
+ <th scope="col"><%= Spree.t(:internal_name) %></th>
+ <th scope="col">
<%= Spree.t(:presentation) %>
<%= help_bubble("How this option is presented to customers") %>
</th>
- <th>
+ <th scope="col">
<%= Spree.t(:filterable) %>
<%= help_bubble("Whether this option can be used in product filters") %>
</th>
- <th>
+ <th scope="col">
<%= Spree.t(:option_values) %>
</th>
- <th>
+ <th scope="col">
<%= Spree.t(:products) %>
</th>
- <th></th>
+ <th scope="col"></th>
</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/orders/_customer_returns.html.erb b/admin/app/views/spree/admin/orders/_customer_returns.html.erb
index e27b9edb63..5c891f03c3 100644
--- a/admin/app/views/spree/admin/orders/_customer_returns.html.erb
+++ b/admin/app/views/spree/admin/orders/_customer_returns.html.erb
@@ -9,10 +9,10 @@
<table class="table">
<thead class="border-bottom">
<tr>
- <th><%= Spree.t(:date) %></th>
- <th><%= Spree.t(:status) %></th>
- <th><%= Spree.t(:pre_tax_total) %></th>
- <th></th>
+ <th scope="col"><%= Spree.t(:date) %></th>
+ <th scope="col"><%= Spree.t(:status) %></th>
+ <th scope="col"><%= Spree.t(:pre_tax_total) %></th>
+ <th scope="col"></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/orders/_list.html.erb b/admin/app/views/spree/admin/orders/_list.html.erb
index fe0079ced5..ca532207e7 100644
--- a/admin/app/views/spree/admin/orders/_list.html.erb
+++ b/admin/app/views/spree/admin/orders/_list.html.erb
@@ -3,16 +3,16 @@
<table class="table" id="listing_orders">
<thead>
<tr>
- <th><%= I18n.t(:number, scope: 'activerecord.attributes.spree/order') %></th>
+ <th scope="col"><%= I18n.t(:number, scope: 'activerecord.attributes.spree/order') %></th>
<% if controller_name == 'orders' %>
- <th><%= sort_link @search, :completed_at, Spree.t(:date) %></th>
+ <th scope="col"><%= sort_link @search, :completed_at, Spree.t(:date) %></th>
<% else %>
- <th><%= sort_link @search, :created_at, Spree.t(:date) %></th>
+ <th scope="col"><%= sort_link @search, :created_at, Spree.t(:date) %></th>
<% end %>
<th class="d-customer"><%= Spree.t(:customer) %></th>
- <th><%= Spree.t(:package_from) %></th>
- <th><%= I18n.t(:payment_state, scope: 'activerecord.attributes.spree/order') %></th>
- <th><%= I18n.t(:shipment_state, scope: 'activerecord.attributes.spree/order') %></th>
+ <th scope="col"><%= Spree.t(:package_from) %></th>
+ <th scope="col"><%= I18n.t(:payment_state, scope: 'activerecord.attributes.spree/order') %></th>
+ <th scope="col"><%= I18n.t(:shipment_state, scope: 'activerecord.attributes.spree/order') %></th>
<th class="text-right"><%= sort_link @search, :item_count, I18n.t(:item_count, scope: 'activerecord.attributes.spree/order') %></th>
<th class="text-right"><%= sort_link @search, :total, I18n.t(:total, scope: 'activerecord.attributes.spree/order') %></th>
</tr>
diff --git a/admin/app/views/spree/admin/orders/_refunds.html.erb b/admin/app/views/spree/admin/orders/_refunds.html.erb
index 3c2439cabd..3c678279a1 100644
--- a/admin/app/views/spree/admin/orders/_refunds.html.erb
+++ b/admin/app/views/spree/admin/orders/_refunds.html.erb
@@ -12,11 +12,11 @@
<table class="table table-condensed" id='refunds' data-order-id='<%= @order.number %>'>
<thead>
<tr data-hook="refunds_header" class="border-bottom">
- <th><%= Spree.t(:amount) %></th>
- <th><%= Spree.t(:status) %></th>
- <th><%= Spree.t(:reason) %></th>
- <th><%= "#{Spree.t('date')}/#{Spree.t('time')}" %></th>
- <th></th>
+ <th scope="col"><%= Spree.t(:amount) %></th>
+ <th scope="col"><%= Spree.t(:status) %></th>
+ <th scope="col"><%= Spree.t(:reason) %></th>
+ <th scope="col"><%= "#{Spree.t('date')}/#{Spree.t('time')}" %></th>
+ <th scope="col"></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/orders/_return_authorizations.html.erb b/admin/app/views/spree/admin/orders/_return_authorizations.html.erb
index 565da0a9d4..f7d8a90a24 100644
--- a/admin/app/views/spree/admin/orders/_return_authorizations.html.erb
+++ b/admin/app/views/spree/admin/orders/_return_authorizations.html.erb
@@ -9,11 +9,11 @@
<table class="table">
<thead class="border-bottom">
<tr>
- <th><%= Spree.t(:rma_number) %></th>
- <th><%= Spree.t(:status) %></th>
- <th><%= Spree.t(:pre_tax_total) %></th>
- <th><%= "#{Spree.t("date")}/#{Spree.t("time")}" %></th>
- <th></th>
+ <th scope="col"><%= Spree.t(:rma_number) %></th>
+ <th scope="col"><%= Spree.t(:status) %></th>
+ <th scope="col"><%= Spree.t(:pre_tax_total) %></th>
+ <th scope="col"><%= "#{Spree.t("date")}/#{Spree.t("time")}" %></th>
+ <th scope="col"></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/orders/customer_returns/_reimbursements_table.html.erb b/admin/app/views/spree/admin/orders/customer_returns/_reimbursements_table.html.erb
index 996ae995f7..79c7d8400b 100644
--- a/admin/app/views/spree/admin/orders/customer_returns/_reimbursements_table.html.erb
+++ b/admin/app/views/spree/admin/orders/customer_returns/_reimbursements_table.html.erb
@@ -1,10 +1,10 @@
<table class="table table-condensed">
<thead>
<tr>
- <th><%= Spree.t(:number) %></th>
- <th><%= Spree.t(:total) %></th>
- <th><%= Spree.t(:status) %></th>
- <th><%= Spree.t(:date) %></th>
+ <th scope="col"><%= Spree.t(:number) %></th>
+ <th scope="col"><%= Spree.t(:total) %></th>
+ <th scope="col"><%= Spree.t(:status) %></th>
+ <th scope="col"><%= Spree.t(:date) %></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/orders/customer_returns/_return_item_decision.html.erb b/admin/app/views/spree/admin/orders/customer_returns/_return_item_decision.html.erb
index ef93818ba3..f1d77a777f 100644
--- a/admin/app/views/spree/admin/orders/customer_returns/_return_item_decision.html.erb
+++ b/admin/app/views/spree/admin/orders/customer_returns/_return_item_decision.html.erb
@@ -1,13 +1,13 @@
<table class="show return-items-table table table-condensed index">
<thead>
<tr>
- <th><%= Spree.t(:product) %></th>
- <th><%= Spree.t(:pre_tax_amount) %></th>
- <th><%= Spree.t(:preferred_reimbursement_type) %></th>
- <th><%= Spree.t(:exchange_for) %></th>
- <th><%= Spree.t(:acceptance_errors) %></th>
+ <th scope="col"><%= Spree.t(:product) %></th>
+ <th scope="col"><%= Spree.t(:pre_tax_amount) %></th>
+ <th scope="col"><%= Spree.t(:preferred_reimbursement_type) %></th>
+ <th scope="col"><%= Spree.t(:exchange_for) %></th>
+ <th scope="col"><%= Spree.t(:acceptance_errors) %></th>
<% if show_decision %>
- <th></th>
+ <th scope="col"></th>
<% end %>
</tr>
</thead>
diff --git a/admin/app/views/spree/admin/orders/customer_returns/_return_item_selection.html.erb b/admin/app/views/spree/admin/orders/customer_returns/_return_item_selection.html.erb
index 3ce2c8702e..316d9fa673 100644
--- a/admin/app/views/spree/admin/orders/customer_returns/_return_item_selection.html.erb
+++ b/admin/app/views/spree/admin/orders/customer_returns/_return_item_selection.html.erb
@@ -2,7 +2,7 @@
<table class="table">
<thead class="border-bottom">
<tr>
- <th>
+ <th scope="col">
<div class="custom-control custom-checkbox ml-1">
<input
type="checkbox"
@@ -13,11 +13,11 @@
<label class="custom-control-label" for="checkAllMasterCheckbox"><span></span></label>
</div>
</th>
- <th><%= Spree.t(:product) %></th>
- <th><%= Spree.t(:sku) %></th>
- <th><%= Spree.t(:pre_tax_amount) %></th>
- <th><%= Spree.t(:exchange_for) %></th>
- <th><%= Spree.t(:resellable) %></th>
+ <th scope="col"><%= Spree.t(:product) %></th>
+ <th scope="col"><%= Spree.t(:sku) %></th>
+ <th scope="col"><%= Spree.t(:pre_tax_amount) %></th>
+ <th scope="col"><%= Spree.t(:exchange_for) %></th>
+ <th scope="col"><%= Spree.t(:resellable) %></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/orders/return_authorizations/_form.html.erb b/admin/app/views/spree/admin/orders/return_authorizations/_form.html.erb
index c88e256cd2..ba772bfc9c 100644
--- a/admin/app/views/spree/admin/orders/return_authorizations/_form.html.erb
+++ b/admin/app/views/spree/admin/orders/return_authorizations/_form.html.erb
@@ -5,7 +5,7 @@
<table class="table table-condensed return-items-table">
<thead>
<tr>
- <th>
+ <th scope="col">
<% if allow_return_item_changes %>
<div class="custom-control custom-checkbox ml-1">
<input
@@ -18,14 +18,14 @@
</div>
<% end %>
</th>
- <th><%= Spree.t(:product) %></th>
- <th><%= Spree.t(:status) %></th>
- <th><%= Spree.t(:charged) %></th>
- <th><%= Spree.t(:purchased_quantity) %></th>
+ <th scope="col"><%= Spree.t(:product) %></th>
+ <th scope="col"><%= Spree.t(:status) %></th>
+ <th scope="col"><%= Spree.t(:charged) %></th>
+ <th scope="col"><%= Spree.t(:purchased_quantity) %></th>
<th style="min-width:130px;"><%= Spree.t(:return_quantity) %></th>
<th style="min-width:150px;"><%= Spree.t(:pre_tax_refund_amount) %></th>
- <th><%= Spree.t(:reimbursement_type) %></th>
- <th><%= Spree.t(:exchange_for) %></th>
+ <th scope="col"><%= Spree.t(:reimbursement_type) %></th>
+ <th scope="col"><%= Spree.t(:exchange_for) %></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/orders/return_authorizations/show.html.erb b/admin/app/views/spree/admin/orders/return_authorizations/show.html.erb
index 5ed39f9229..0c1b02d365 100644
--- a/admin/app/views/spree/admin/orders/return_authorizations/show.html.erb
+++ b/admin/app/views/spree/admin/orders/return_authorizations/show.html.erb
@@ -29,14 +29,14 @@ locals: {
<table class="table table-condensed return-items-table">
<thead>
<tr>
- <th><%= Spree.t(:product) %></th>
- <th><%= Spree.t(:status) %></th>
- <th><%= Spree.t(:purchased_quantity) %></th>
- <th><%= Spree.t(:return_quantity) %></th>
- <th><%= Spree.t(:total) %></th>
- <th><%= Spree.t(:refund_amount) %></th>
- <th><%= Spree.t(:reimbursement_type) %></th>
- <th><%= Spree.t(:exchange_for) %></th>
+ <th scope="col"><%= Spree.t(:product) %></th>
+ <th scope="col"><%= Spree.t(:status) %></th>
+ <th scope="col"><%= Spree.t(:purchased_quantity) %></th>
+ <th scope="col"><%= Spree.t(:return_quantity) %></th>
+ <th scope="col"><%= Spree.t(:total) %></th>
+ <th scope="col"><%= Spree.t(:refund_amount) %></th>
+ <th scope="col"><%= Spree.t(:reimbursement_type) %></th>
+ <th scope="col"><%= Spree.t(:exchange_for) %></th>
</tr>
</thead>
<tbody>
@@ -104,10 +104,10 @@ locals: {
<table class="table table-condensed">
<thead>
<tr>
- <th><%= Spree.t(:reimbursement_type) %></th>
- <th><%= Spree.t(:description) %></th>
- <th><%= Spree.t(:status) %></th>
- <th><%= Spree.t(:amount) %></th>
+ <th scope="col"><%= Spree.t(:reimbursement_type) %></th>
+ <th scope="col"><%= Spree.t(:description) %></th>
+ <th scope="col"><%= Spree.t(:status) %></th>
+ <th scope="col"><%= Spree.t(:amount) %></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/pages/_table_header.html.erb b/admin/app/views/spree/admin/pages/_table_header.html.erb
new file mode 100644
index 0000000000..d3a16708c3
--- /dev/null
+++ b/admin/app/views/spree/admin/pages/_table_header.html.erb
@@ -0,0 +1,6 @@
+<tr>
+ <th scope="col"><%= sort_link @search, :name, Spree.t(:name) %></th>
+ <th scope="col"><%= sort_link @search, :created_at, Spree.t(:created_at) %></th>
+ <th scope="col"><%= sort_link @search, :updated_at, Spree.t(:updated_at) %></th>
+ <th scope="col"></th>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/pages/_page.html.erb b/admin/app/views/spree/admin/pages/_table_row.html.erb
similarity index 99%
rename from admin/app/views/spree/admin/pages/_page.html.erb
rename to admin/app/views/spree/admin/pages/_table_row.html.erb
index f4704fbce2..43f60c760d 100644
--- a/admin/app/views/spree/admin/pages/_page.html.erb
+++ b/admin/app/views/spree/admin/pages/_table_row.html.erb
@@ -23,4 +23,4 @@
</ul>
</div>
</td>
-</tr>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/pages/_filters.html.erb b/admin/app/views/spree/admin/pages/filters.html.erb
similarity index 100%
rename from admin/app/views/spree/admin/pages/_filters.html.erb
rename to admin/app/views/spree/admin/pages/filters.html.erb
diff --git a/admin/app/views/spree/admin/pages/index.html.erb b/admin/app/views/spree/admin/pages/index.html.erb
index 670300f5f7..e4ca2ffb47 100644
--- a/admin/app/views/spree/admin/pages/index.html.erb
+++ b/admin/app/views/spree/admin/pages/index.html.erb
@@ -8,27 +8,4 @@
<%= render_admin_partials(:pages_header_partials) %>
-<div class="card-lg">
- <%= render "spree/admin/pages/filters" %>
- <% if @collection.any? %>
- <div class="table-responsive">
- <table class="table">
- <thead>
- <tr>
- <th><%= sort_link @search, :name, Spree.t(:name) %></th>
- <th><%= sort_link @search, :created_at, Spree.t(:created_at) %></th>
- <th><%= sort_link @search, :updated_at, Spree.t(:updated_at) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <% default_theme = current_store.default_theme %>
- <%= render collection: @collection, partial: "spree/admin/pages/page", cached: ->(page) { [*spree_base_cache_scope.call(page), default_theme] } %>
- </tbody>
- </table>
- <%= render "spree/admin/shared/index_table_options", collection: @collection %>
- </div>
- <% else %>
- <%= render 'spree/admin/shared/no_resource_found' %>
- <% end %>
-</div>
+<%= render 'spree/admin/shared/index_table' %>
diff --git a/admin/app/views/spree/admin/payment_methods/index.html.erb b/admin/app/views/spree/admin/payment_methods/index.html.erb
index e7c60f5b05..28b58bf8f5 100644
--- a/admin/app/views/spree/admin/payment_methods/index.html.erb
+++ b/admin/app/views/spree/admin/payment_methods/index.html.erb
@@ -13,11 +13,11 @@
<table class="table">
<thead>
<tr>
- <th></th>
- <th><%= Spree.t(:payment_method) %></th>
- <th><%= Spree.t(:visibility) %></th>
+ <th scope="col"></th>
+ <th scope="col"><%= Spree.t(:payment_method) %></th>
+ <th scope="col"><%= Spree.t(:visibility) %></th>
<th class="text-center"><%= Spree.t(:active) %></th>
- <th></th>
+ <th scope="col"></th>
</tr>
</thead>
<tbody data-controller="sortable" data-sortable-handle-value=".move-handle" data-sortable-resource-name-value="payment_method" data-sortable-response-kind-value="turbo-stream">
@@ -34,9 +34,9 @@
<table class="table">
<thead>
<tr>
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:description) %></th>
- <th></th>
+ <th scope="col"><%= Spree.t(:name) %></th>
+ <th scope="col"><%= Spree.t(:description) %></th>
+ <th scope="col"></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/payments/source_views/_gateway.html.erb b/admin/app/views/spree/admin/payments/source_views/_gateway.html.erb
index 317f84cdb5..c153d44bc0 100644
--- a/admin/app/views/spree/admin/payments/source_views/_gateway.html.erb
+++ b/admin/app/views/spree/admin/payments/source_views/_gateway.html.erb
@@ -6,15 +6,15 @@
<td><%= payment.source.name %></td>
</tr>
<tr>
- <th><%= Spree.t(:card_type) %>:</th>
+ <th scope="col"><%= Spree.t(:card_type) %>:</th>
<td><%= payment.source.display_brand %></td>
</tr>
<tr>
- <th><%= Spree.t(:card_number) %>:</th>
+ <th scope="col"><%= Spree.t(:card_number) %>:</th>
<td><%= payment.source.display_number %></td>
</tr>
<tr>
- <th><%= Spree.t(:expiration) %>:</th>
+ <th scope="col"><%= Spree.t(:expiration) %>:</th>
<td><%= payment.source.month %>/<%= payment.source.year %></td>
</tr>
</table>
diff --git a/admin/app/views/spree/admin/payments/source_views/_storecredit.html.erb b/admin/app/views/spree/admin/payments/source_views/_storecredit.html.erb
index 1dbdae344e..852e06c384 100644
--- a/admin/app/views/spree/admin/payments/source_views/_storecredit.html.erb
+++ b/admin/app/views/spree/admin/payments/source_views/_storecredit.html.erb
@@ -7,23 +7,23 @@
<td><%= payment.source.display_amount_used %></td>
</tr>
<tr>
- <th><%= Spree.t(:amount) %>:</th>
+ <th scope="col"><%= Spree.t(:amount) %>:</th>
<td><%= payment.source.display_amount %></td>
</tr>
<tr>
- <th><%= Spree.t(:memo) %>:</th>
+ <th scope="col"><%= Spree.t(:memo) %>:</th>
<td><%= payment.source.memo %></td>
</tr>
<tr>
- <th><%= Spree.t(:type) %>:</th>
+ <th scope="col"><%= Spree.t(:type) %>:</th>
<td><%= payment.source.category_name %></td>
</tr>
<tr>
- <th><%= Spree.t(:created_by) %>:</th>
+ <th scope="col"><%= Spree.t(:created_by) %>:</th>
<td><%= payment.source.created_by_email %></td>
</tr>
<tr>
- <th><%= Spree.t(:issued_on) %>:</th>
+ <th scope="col"><%= Spree.t(:issued_on) %>:</th>
<td><%= local_time(payment.source.created_at) %></td>
</tr>
</table>
diff --git a/admin/app/views/spree/admin/post_categories/_table_header.html.erb b/admin/app/views/spree/admin/post_categories/_table_header.html.erb
new file mode 100644
index 0000000000..bb4f619fe3
--- /dev/null
+++ b/admin/app/views/spree/admin/post_categories/_table_header.html.erb
@@ -0,0 +1,5 @@
+<tr>
+ <th scope="col"><%= Spree.t(:title) %></th>
+ <th scope="col"><%= Spree.t(:posts) %></th>
+ <th scope="col"></th>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/post_categories/_post_category.html.erb b/admin/app/views/spree/admin/post_categories/_table_row.html.erb
similarity index 98%
rename from admin/app/views/spree/admin/post_categories/_post_category.html.erb
rename to admin/app/views/spree/admin/post_categories/_table_row.html.erb
index 51522df09d..ce32ac443b 100644
--- a/admin/app/views/spree/admin/post_categories/_post_category.html.erb
+++ b/admin/app/views/spree/admin/post_categories/_table_row.html.erb
@@ -6,4 +6,4 @@
<td class="w-10 cursor-pointer text-right" data-action="click->row-link#openLink">
<%= link_to_edit(post_category, class: 'btn btn-light btn-sm') if can? :edit, post_category %>
</td>
-</tr>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/post_categories/index.html.erb b/admin/app/views/spree/admin/post_categories/index.html.erb
index e04dee918b..1016e81a93 100644
--- a/admin/app/views/spree/admin/post_categories/index.html.erb
+++ b/admin/app/views/spree/admin/post_categories/index.html.erb
@@ -7,23 +7,4 @@
<%= render_admin_partials(:post_categories_header_partials) %>
-<% if @collection.any? %>
- <div class="card-lg">
- <div class="table-responsive rounded-lg">
- <table class="table">
- <thead>
- <tr>
- <th><%= Spree.t(:title) %></th>
- <th><%= Spree.t(:posts) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <%= render collection: @collection, partial: 'spree/admin/post_categories/post_category', cached: spree_base_cache_scope %>
- </tbody>
- </table>
- </div>
- </div>
-<% else %>
- <%= render 'spree/admin/shared/no_resource_found' %>
-<% end %>
+<%= render 'spree/admin/shared/index_table' %>
diff --git a/admin/app/views/spree/admin/posts/_table_header.html.erb b/admin/app/views/spree/admin/posts/_table_header.html.erb
new file mode 100644
index 0000000000..1dae4c8c51
--- /dev/null
+++ b/admin/app/views/spree/admin/posts/_table_header.html.erb
@@ -0,0 +1,7 @@
+<tr>
+ <th scope="col"><%= sort_link @search, :title, Spree.t(:title) %></th>
+ <th scope="col"><%= Spree.t(:category) %></th>
+ <th scope="col"><%= Spree.t(:author) %></th>
+ <th scope="col"><%= sort_link @search, :published_at, Spree.t(:published_at) %></th>
+ <th scope="col"></th>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/posts/_post.html.erb b/admin/app/views/spree/admin/posts/_table_row.html.erb
similarity index 99%
rename from admin/app/views/spree/admin/posts/_post.html.erb
rename to admin/app/views/spree/admin/posts/_table_row.html.erb
index dc38fc9df8..c2953acf4d 100644
--- a/admin/app/views/spree/admin/posts/_post.html.erb
+++ b/admin/app/views/spree/admin/posts/_table_row.html.erb
@@ -19,4 +19,4 @@
<td class="actions">
<%= link_to_edit(post, class: 'btn btn-light btn-sm', data: { 'turbo-frame': '_top' }) if can? :edit, post %>
</td>
-</tr>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/posts/_filters.html.erb b/admin/app/views/spree/admin/posts/filters.html.erb
similarity index 100%
rename from admin/app/views/spree/admin/posts/_filters.html.erb
rename to admin/app/views/spree/admin/posts/filters.html.erb
diff --git a/admin/app/views/spree/admin/posts/index.html.erb b/admin/app/views/spree/admin/posts/index.html.erb
index 414a2ad107..1da3f6783d 100644
--- a/admin/app/views/spree/admin/posts/index.html.erb
+++ b/admin/app/views/spree/admin/posts/index.html.erb
@@ -7,29 +7,4 @@
<%= render_admin_partials(:posts_header_partials) %>
-<div class="card-lg">
- <%= turbo_frame_tag "posts", autoscroll: true, data: { autoscroll_behavior: :smooth, turbo_action: 'advance' } do %>
- <%= render "spree/admin/posts/filters" %>
- <% if @collection.any? %>
- <div class="table-responsive rounded-lg">
- <table class="table">
- <thead>
- <tr>
- <th><%= sort_link @search, :title, Spree.t(:title) %></th>
- <th><%= Spree.t(:category) %></th>
- <th><%= Spree.t(:author) %></th>
- <th><%= sort_link @search, :published_at, Spree.t(:published_at) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <%= render collection: @collection, partial: "spree/admin/posts/post", cached: spree_base_cache_scope %>
- </tbody>
- </table>
- </div>
- <%= render "spree/admin/shared/index_table_options", collection: @collection %>
- <% else %>
- <%= render 'spree/admin/shared/no_resource_found' %>
- <% end %>
- <% end %>
-</div>
+<%= render 'spree/admin/shared/index_table' %>
diff --git a/admin/app/views/spree/admin/products/form/_properties.html.erb b/admin/app/views/spree/admin/products/form/_properties.html.erb
index fe257d354b..c018b8c5e8 100644
--- a/admin/app/views/spree/admin/products/form/_properties.html.erb
+++ b/admin/app/views/spree/admin/products/form/_properties.html.erb
@@ -10,8 +10,8 @@
<table class="table">
<thead>
<tr>
- <th><%= Spree.t(:property) %></th>
- <th><%= Spree.t(:value) %></th>
+ <th scope="col"><%= Spree.t(:property) %></th>
+ <th scope="col"><%= Spree.t(:value) %></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/promotion_actions/forms/_create_line_items.html.erb b/admin/app/views/spree/admin/promotion_actions/forms/_create_line_items.html.erb
index 4ebe678298..0b6dce3955 100644
--- a/admin/app/views/spree/admin/promotion_actions/forms/_create_line_items.html.erb
+++ b/admin/app/views/spree/admin/promotion_actions/forms/_create_line_items.html.erb
@@ -11,9 +11,9 @@
<table class="table">
<thead>
<tr>
- <th><%= Spree.t(:variant) %></th>
- <th><%= Spree.t(:quantity) %></th>
- <th></th>
+ <th scope="col"><%= Spree.t(:variant) %></th>
+ <th scope="col"><%= Spree.t(:quantity) %></th>
+ <th scope="col"></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/promotions/_table_header.html.erb b/admin/app/views/spree/admin/promotions/_table_header.html.erb
index 2e121da33d..e2e274c393 100644
--- a/admin/app/views/spree/admin/promotions/_table_header.html.erb
+++ b/admin/app/views/spree/admin/promotions/_table_header.html.erb
@@ -1,7 +1,7 @@
<tr>
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:code) %></th>
- <th><%= Spree.t(:kind) %></th>
- <th><%= Spree.t(:usage_limit) %></th>
- <th><%= Spree.t(:status) %></th>
+ <th scope="col"><%= Spree.t(:name) %></th>
+ <th scope="col"><%= Spree.t(:code) %></th>
+ <th scope="col"><%= Spree.t(:kind) %></th>
+ <th scope="col"><%= Spree.t(:usage_limit) %></th>
+ <th scope="col"><%= Spree.t(:status) %></th>
</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/properties/_table_header.html.erb b/admin/app/views/spree/admin/properties/_table_header.html.erb
index fdc3ac2d35..7fb1174be8 100644
--- a/admin/app/views/spree/admin/properties/_table_header.html.erb
+++ b/admin/app/views/spree/admin/properties/_table_header.html.erb
@@ -1,9 +1,9 @@
<tr>
<th class="no-border handel-head"></th>
- <th><%= Spree.t(:internal_name) %></th>
- <th><%= Spree.t(:presentation) %></th>
- <th><%= Spree.t(:kind) %></th>
- <th><%= Spree.t(:products) %></th>
- <th><%= Spree.t(:visibility) %></th>
- <th></th>
+ <th scope="col"><%= Spree.t(:internal_name) %></th>
+ <th scope="col"><%= Spree.t(:presentation) %></th>
+ <th scope="col"><%= Spree.t(:kind) %></th>
+ <th scope="col"><%= Spree.t(:products) %></th>
+ <th scope="col"><%= Spree.t(:visibility) %></th>
+ <th scope="col"></th>
</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/refund_reasons/_table_header.html.erb b/admin/app/views/spree/admin/refund_reasons/_table_header.html.erb
new file mode 100644
index 0000000000..450033bcbf
--- /dev/null
+++ b/admin/app/views/spree/admin/refund_reasons/_table_header.html.erb
@@ -0,0 +1,6 @@
+<tr>
+ <th scope="col"><%= Spree.t(:name) %></th>
+ <th scope="col"><%= Spree.t(:status) %></th>
+ <th scope="col"><%= Spree.t(:mutable) %></th>
+ <th scope="col"></th>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/refund_reasons/_table_row.html.erb b/admin/app/views/spree/admin/refund_reasons/_table_row.html.erb
new file mode 100644
index 0000000000..247eb63014
--- /dev/null
+++ b/admin/app/views/spree/admin/refund_reasons/_table_row.html.erb
@@ -0,0 +1,14 @@
+<tr id="<%= spree_dom_id refund_reason %>" data-controller="row-link" class="cursor-pointer">
+ <td class="w-40 align-center" data-action="click->row-link#openLink">
+ <%= refund_reason.name %>
+ </td>
+ <td class="w-20 align-center" data-action="click->row-link#openLink">
+ <%= active_badge(refund_reason.active, label: Spree.t(refund_reason.active? ? :active : :inactive)) %>
+ </td>
+ <td class="w-10 align-center" data-action="click->row-link#openLink">
+ <%= active_badge(refund_reason.mutable) %>
+ </td>
+ <td class="actions w-10" data-action="click->row-link#openLink">
+ <%= link_to_edit(refund_reason, no_text: true, data: { row_link_target: :link, turbo_frame: '_top' }) if can? :edit, refund_reason %>
+ </td>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/refund_reasons/index.html.erb b/admin/app/views/spree/admin/refund_reasons/index.html.erb
index 1e5dae41d2..e926bfa3ac 100644
--- a/admin/app/views/spree/admin/refund_reasons/index.html.erb
+++ b/admin/app/views/spree/admin/refund_reasons/index.html.erb
@@ -7,39 +7,4 @@
<%= render_admin_partials(:refund_reasons_header_partials) %>
-<div class="card-lg">
- <% if @collection.any? %>
- <div class="table-responsive">
- <table class="table">
- <thead>
- <tr>
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:status) %></th>
- <th><%= Spree.t(:mutable) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <% @collection.each do |refund_reason| %>
- <tr id="<%= spree_dom_id refund_reason %>" data-controller="row-link" class="cursor-pointer">
- <td class="w-40 align-center" data-action="click->row-link#openLink">
- <%= refund_reason.name %>
- </td>
- <td class="w-20 align-center" data-action="click->row-link#openLink">
- <%= active_badge(refund_reason.active, label: Spree.t(refund_reason.active? ? :active : :inactive)) %>
- </td>
- <td class="w-10 align-center" data-action="click->row-link#openLink">
- <%= active_badge(refund_reason.mutable) %>
- </td>
- <td class="actions w-10" data-action="click->row-link#openLink">
- <%= link_to_edit(refund_reason, no_text: true, data: { row_link_target: :link, turbo_frame: '_top' }) if can? :edit, refund_reason %>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
- <% else %>
- <%= render 'spree/admin/shared/no_resource_found' %>
- <% end %>
-</div>
+<%= render 'spree/admin/shared/index_table' %>
diff --git a/admin/app/views/spree/admin/reimbursement_types/_table_header.html.erb b/admin/app/views/spree/admin/reimbursement_types/_table_header.html.erb
new file mode 100644
index 0000000000..33ee8f8bd6
--- /dev/null
+++ b/admin/app/views/spree/admin/reimbursement_types/_table_header.html.erb
@@ -0,0 +1,7 @@
+<tr>
+ <th scope="col"><%= Spree.t(:name) %></th>
+ <th scope="col"><%= Spree.t(:type) %></th>
+ <th scope="col"><%= Spree.t(:status) %></th>
+ <th scope="col"><%= Spree.t(:mutable) %></th>
+ <th scope="col"></th>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/reimbursement_types/_table_row.html.erb b/admin/app/views/spree/admin/reimbursement_types/_table_row.html.erb
new file mode 100644
index 0000000000..6ad64d1fa8
--- /dev/null
+++ b/admin/app/views/spree/admin/reimbursement_types/_table_row.html.erb
@@ -0,0 +1,17 @@
+<tr id="<%= spree_dom_id reimbursement_type %>" data-controller="row-link">
+ <td class="w-40 align-center cursor-pointer" data-action="click->row-link#openLink">
+ <%= reimbursement_type.name.humanize %>
+ </td>
+ <td class="w-30 cursor-pointer" data-action="click->row-link#openLink">
+ <code><%= reimbursement_type.type.demodulize %></code>
+ </td>
+ <td class="w-10 align-center cursor-pointer" data-action="click->row-link#openLink">
+ <%= active_badge(reimbursement_type.active, label: Spree.t(reimbursement_type.active? ? :active : :inactive)) %>
+ </td>
+ <td class="w-10 align-center cursor-pointer" data-action="click->row-link#openLink">
+ <%= active_badge(reimbursement_type.mutable) %>
+ </td>
+ <td class="actions w-10">
+ <%= link_to_edit reimbursement_type, no_text: true, data: { row_link_target: :link, turbo_frame: '_top' } if can?(:edit, reimbursement_type) %>
+ </td>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/reimbursement_types/index.html.erb b/admin/app/views/spree/admin/reimbursement_types/index.html.erb
index f8b70c0b99..59d81fa414 100644
--- a/admin/app/views/spree/admin/reimbursement_types/index.html.erb
+++ b/admin/app/views/spree/admin/reimbursement_types/index.html.erb
@@ -7,43 +7,4 @@
<%= render_admin_partials(:reimbursement_types_header_partials) %>
-<div class="card-lg">
- <% if @collection.any? %>
- <div class="table-responsive">
- <table class="table">
- <thead>
- <tr>
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:type) %></th>
- <th><%= Spree.t(:status) %></th>
- <th><%= Spree.t(:mutable) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <% @collection.each do |reimbursement_type| %>
- <tr id="<%= spree_dom_id reimbursement_type %>" data-controller="row-link">
- <td class="w-40 align-center cursor-pointer" data-action="click->row-link#openLink">
- <%= reimbursement_type.name.humanize %>
- </td>
- <td class="w-30 cursor-pointer" data-action="click->row-link#openLink">
- <code><%= reimbursement_type.type.demodulize %></code>
- </td>
- <td class="w-10 align-center cursor-pointer" data-action="click->row-link#openLink">
- <%= active_badge(reimbursement_type.active, label: Spree.t(reimbursement_type.active? ? :active : :inactive)) %>
- </td>
- <td class="w-10 align-center cursor-pointer" data-action="click->row-link#openLink">
- <%= active_badge(reimbursement_type.mutable) %>
- </td>
- <td class="actions w-10">
- <%= link_to_edit reimbursement_type, no_text: true, data: { row_link_target: :link, turbo_frame: '_top' } if can?(:edit, reimbursement_type) %>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
- <% else %>
- <%= render 'spree/admin/shared/no_resource_found' %>
- <% end %>
-</div>
+<%= render 'spree/admin/shared/index_table' %>
diff --git a/admin/app/views/spree/admin/reimbursements/edit.html.erb b/admin/app/views/spree/admin/reimbursements/edit.html.erb
index d63ccaf49b..20964d9cb8 100644
--- a/admin/app/views/spree/admin/reimbursements/edit.html.erb
+++ b/admin/app/views/spree/admin/reimbursements/edit.html.erb
@@ -24,12 +24,12 @@ locals: {
<table class="table table-condensed reimbursement-return-items-table">
<thead>
<tr>
- <th><%= Spree.t(:product) %></th>
- <th><%= Spree.t(:preferred_reimbursement_type) %></th>
- <th><%= Spree.t(:reimbursement_type_override) %></th>
- <th><%= Spree.t(:pre_tax_refund_amount) %></th>
- <th><%= Spree.t(:total) %></th>
- <th><%= Spree.t(:exchange_for) %></th>
+ <th scope="col"><%= Spree.t(:product) %></th>
+ <th scope="col"><%= Spree.t(:preferred_reimbursement_type) %></th>
+ <th scope="col"><%= Spree.t(:reimbursement_type_override) %></th>
+ <th scope="col"><%= Spree.t(:pre_tax_refund_amount) %></th>
+ <th scope="col"><%= Spree.t(:total) %></th>
+ <th scope="col"><%= Spree.t(:exchange_for) %></th>
</tr>
</thead>
<tbody>
@@ -93,9 +93,9 @@ locals: {
<table class="table table-condensed">
<thead>
<tr>
- <th><%= Spree.t(:reimbursement_type) %></th>
- <th><%= Spree.t(:description) %></th>
- <th><%= Spree.t(:amount) %></th>
+ <th scope="col"><%= Spree.t(:reimbursement_type) %></th>
+ <th scope="col"><%= Spree.t(:description) %></th>
+ <th scope="col"><%= Spree.t(:amount) %></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/reimbursements/show.html.erb b/admin/app/views/spree/admin/reimbursements/show.html.erb
index 7a35356041..d4c65fd577 100644
--- a/admin/app/views/spree/admin/reimbursements/show.html.erb
+++ b/admin/app/views/spree/admin/reimbursements/show.html.erb
@@ -23,12 +23,12 @@ locals: {
<table class="table reimbursement-reimbursement-items-table">
<thead>
<tr>
- <th><%= Spree.t(:product) %></th>
- <th><%= Spree.t(:preferred_reimbursement_type) %></th>
- <th><%= Spree.t(:reimbursement_type_override) %></th>
- <th><%= Spree.t(:exchange_for) %></th>
- <th><%= Spree.t(:pre_tax_amount) %></th>
- <th><%= Spree.t(:total) %></th>
+ <th scope="col"><%= Spree.t(:product) %></th>
+ <th scope="col"><%= Spree.t(:preferred_reimbursement_type) %></th>
+ <th scope="col"><%= Spree.t(:reimbursement_type_override) %></th>
+ <th scope="col"><%= Spree.t(:exchange_for) %></th>
+ <th scope="col"><%= Spree.t(:pre_tax_amount) %></th>
+ <th scope="col"><%= Spree.t(:total) %></th>
</tr>
</thead>
<tbody>
@@ -68,9 +68,9 @@ locals: {
<table class="table table-condensed">
<thead>
<tr>
- <th><%= Spree.t(:amount) %></th>
- <th><%= Spree.t(:date) %></th>
- <th><%= Spree.t(:reason) %></th>
+ <th scope="col"><%= Spree.t(:amount) %></th>
+ <th scope="col"><%= Spree.t(:date) %></th>
+ <th scope="col"><%= Spree.t(:reason) %></th>
</tr>
</thead>
<tbody>
@@ -95,8 +95,8 @@ locals: {
<table class="table table-condensed">
<thead>
<tr>
- <th><%= Spree.t(:description) %></th>
- <th><%= Spree.t(:amount) %></th>
+ <th scope="col"><%= Spree.t(:description) %></th>
+ <th scope="col"><%= Spree.t(:amount) %></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/reports/_report.html.erb b/admin/app/views/spree/admin/reports/_report.html.erb
index 73ab88ed67..f0f75bf0c0 100644
--- a/admin/app/views/spree/admin/reports/_report.html.erb
+++ b/admin/app/views/spree/admin/reports/_report.html.erb
@@ -4,7 +4,7 @@
<thead>
<tr>
<% @report.line_item_class.headers.each do |header| %>
- <th><%= header[:label] %></th>
+ <th scope="col"><%= header[:label] %></th>
<% end %>
</tr>
</thead>
diff --git a/admin/app/views/spree/admin/reports/index.html.erb b/admin/app/views/spree/admin/reports/index.html.erb
index dd8d31d2e2..4bda81e86f 100644
--- a/admin/app/views/spree/admin/reports/index.html.erb
+++ b/admin/app/views/spree/admin/reports/index.html.erb
@@ -13,7 +13,7 @@
<table class="table">
<thead>
<tr>
- <th><%= Spree.t(:name) %></th>
+ <th scope="col"><%= Spree.t(:name) %></th>
<th class="text-right"><%= Spree.t(:action) %></th>
</tr>
</thead>
diff --git a/admin/app/views/spree/admin/return_authorization_reasons/_table_header.html.erb b/admin/app/views/spree/admin/return_authorization_reasons/_table_header.html.erb
new file mode 100644
index 0000000000..26060b294b
--- /dev/null
+++ b/admin/app/views/spree/admin/return_authorization_reasons/_table_header.html.erb
@@ -0,0 +1,5 @@
+<tr>
+ <th scope="col"><%= Spree.t(:name) %></th>
+ <th scope="col"><%= Spree.t(:status) %></th>
+ <th scope="col"></th>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/return_authorization_reasons/_table_row.html.erb b/admin/app/views/spree/admin/return_authorization_reasons/_table_row.html.erb
new file mode 100644
index 0000000000..a7a91c0772
--- /dev/null
+++ b/admin/app/views/spree/admin/return_authorization_reasons/_table_row.html.erb
@@ -0,0 +1,18 @@
+<tr id="<%= spree_dom_id return_authorization_reason %>" data-controller="row-link">
+ <td class="w-40 align-center cursor-pointer" data-action="click->row-link#openLink">
+ <%= return_authorization_reason.name %>
+ </td>
+ <td class="w-20 align-center cursor-pointer" data-action="click->row-link#openLink">
+ <%= active_badge(
+ return_authorization_reason.active,
+ label: Spree.t(return_authorization_reason.active? ? :active : :inactive),
+ ) %>
+ </td>
+ <td class="actions w-10">
+ <% if return_authorization_reason.mutable? %>
+ <%= if can? :edit, return_authorization_reason
+ link_to_edit(return_authorization_reason, no_text: true, data: { row_link_target: :link, turbo_frame: '_top' })
+ end %>
+ <% end %>
+ </td>
+</tr>
diff --git a/admin/app/views/spree/admin/return_authorization_reasons/index.html.erb b/admin/app/views/spree/admin/return_authorization_reasons/index.html.erb
index 1868ed476a..0ed59982a0 100644
--- a/admin/app/views/spree/admin/return_authorization_reasons/index.html.erb
+++ b/admin/app/views/spree/admin/return_authorization_reasons/index.html.erb
@@ -7,42 +7,4 @@
<%= render_admin_partials(:return_authorization_reasons_header_partials) %>
-<div class="card-lg">
- <% if @collection.any? %>
- <div class="table-responsive">
- <table class="table">
- <thead>
- <tr>
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:status) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody id="<%= plural_resource_name(Spree::ReturnAuthorizationReason).to_s.parameterize.underscore %>">
- <% @collection.each do |return_authorization_reason| %>
- <tr id="<%= spree_dom_id return_authorization_reason %>" data-controller="row-link">
- <td class="w-40 align-center cursor-pointer" data-action="click->row-link#openLink">
- <%= return_authorization_reason.name %>
- </td>
- <td class="w-20 align-center cursor-pointer" data-action="click->row-link#openLink">
- <%= active_badge(
- return_authorization_reason.active,
- label: Spree.t(return_authorization_reason.active? ? :active : :inactive),
- ) %>
- </td>
- <td class="actions w-10">
- <% if return_authorization_reason.mutable? %>
- <%= if can? :edit, return_authorization_reason
- link_to_edit(return_authorization_reason, no_text: true, data: { row_link_target: :link, turbo_frame: '_top' })
- end %>
- <% end %>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
- <% else %>
- <%= render "spree/admin/shared/no_resource_found" %>
- <% end %>
-</div>
+<%= render 'spree/admin/shared/index_table' %>
diff --git a/admin/app/views/spree/admin/return_authorizations/_list.html.erb b/admin/app/views/spree/admin/return_authorizations/_list.html.erb
index 8cd1ea5049..a32f318d68 100644
--- a/admin/app/views/spree/admin/return_authorizations/_list.html.erb
+++ b/admin/app/views/spree/admin/return_authorizations/_list.html.erb
@@ -3,9 +3,9 @@
<table class="table">
<thead>
<tr>
- <th><%= Spree.t(:number) %></th>
- <th><%= Spree.t(:created_at) %></th>
- <th><%= Spree.t(:customer) %></th>
+ <th scope="col"><%= Spree.t(:number) %></th>
+ <th scope="col"><%= Spree.t(:created_at) %></th>
+ <th scope="col"><%= Spree.t(:customer) %></th>
<th class="text-center w-10"><%= Spree.t(:status) %></th>
</tr>
</thead>
diff --git a/admin/app/views/spree/admin/return_authorizations/_table_header.html.erb b/admin/app/views/spree/admin/return_authorizations/_table_header.html.erb
new file mode 100644
index 0000000000..990a10c154
--- /dev/null
+++ b/admin/app/views/spree/admin/return_authorizations/_table_header.html.erb
@@ -0,0 +1,6 @@
+<tr>
+ <th scope="col"><%= Spree.t(:number) %></th>
+ <th scope="col"><%= Spree.t(:created_at) %></th>
+ <th scope="col"><%= Spree.t(:customer) %></th>
+ <th class="text-center w-10"><%= Spree.t(:status) %></th>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/return_authorizations/_return_authorization.html.erb b/admin/app/views/spree/admin/return_authorizations/_table_row.html.erb
similarity index 100%
rename from admin/app/views/spree/admin/return_authorizations/_return_authorization.html.erb
rename to admin/app/views/spree/admin/return_authorizations/_table_row.html.erb
diff --git a/admin/app/views/spree/admin/return_authorizations/_filters.html.erb b/admin/app/views/spree/admin/return_authorizations/filters.html.erb
similarity index 100%
rename from admin/app/views/spree/admin/return_authorizations/_filters.html.erb
rename to admin/app/views/spree/admin/return_authorizations/filters.html.erb
diff --git a/admin/app/views/spree/admin/return_authorizations/index.html.erb b/admin/app/views/spree/admin/return_authorizations/index.html.erb
index 886dfd6137..67271d7d67 100644
--- a/admin/app/views/spree/admin/return_authorizations/index.html.erb
+++ b/admin/app/views/spree/admin/return_authorizations/index.html.erb
@@ -8,13 +8,4 @@
<%= render_admin_partials(:return_authorizations_header_partials) %>
-<div class="card-lg">
- <%= render "spree/admin/return_authorizations/filters" %>
- <%= render "spree/admin/return_authorizations/list" %>
-
- <%= render partial: "spree/admin/shared/index_table_options",
- locals: {
- collection: @collection,
- per_page_action: :return_authorizations,
- } %>
-</div>
+<%= render 'spree/admin/shared/index_table', new_object_url: nil %>
diff --git a/admin/app/views/spree/admin/roles/_form.html.erb b/admin/app/views/spree/admin/roles/_form.html.erb
index 583ab80afe..eeec49a609 100644
--- a/admin/app/views/spree/admin/roles/_form.html.erb
+++ b/admin/app/views/spree/admin/roles/_form.html.erb
@@ -1,6 +1,9 @@
-<div class="form-group">
- <%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
- <%= f.text_field :name, class: 'form-control', required: true %>
- <%= f.error_message_on :name %>
+<div class="card mb-4">
+ <div class="card-body">
+ <div class="form-group">
+ <%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
+ <%= f.text_field :name, class: 'form-control', required: true %>
+ <%= f.error_message_on :name %>
+ </div>
+ </div>
</div>
-
diff --git a/admin/app/views/spree/admin/roles/index.html.erb b/admin/app/views/spree/admin/roles/index.html.erb
index 1a33c9c9e6..d4d5044e61 100644
--- a/admin/app/views/spree/admin/roles/index.html.erb
+++ b/admin/app/views/spree/admin/roles/index.html.erb
@@ -13,9 +13,9 @@
<table class="table">
<thead>
<tr>
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:permissions) %></th>
- <th></th>
+ <th scope="col"><%= Spree.t(:name) %></th>
+ <th scope="col"><%= Spree.t(:permissions) %></th>
+ <th scope="col"></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/shared/_edit_resource.html.erb b/admin/app/views/spree/admin/shared/_edit_resource.html.erb
index 84ac8b6b23..cc03ed0a53 100644
--- a/admin/app/views/spree/admin/shared/_edit_resource.html.erb
+++ b/admin/app/views/spree/admin/shared/_edit_resource.html.erb
@@ -3,7 +3,7 @@
<%= @object.try(:name) || @object.try(:title) || @object.try(:number) %>
<% end %>
-<%= form_with model: [:admin, @object], id: "edit_#{controller_name.singularize}_#{@object.id}" do |f| %>
+<%= form_with model: [:admin, @object], url: object_url, scope: @resource.object_name, id: "edit_#{controller_name.singularize}_#{@object.id}" do |f| %>
<div class="row">
<div class="col-lg-6 offset-lg-3">
<%= render 'spree/admin/shared/error_messages', target: @object %>
diff --git a/admin/app/views/spree/admin/shared/_index_table.html.erb b/admin/app/views/spree/admin/shared/_index_table.html.erb
index 8cf2c2b738..f18c5a9ac0 100644
--- a/admin/app/views/spree/admin/shared/_index_table.html.erb
+++ b/admin/app/views/spree/admin/shared/_index_table.html.erb
@@ -2,7 +2,9 @@
<%= turbo_frame_tag controller_name, autoscroll: true, data: { autoscroll_block: :start, autoscroll_behavior: :smooth, turbo_action: 'advance' } do %>
<div class="card-lg">
- <%= render 'filters' %>
+ <% if lookup_context.template_exists?('filters', lookup_context.prefixes, true) %>
+ <%= render 'filters' %>
+ <% end %>
<% if ransack_collection.any? %>
<div class="table-responsive" id="listing_<%= controller_name %>">
diff --git a/admin/app/views/spree/admin/shared/_refunds.html.erb b/admin/app/views/spree/admin/shared/_refunds.html.erb
index 110cb9fba3..179cea905b 100644
--- a/admin/app/views/spree/admin/shared/_refunds.html.erb
+++ b/admin/app/views/spree/admin/shared/_refunds.html.erb
@@ -2,11 +2,11 @@
<table class="table table-condensed" id='refunds' data-order-id='<%= @order.number %>'>
<thead>
<tr data-hook="refunds_header" class="border-bottom">
- <th><%= "#{Spree.t('date')}/#{Spree.t('time')}" %></th>
- <th><%= Spree.t(:amount) %></th>
- <th><%= Spree.t(:reason) %></th>
+ <th scope="col"><%= "#{Spree.t('date')}/#{Spree.t('time')}" %></th>
+ <th scope="col"><%= Spree.t(:amount) %></th>
+ <th scope="col"><%= Spree.t(:reason) %></th>
<% if show_actions %>
- <th></th>
+ <th scope="col"></th>
<% end %>
</tr>
</thead>
diff --git a/admin/app/views/spree/admin/shipping_categories/_table_header.html.erb b/admin/app/views/spree/admin/shipping_categories/_table_header.html.erb
new file mode 100644
index 0000000000..0fcb4108df
--- /dev/null
+++ b/admin/app/views/spree/admin/shipping_categories/_table_header.html.erb
@@ -0,0 +1,4 @@
+<tr>
+ <th scope="col"><%= Spree.t(:name) %></th>
+ <th scope="col"></th>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/shipping_categories/_table_row.html.erb b/admin/app/views/spree/admin/shipping_categories/_table_row.html.erb
new file mode 100644
index 0000000000..c8a7d9b7dd
--- /dev/null
+++ b/admin/app/views/spree/admin/shipping_categories/_table_row.html.erb
@@ -0,0 +1,8 @@
+<tr id="<%= spree_dom_id shipping_category %>" class="cursor-pointer" data-controller="row-link">
+ <td data-action="click->row-link#openLink"><%= shipping_category.name %></td>
+ <td class="actions">
+ <span class="d-flex justify-content-end">
+ <%= link_to_edit(shipping_category, data: { row_link_target: :link, turbo_frame: '_top' }) if can? :edit, shipping_category %>
+ </span>
+ </td>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/shipping_categories/index.html.erb b/admin/app/views/spree/admin/shipping_categories/index.html.erb
index f65dd663fd..e953e873c8 100644
--- a/admin/app/views/spree/admin/shipping_categories/index.html.erb
+++ b/admin/app/views/spree/admin/shipping_categories/index.html.erb
@@ -4,38 +4,11 @@
<% content_for :page_actions do %>
<%= render_admin_partials(:shipping_categories_actions_partials) %>
- <%= link_to_with_icon 'plus', Spree.t(:new_shipping_category), new_object_url, class: "btn btn-primary" %>
-<% end if can? :create, Spree::ShippingCategory %>
+ <%= link_to_with_icon 'plus', Spree.t(:new_shipping_category), new_object_url, class: "btn btn-primary" if can? :create, Spree::ShippingCategory %>
+<% end %>
<%= render_admin_partials(:shipping_categories_header_partials) %>
<%= render partial: 'spree/admin/shared/shipping_nav' %>
-<div class="card-lg">
- <% if @collection.any? %>
- <div class="table-responsive">
- <table class="table">
- <thead>
- <tr>
- <th><%= Spree.t(:name) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <% @collection.each do |shipping_category| %>
- <tr id="<%= spree_dom_id shipping_category %>" class="cursor-pointer" data-controller="row-link">
- <td data-action="click->row-link#openLink"><%= shipping_category.name %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit(shipping_category, data: { row_link_target: :link, turbo_frame: '_top' }) if can? :edit, shipping_category %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
- <% else %>
- <%= render 'spree/admin/shared/no_resource_found' %>
- <% end %>
-</div>
+<%= render 'spree/admin/shared/index_table' %>
diff --git a/admin/app/views/spree/admin/shipping_methods/_table_header.html.erb b/admin/app/views/spree/admin/shipping_methods/_table_header.html.erb
new file mode 100644
index 0000000000..1f5625d513
--- /dev/null
+++ b/admin/app/views/spree/admin/shipping_methods/_table_header.html.erb
@@ -0,0 +1,8 @@
+<tr>
+ <th scope="col"><%= Spree.t(:name) %></th>
+ <th scope="col"><%= Spree.t(:zone) %></th>
+ <th scope="col"><%= Spree.t(:estimated_delivery_time) %></th>
+ <th scope="col"><%= Spree.t(:amount) %></th>
+ <th scope="col"><%= Spree.t(:visibility) %></th>
+ <th scope="col"></th>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/shipping_methods/_shipping_method.html.erb b/admin/app/views/spree/admin/shipping_methods/_table_row.html.erb
similarity index 100%
rename from admin/app/views/spree/admin/shipping_methods/_shipping_method.html.erb
rename to admin/app/views/spree/admin/shipping_methods/_table_row.html.erb
diff --git a/admin/app/views/spree/admin/shipping_methods/index.html.erb b/admin/app/views/spree/admin/shipping_methods/index.html.erb
index a3872fc8ab..adb9bbd1b8 100644
--- a/admin/app/views/spree/admin/shipping_methods/index.html.erb
+++ b/admin/app/views/spree/admin/shipping_methods/index.html.erb
@@ -4,10 +4,9 @@
<% content_for :page_actions do %>
<%= render_admin_partials(:shipping_methods_actions_partials) %>
- <% if can?(:create, Spree::ShippingMethod) %>
- <%= link_to_with_icon 'plus', Spree.t(:new_shipping_method), new_object_url, class: "btn btn-primary" %>
- <% end %>
+ <%= link_to_with_icon 'plus', Spree.t(:new_shipping_method), new_object_url, class: "btn btn-primary" if can?(:create, Spree::ShippingMethod) %>
<% end %>
+
<%= render partial: 'spree/admin/shared/shipping_nav' %>
<% content_for :page_alerts do %>
@@ -18,26 +17,4 @@
<%= render_admin_partials(:shipping_methods_header_partials) %>
-<div class="card-lg">
- <% if @collection.any? %>
- <div class="table-responsive">
- <table class="table">
- <thead>
- <tr>
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:zone) %></th>
- <th><%= Spree.t(:estimated_delivery_time) %></th>
- <th><%= Spree.t(:amount) %></th>
- <th><%= Spree.t(:visibility) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <%= render partial: 'spree/admin/shipping_methods/shipping_method', collection: @collection.includes(:zones, :calculator), as: :shipping_method %>
- </tbody>
- </table>
- </div>
- <% else %>
- <%= render 'spree/admin/shared/no_resource_found' %>
- <% end %>
-</div>
+<%= render 'spree/admin/shared/index_table' %>
diff --git a/admin/app/views/spree/admin/stock_locations/_table_header.html.erb b/admin/app/views/spree/admin/stock_locations/_table_header.html.erb
new file mode 100644
index 0000000000..5e71e0010d
--- /dev/null
+++ b/admin/app/views/spree/admin/stock_locations/_table_header.html.erb
@@ -0,0 +1,9 @@
+<tr>
+ <th scope="col"><%= Spree.t(:name) %></th>
+ <th scope="col"><%= Spree.t(:country) %></th>
+ <th scope="col"><%= Spree.t(:active) %>?</th>
+ <% if can?(:mark_as_default, Spree::StockLocation) %>
+ <th scope="col"><%= Spree.t(:default) %>?</th>
+ <% end %>
+ <th scope="col"></th>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/stock_locations/_stock_location.html.erb b/admin/app/views/spree/admin/stock_locations/_table_row.html.erb
similarity index 97%
rename from admin/app/views/spree/admin/stock_locations/_stock_location.html.erb
rename to admin/app/views/spree/admin/stock_locations/_table_row.html.erb
index ffcf178b63..7806a01054 100644
--- a/admin/app/views/spree/admin/stock_locations/_stock_location.html.erb
+++ b/admin/app/views/spree/admin/stock_locations/_table_row.html.erb
@@ -13,7 +13,7 @@
<td class="actions">
<% if can? :edit, stock_location %>
<div class="d-flex justify-content-end align-items-center">
- <div><%= link_to_edit stock_location, data: { row_link_target: 'link' } %></div>
+ <div><%= link_to_edit stock_location, data: { row_link_target: 'link', turbo_frame: '_top' } %></div>
<% if !stock_location.default? && can?(:mark_as_default, Spree::StockLocation) %>
<div class="dropdown">
diff --git a/admin/app/views/spree/admin/stock_locations/index.html.erb b/admin/app/views/spree/admin/stock_locations/index.html.erb
index 67068236bb..75fac8bacb 100644
--- a/admin/app/views/spree/admin/stock_locations/index.html.erb
+++ b/admin/app/views/spree/admin/stock_locations/index.html.erb
@@ -3,32 +3,9 @@
<% end %>
<% content_for :page_actions do %>
<%= render_admin_partials(:stock_locations_actions_partials) %>
- <%= link_to_with_icon 'plus', Spree.t(:new_stock_location), new_object_url, class: "btn btn-primary" %>
-<% end if can? :create, Spree::StockLocation %>
+ <%= link_to_with_icon 'plus', Spree.t(:new_stock_location), new_object_url, class: "btn btn-primary" if can? :create, Spree::StockLocation %>
+<% end %>
<%= render_admin_partials(:stock_locations_header_partials) %>
-<div class="card-lg">
- <% if @collection.any? %>
- <div class="table-responsive">
- <table class="table">
- <thead>
- <tr>
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:country) %></th>
- <th><%= Spree.t(:active) %>?</th>
- <% if can?(:mark_as_default, Spree::StockLocation) %>
- <th><%= Spree.t(:default) %>?</th>
- <% end %>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <%= render partial: 'spree/admin/stock_locations/stock_location', collection: @collection, cached: spree_base_cache_scope %>
- </tbody>
- </table>
- </div>
- <% else %>
- <%= render 'spree/admin/shared/no_resource_found' %>
- <% end %>
-</div>
+<%= render 'spree/admin/shared/index_table' %>
diff --git a/admin/app/views/spree/admin/stock_transfers/_table_header.html.erb b/admin/app/views/spree/admin/stock_transfers/_table_header.html.erb
new file mode 100644
index 0000000000..ffdba319cb
--- /dev/null
+++ b/admin/app/views/spree/admin/stock_transfers/_table_header.html.erb
@@ -0,0 +1,9 @@
+<tr>
+ <th scope="col"><%= Spree.t(:number) %></th>
+ <th scope="col"><%= Spree.t(:reference) %></th>
+ <th scope="col"><%= Spree.t(:source) %></th>
+ <th scope="col"><%= Spree.t(:destination) %></th>
+ <th scope="col"><%= Spree.t(:variants_count) %></th>
+ <th scope="col"><%= Spree.t(:created_at) %></th>
+ <th scope="col"></th>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/stock_transfers/_stock_transfer.html.erb b/admin/app/views/spree/admin/stock_transfers/_table_row.html.erb
similarity index 99%
rename from admin/app/views/spree/admin/stock_transfers/_stock_transfer.html.erb
rename to admin/app/views/spree/admin/stock_transfers/_table_row.html.erb
index bf9435ac4e..93af38cc39 100644
--- a/admin/app/views/spree/admin/stock_transfers/_stock_transfer.html.erb
+++ b/admin/app/views/spree/admin/stock_transfers/_table_row.html.erb
@@ -8,4 +8,4 @@
<td class="actions" data-action="click->row-link#openLink">
<%= link_to '', admin_stock_transfer_path(stock_transfer), data: { row_link_target: 'link' }, class: 'd-none' %>
</td>
-</tr>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/stock_transfers/index.html.erb b/admin/app/views/spree/admin/stock_transfers/index.html.erb
index 7125849556..a9a78d8def 100644
--- a/admin/app/views/spree/admin/stock_transfers/index.html.erb
+++ b/admin/app/views/spree/admin/stock_transfers/index.html.erb
@@ -13,29 +13,4 @@
<%= render_admin_partials(:stock_transfers_header_partials) %>
-<div class="card-lg">
- <%= render "filters" %>
- <% if @collection.any? %>
- <div class="table-responsive">
- <table class="table" id="listing_products">
- <thead>
- <tr>
- <th scope="col"><%= Spree.t(:number) %></th>
- <th scope="col"><%= Spree.t(:reference) %></th>
- <th scope="col"><%= Spree.t(:source) %></th>
- <th scope="col"><%= Spree.t(:destination) %></th>
- <th scope="col"><%= Spree.t(:variants_count) %></th>
- <th scope="col"><%= Spree.t(:created_at) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <%= render collection: @collection, partial: 'stock_transfer' %>
- </tbody>
- </table>
- </div>
- <%= render 'spree/admin/shared/index_table_options', collection: @collection %>
- <% else %>
- <%= render 'spree/admin/shared/no_resource_found' %>
- <% end %>
-</div>
+<%= render 'spree/admin/shared/index_table' %>
diff --git a/admin/app/views/spree/admin/stock_transfers/show.html.erb b/admin/app/views/spree/admin/stock_transfers/show.html.erb
index 558ee8e4fc..8d2850b972 100644
--- a/admin/app/views/spree/admin/stock_transfers/show.html.erb
+++ b/admin/app/views/spree/admin/stock_transfers/show.html.erb
@@ -19,9 +19,9 @@
<table class="table sortable">
<thead>
<tr>
- <th><%= Spree.t(:variant) %></th>
- <th><%= Spree.t(:quantity) %></th>
- <th><%= Spree.t(:count_on_hand) %></th>
+ <th scope="col"><%= Spree.t(:variant) %></th>
+ <th scope="col"><%= Spree.t(:quantity) %></th>
+ <th scope="col"><%= Spree.t(:count_on_hand) %></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/store_credit_categories/index.html.erb b/admin/app/views/spree/admin/store_credit_categories/index.html.erb
index 53d5988986..54641547a6 100644
--- a/admin/app/views/spree/admin/store_credit_categories/index.html.erb
+++ b/admin/app/views/spree/admin/store_credit_categories/index.html.erb
@@ -15,8 +15,8 @@
<table class="table">
<thead>
<tr>
- <th><%= Spree.t(:name) %></th>
- <th></th>
+ <th scope="col"><%= Spree.t(:name) %></th>
+ <th scope="col"></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/store_credits/_list.html.erb b/admin/app/views/spree/admin/store_credits/_list.html.erb
index c68ee42a91..df943aea42 100644
--- a/admin/app/views/spree/admin/store_credits/_list.html.erb
+++ b/admin/app/views/spree/admin/store_credits/_list.html.erb
@@ -2,13 +2,13 @@
<div class="table-responsive">
<table class="table">
<thead>
- <th><%= Spree.t(:currency) %></th>
- <th><%= Spree.t('store_credit.allocated') %></th>
- <th><%= Spree.t('store_credit.authorized') %></th>
- <th><%= Spree.t('store_credit.captured') %></th>
- <th><%= Spree.t('store_credit.remaining') %></th>
- <th><%= Spree.t(:created_by) %></th>
- <th><%= Spree.t(:issued_on) %></th>
+ <th scope="col"><%= Spree.t(:currency) %></th>
+ <th scope="col"><%= Spree.t('store_credit.allocated') %></th>
+ <th scope="col"><%= Spree.t('store_credit.authorized') %></th>
+ <th scope="col"><%= Spree.t('store_credit.captured') %></th>
+ <th scope="col"><%= Spree.t('store_credit.remaining') %></th>
+ <th scope="col"><%= Spree.t(:created_by) %></th>
+ <th scope="col"><%= Spree.t(:issued_on) %></th>
</thead>
<tbody>
<%= render partial: 'spree/admin/store_credits/store_credit', collection: @store_credits, as: :store_credit, cached: spree_base_cache_scope %>
diff --git a/admin/app/views/spree/admin/store_credits/show.html.erb b/admin/app/views/spree/admin/store_credits/show.html.erb
index b5449945ab..152dffdde7 100644
--- a/admin/app/views/spree/admin/store_credits/show.html.erb
+++ b/admin/app/views/spree/admin/store_credits/show.html.erb
@@ -16,11 +16,11 @@
<table class="table">
<thead>
<tr>
- <th><%= Spree.t(:action) %></th>
- <th><%= Spree.t(:amount) %></th>
- <th><%= Spree.t(:source) %></th>
- <th><%= Spree.t(:order) %></th>
- <th><%= Spree.t(:created_at) %></th>
+ <th scope="col"><%= Spree.t(:action) %></th>
+ <th scope="col"><%= Spree.t(:amount) %></th>
+ <th scope="col"><%= Spree.t(:source) %></th>
+ <th scope="col"><%= Spree.t(:order) %></th>
+ <th scope="col"><%= Spree.t(:created_at) %></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/tax_categories/_table_header.html.erb b/admin/app/views/spree/admin/tax_categories/_table_header.html.erb
new file mode 100644
index 0000000000..124749ab74
--- /dev/null
+++ b/admin/app/views/spree/admin/tax_categories/_table_header.html.erb
@@ -0,0 +1,7 @@
+<tr>
+ <th scope="col"><%= Spree.t(:name) %></th>
+ <th scope="col"><%= Spree.t(:tax_code) %></th>
+ <th scope="col"><%= Spree.t(:description) %></th>
+ <th scope="col"><%= Spree.t(:default) %></th>
+ <th scope="col"></th>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/tax_categories/_tax_category.html.erb b/admin/app/views/spree/admin/tax_categories/_table_row.html.erb
similarity index 100%
rename from admin/app/views/spree/admin/tax_categories/_tax_category.html.erb
rename to admin/app/views/spree/admin/tax_categories/_table_row.html.erb
diff --git a/admin/app/views/spree/admin/tax_categories/index.html.erb b/admin/app/views/spree/admin/tax_categories/index.html.erb
index 3a0458a235..eade70f65b 100644
--- a/admin/app/views/spree/admin/tax_categories/index.html.erb
+++ b/admin/app/views/spree/admin/tax_categories/index.html.erb
@@ -4,32 +4,11 @@
<% content_for :page_actions do %>
<%= render_admin_partials(:tax_categories_actions_partials) %>
- <%= link_to_with_icon 'plus', Spree.t(:new_tax_category), new_object_url, class: "btn btn-primary" %>
-<% end if can? :create, Spree::TaxCategory %>
+ <%= link_to_with_icon 'plus', Spree.t(:new_tax_category), new_object_url, class: "btn btn-primary" if can? :create, Spree::TaxCategory %>
+<% end %>
<%= render_admin_partials(:tax_categories_header_partials) %>
<%= render 'spree/admin/shared/tax_nav' %>
-<div class="card-lg">
- <% if @collection.any? %>
- <div class="table-responsive">
- <table class="table">
- <thead>
- <tr>
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:tax_code) %></th>
- <th><%= Spree.t(:description) %></th>
- <th><%= Spree.t(:default) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <%= render collection: @collection, partial: 'spree/admin/tax_categories/tax_category', cached: spree_base_cache_scope %>
- </tbody>
- </table>
- </div>
- <% else %>
- <%= render 'spree/admin/shared/no_resource_found' %>
- <% end %>
-</div>
+<%= render 'spree/admin/shared/index_table' %>
diff --git a/admin/app/views/spree/admin/tax_rates/_table_header.html.erb b/admin/app/views/spree/admin/tax_rates/_table_header.html.erb
new file mode 100644
index 0000000000..b856bdbae9
--- /dev/null
+++ b/admin/app/views/spree/admin/tax_rates/_table_header.html.erb
@@ -0,0 +1,9 @@
+<tr data-hook="rate_header">
+ <th scope="col"><%= Spree.t(:name) %></th>
+ <th scope="col"><%= Spree.t(:tax_category) %></th>
+ <th scope="col"><%= Spree.t(:zone) %></th>
+ <th scope="col"><%= Spree.t(:amount) %></th>
+ <th scope="col"><%= Spree.t(:included_in_price) %></th>
+ <th scope="col"><%= Spree.t(:show_rate_in_label) %></th>
+ <th scope="col"></th>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/tax_rates/_tax_rate.html.erb b/admin/app/views/spree/admin/tax_rates/_table_row.html.erb
similarity index 87%
rename from admin/app/views/spree/admin/tax_rates/_tax_rate.html.erb
rename to admin/app/views/spree/admin/tax_rates/_table_row.html.erb
index c2b3d37bfb..6023402afe 100644
--- a/admin/app/views/spree/admin/tax_rates/_tax_rate.html.erb
+++ b/admin/app/views/spree/admin/tax_rates/_table_row.html.erb
@@ -10,6 +10,6 @@
<td class="w-10" data-action="click->row-link#openLink"><%= active_badge(tax_rate.included_in_price?) %></td>
<td class="w-10" data-action="click->row-link#openLink"><%= active_badge(tax_rate.show_rate_in_label?) %></td>
<td class="w-10 actions">
- <%= link_to_edit(tax_rate, data: { row_link_target: 'link' }) if can? :edit, tax_rate %>
+ <%= link_to_edit(tax_rate, data: { row_link_target: 'link', turbo_frame: '_top' }) if can? :edit, tax_rate %>
</td>
</tr>
diff --git a/admin/app/views/spree/admin/tax_rates/index.html.erb b/admin/app/views/spree/admin/tax_rates/index.html.erb
index 1e5a8fc6a3..6eb8a0b095 100644
--- a/admin/app/views/spree/admin/tax_rates/index.html.erb
+++ b/admin/app/views/spree/admin/tax_rates/index.html.erb
@@ -4,34 +4,11 @@
<% content_for :page_actions do %>
<%= render_admin_partials(:tax_rates_actions_partials) %>
- <%= link_to_with_icon 'plus', Spree.t(:new_tax_rate), new_object_url, class: "btn btn-primary" %>
-<% end if can? :create, Spree::TaxRate %>
+ <%= link_to_with_icon 'plus', Spree.t(:new_tax_rate), new_object_url, class: "btn btn-primary" if can? :create, Spree::TaxRate %>
+<% end %>
<%= render_admin_partials(:tax_rates_header_partials) %>
<%= render 'spree/admin/shared/tax_nav' %>
-<div class="card-lg">
- <% if @collection.any? %>
- <div class="table-responsive">
- <table class="table">
- <thead>
- <tr data-hook="rate_header">
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:tax_category) %></th>
- <th><%= Spree.t(:zone) %></th>
- <th><%= Spree.t(:amount) %></th>
- <th><%= Spree.t(:included_in_price) %></th>
- <th><%= Spree.t(:show_rate_in_label) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <%= render partial: 'spree/admin/tax_rates/tax_rate', collection: @collection, cached: spree_base_cache_scope %>
- </tbody>
- </table>
- </div>
- <% else %>
- <%= render 'spree/admin/shared/no_resource_found' %>
- <% end %>
-</div>
+<%= render 'spree/admin/shared/index_table' %>
diff --git a/admin/app/views/spree/admin/taxonomies/_table_header.html.erb b/admin/app/views/spree/admin/taxonomies/_table_header.html.erb
new file mode 100644
index 0000000000..f9dafa0722
--- /dev/null
+++ b/admin/app/views/spree/admin/taxonomies/_table_header.html.erb
@@ -0,0 +1,6 @@
+<tr data-hook="listing_taxonomies_header">
+ <th class="no-border handel-head"></th>
+ <th scope="col"><%= Spree.t(:name) %></th>
+ <th scope="col"><%= Spree.t(:taxons) %></th>
+ <th scope="col"></th>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/taxonomies/_taxonomy.html.erb b/admin/app/views/spree/admin/taxonomies/_table_row.html.erb
similarity index 100%
rename from admin/app/views/spree/admin/taxonomies/_taxonomy.html.erb
rename to admin/app/views/spree/admin/taxonomies/_table_row.html.erb
diff --git a/admin/app/views/spree/admin/taxonomies/filters.html.erb b/admin/app/views/spree/admin/taxonomies/filters.html.erb
new file mode 100644
index 0000000000..db76107882
--- /dev/null
+++ b/admin/app/views/spree/admin/taxonomies/filters.html.erb
@@ -0,0 +1,6 @@
+<%= search_form_for [:admin, @search], class: "filter-wrap", data: {controller: "filters"} do |f| %>
+ <%= render 'spree/admin/shared/filters_search_bar', param: :name_cont, label: Spree.t(:name) %>
+
+ <%= render "spree/admin/shared/filter_badge_template" %>
+ <div data-filters-target="badgesContainer" class="filter-badges-container"></div>
+<% end %>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/taxonomies/index.html.erb b/admin/app/views/spree/admin/taxonomies/index.html.erb
index 84554f148f..6859ed1094 100644
--- a/admin/app/views/spree/admin/taxonomies/index.html.erb
+++ b/admin/app/views/spree/admin/taxonomies/index.html.erb
@@ -4,40 +4,9 @@
<% content_for :page_actions do %>
<%= render_admin_partials(:taxonomies_actions_partials) %>
- <%= link_to_with_icon 'plus', Spree.t(:new_taxonomy), new_object_url, class: "btn btn-primary" %>
-<% end if can?(:create, Spree::Taxonomy) %>
+ <%= link_to_with_icon 'plus', Spree.t(:new_taxonomy), new_object_url, class: "btn btn-primary" if can?(:create, Spree::Taxonomy) %>
+<% end %>
<%= render_admin_partials(:taxonomies_header_partials) %>
-<div class="card-lg">
- <%= search_form_for [:admin, @search], class: "filter-wrap", data: {controller: "filters"} do |f| %>
- <%= render 'spree/admin/shared/filters_search_bar', param: :name_cont, label: Spree.t(:name) %>
-
- <%= render "spree/admin/shared/filter_badge_template" %>
- <div data-filters-target="badgesContainer" class="filter-badges-container"></div>
- <% end %>
-
- <% if @taxonomies.present? %>
- <div class="table-responsive">
- <table class="table" id='listing_taxonomies'>
- <thead>
- <tr data-hook="listing_taxonomies_header">
- <th class="no-border handel-head"></th>
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:taxons) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody
- data-controller="sortable"
- data-sortable-handle-value=".move-handle"
- data-sortable-resource-name-value="taxonomy"
- >
- <%= render partial: "spree/admin/taxonomies/taxonomy", collection: @collection, cached: spree_base_cache_scope %>
- </tbody>
- </table>
- </div>
- <% else %>
- <%= render "spree/admin/shared/no_resource_found" %>
- <% end %>
-</div>
+<%= render 'spree/admin/shared/index_table', sortable: true %>
diff --git a/admin/app/views/spree/admin/users/index.html.erb b/admin/app/views/spree/admin/users/index.html.erb
index be792a567f..8a1a907d8a 100644
--- a/admin/app/views/spree/admin/users/index.html.erb
+++ b/admin/app/views/spree/admin/users/index.html.erb
@@ -48,12 +48,12 @@
<th scope="col" class="pr-0 w-5">
<%= bulk_operations_select_all_checkbox %>
</th>
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:email_marketing) %></th>
- <th><%= Spree.t(:location) %></th>
- <th><%= Spree.t('admin.num_orders') %></th>
- <th><%= Spree.t('admin.amount_spent') %></th>
- <th><%= sort_link @search, :created_at, Spree.t(:created_at) %></th>
+ <th scope="col"><%= Spree.t(:name) %></th>
+ <th scope="col"><%= Spree.t(:email_marketing) %></th>
+ <th scope="col"><%= Spree.t(:location) %></th>
+ <th scope="col"><%= Spree.t('admin.num_orders') %></th>
+ <th scope="col"><%= Spree.t('admin.amount_spent') %></th>
+ <th scope="col"><%= sort_link @search, :created_at, Spree.t(:created_at) %></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/variants/form/_inventory.html.erb b/admin/app/views/spree/admin/variants/form/_inventory.html.erb
index c5700715cf..0a770ad5c2 100644
--- a/admin/app/views/spree/admin/variants/form/_inventory.html.erb
+++ b/admin/app/views/spree/admin/variants/form/_inventory.html.erb
@@ -18,11 +18,11 @@
<table class="table <%= 'd-none' unless f.object.track_inventory? %>" data-reveal-target="item">
<thead>
<tr>
- <th><%= Spree.t(:stock_location) %></th>
- <th>
+ <th scope="col"><%= Spree.t(:stock_location) %></th>
+ <th scope="col">
<%= Spree.t(:count_on_hand) %>
</th>
- <th>
+ <th scope="col">
<%= Spree.t(:backorderable) %>
</th>
</tr>
diff --git a/admin/app/views/spree/admin/variants/form/_pricing.html.erb b/admin/app/views/spree/admin/variants/form/_pricing.html.erb
index 94ca7fc26e..a79827706b 100644
--- a/admin/app/views/spree/admin/variants/form/_pricing.html.erb
+++ b/admin/app/views/spree/admin/variants/form/_pricing.html.erb
@@ -12,11 +12,11 @@
<table class="table">
<thead>
<tr>
- <th><%= Spree.t(:currency) %></th>
- <th>
+ <th scope="col"><%= Spree.t(:currency) %></th>
+ <th scope="col">
<%= Spree.t(:amount) %>
</th>
- <th>
+ <th scope="col">
<%= Spree.t(:compare_at_amount) %>
<%= help_bubble(Spree.t('admin.variants_form.compare_at_price_description')) %>
</th>
diff --git a/admin/app/views/spree/admin/webhooks_subscribers/_form.html.erb b/admin/app/views/spree/admin/webhooks_subscribers/_form.html.erb
index 79a84ab698..a344100068 100644
--- a/admin/app/views/spree/admin/webhooks_subscribers/_form.html.erb
+++ b/admin/app/views/spree/admin/webhooks_subscribers/_form.html.erb
@@ -1,80 +1,74 @@
-<div class="row">
- <div class="col-12 col-lg-6">
- <div class="card mb-4">
- <div class="card-header">
- <h5 class="card-title">
- <%= Spree.t(:general_settings) %>
- </h5>
+<div class="card mb-4">
+ <div class="card-header">
+ <h5 class="card-title">
+ <%= Spree.t(:general_settings) %>
+ </h5>
+ </div>
+ <div class="card-body">
+ <div class="row">
+ <div class="form-group col-12">
+ <%= f.label :url, raw(Spree.t(:url) + required_span_tag) %>
+ <%= f.text_field :url, class: 'form-control', placeholder: 'https://example.com/endpoint' %>
+ <%= f.error_message_on :url %>
</div>
- <div class="card-body">
- <div class="row">
- <div class="form-group col-12">
- <%= f.label :url, raw(Spree.t(:url) + required_span_tag) %>
- <%= f.text_field :url, class: 'form-control', placeholder: 'https://example.com/endpoint' %>
- <%= f.error_message_on :url %>
- </div>
- <div class="form-group col-3">
- <div class="custom-control custom-switch">
- <%= f.check_box :active, class: 'custom-control-input' %>
- <%= f.label :active, class: 'custom-control-label' %>
- </div>
- </div>
+ <div class="form-group col-3">
+ <div class="custom-control custom-checkbox">
+ <%= f.check_box :active, class: 'custom-control-input' %>
+ <%= f.label :active, class: 'custom-control-label' %>
</div>
</div>
</div>
</div>
- <div class="col-12 col-lg-6">
- <div class="card mb-4">
- <div class="card-header">
- <h5 class="card-title">
- <%= Spree.t('admin.webhooks_subscribers.webhooks_events') %>
- </h5>
- </div>
- <div class="card-body" data-controller="reveal">
- <div class="form-group">
- <div>
- <div class="custom-control custom-radio mb-3">
- <%= radio_button_tag :subscribe_to_all_events, true,
- subscribe_to_all_events?,
- {
- 'data-action' => 'click->reveal#hide',
- class: 'custom-control-input events' } %>
- <%= label_tag :subscribe_to_all_events_true, Spree.t('admin.webhooks_subscribers.subscribe_to_all_events'), class: 'custom-control-label' %>
- </div>
- <div class="custom-control custom-radio">
- <%= radio_button_tag :subscribe_to_all_events, false,
- !subscribe_to_all_events?,
- { 'data-action' => 'click->reveal#show',
- class: 'custom-control-input events' } %>
- <%= label_tag :subscribe_to_all_events_false, Spree.t('admin.webhooks_subscribers.select_events'), class: 'custom-control-label' %>
+</div>
+<div class="card mb-4">
+ <div class="card-header">
+ <h5 class="card-title">
+ <%= Spree.t('admin.webhooks_subscribers.webhooks_events') %>
+ </h5>
+ </div>
+ <div class="card-body" data-controller="reveal">
+ <div class="form-group">
+ <div>
+ <div class="custom-control custom-radio mb-3">
+ <%= radio_button_tag :subscribe_to_all_events, true,
+ subscribe_to_all_events?,
+ {
+ 'data-action' => 'click->reveal#hide',
+ class: 'custom-control-input events' } %>
+ <%= label_tag :subscribe_to_all_events_true, Spree.t('admin.webhooks_subscribers.subscribe_to_all_events'), class: 'custom-control-label' %>
+ </div>
+ <div class="custom-control custom-radio">
+ <%= radio_button_tag :subscribe_to_all_events, false,
+ !subscribe_to_all_events?,
+ { 'data-action' => 'click->reveal#show',
+ class: 'custom-control-input events' } %>
+ <%= label_tag :subscribe_to_all_events_false, Spree.t('admin.webhooks_subscribers.select_events'), class: 'custom-control-label' %>
- <div data-reveal-target="item" class="<%= subscribe_to_all_events? ? 'hidden' : '' %>">
- <div class="bg-light rounded-lg p-3 mt-3">
- <% @supported_events.each do |event| %>
- <div class="form-group">
- <div class="custom-control custom-switch">
- <% resource_name = event.first %>
- <%= f.check_box resource_name,
- { class: 'events-checkbox custom-control-input',
- checked: @webhooks_subscriber.subscriptions&.any? { |event| event.include? "#{resource_name}." } },
- true,
- nil %>
-
- <%= f.label resource_name, class: 'custom-control-label w-100' do %>
- <%= Spree.t("#{resource_name.to_s.pluralize}") %>
- <p class="gap-2 mb-0 mt-1">
- <% event.last.each do |event| %>
- <span class="badge badge-light">
- <%= event %>
- </span>
- <% end %>
- </p>
+ <div data-reveal-target="item" class="<%= subscribe_to_all_events? ? 'hidden' : '' %>">
+ <div class="bg-light rounded-lg p-3 mt-3">
+ <% @supported_events.each do |event| %>
+ <div class="form-group">
+ <div class="custom-control custom-switch">
+ <% resource_name = event.first %>
+ <%= f.check_box resource_name,
+ { class: 'events-checkbox custom-control-input',
+ checked: @webhooks_subscriber.subscriptions&.any? { |event| event.include? "#{resource_name}." } },
+ true,
+ nil %>
+
+ <%= f.label resource_name, class: 'custom-control-label w-100' do %>
+ <%= Spree.t("#{resource_name.to_s.pluralize}") %>
+ <p class="gap-2 mb-0 mt-1">
+ <% event.last.each do |event| %>
+ <span class="badge badge-light">
+ <%= event %>
+ </span>
<% end %>
- </div>
- </div>
- <% end %>
+ </p>
+ <% end %>
+ </div>
</div>
- </div>
+ <% end %>
</div>
</div>
</div>
@@ -82,3 +76,4 @@
</div>
</div>
</div>
+
diff --git a/admin/app/views/spree/admin/webhooks_subscribers/_table_header.html.erb b/admin/app/views/spree/admin/webhooks_subscribers/_table_header.html.erb
new file mode 100644
index 0000000000..93bcea76ea
--- /dev/null
+++ b/admin/app/views/spree/admin/webhooks_subscribers/_table_header.html.erb
@@ -0,0 +1,7 @@
+<tr>
+ <th scope="col"><%= Spree.t(:url) %></th>
+ <th scope="col"><%= Spree.t(:active) %></th>
+ <th scope="col"><%= Spree.t('admin.webhooks_subscribers.subscriptions') %></th>
+ <th scope="col"><%= Spree.t('admin.webhooks_subscribers.time_of_last_event') %></th>
+ <th scope="col"></th>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/webhooks_subscribers/_webhooks_subscriber.html.erb b/admin/app/views/spree/admin/webhooks_subscribers/_table_row.html.erb
similarity index 100%
rename from admin/app/views/spree/admin/webhooks_subscribers/_webhooks_subscriber.html.erb
rename to admin/app/views/spree/admin/webhooks_subscribers/_table_row.html.erb
diff --git a/admin/app/views/spree/admin/webhooks_subscribers/edit.html.erb b/admin/app/views/spree/admin/webhooks_subscribers/edit.html.erb
index e06e2b42fb..f5b8f8cb5d 100644
--- a/admin/app/views/spree/admin/webhooks_subscribers/edit.html.erb
+++ b/admin/app/views/spree/admin/webhooks_subscribers/edit.html.erb
@@ -1,9 +1 @@
-<% content_for :page_title do %>
- <%= page_header_back_button spree.admin_webhooks_subscriber_path(@webhooks_subscriber) %>
- <%= @webhooks_subscriber.url %>
-<% end %>
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @webhooks_subscriber } %>
-<%= form_for [:admin, @webhooks_subscriber], html: { id: "edit_subscriber_#{@webhooks_subscriber.id}" } do |f| %>
- <%= render 'form', f: f %>
- <%= render 'spree/admin/shared/edit_resource_links', f: f %>
-<% end %>
+<%= render 'spree/admin/shared/edit_resource' %>
diff --git a/admin/app/views/spree/admin/webhooks_subscribers/index.html.erb b/admin/app/views/spree/admin/webhooks_subscribers/index.html.erb
index 7c3f1a137b..6b1a824b52 100644
--- a/admin/app/views/spree/admin/webhooks_subscribers/index.html.erb
+++ b/admin/app/views/spree/admin/webhooks_subscribers/index.html.erb
@@ -7,26 +7,4 @@
<%= render_admin_partials(:webhooks_subscribers_header_partials) %>
-<div class="card-lg">
- <% if @collection.any? %>
- <div class="table-responsive">
- <table class="table">
- <thead>
- <tr>
- <th><%= Spree.t(:url) %></th>
- <th><%= Spree.t(:active) %></th>
- <th><%= Spree.t('admin.webhooks_subscribers.subscriptions') %></th>
- <th><%= Spree.t('admin.webhooks_subscribers.time_of_last_event') %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <%= render partial: 'spree/admin/webhooks_subscribers/webhooks_subscriber', collection: @collection, cached: spree_base_cache_scope %>
- </tbody>
- </table>
- </div>
- <%= render 'spree/admin/shared/index_table_options', collection: @collection %>
- <% else %>
- <%= render 'spree/admin/shared/no_resource_found' %>
- <% end %>
-</div>
\ No newline at end of file
+<%= render 'spree/admin/shared/index_table' %>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/webhooks_subscribers/new.html.erb b/admin/app/views/spree/admin/webhooks_subscribers/new.html.erb
index 0fb2373261..65a817edc9 100644
--- a/admin/app/views/spree/admin/webhooks_subscribers/new.html.erb
+++ b/admin/app/views/spree/admin/webhooks_subscribers/new.html.erb
@@ -1,11 +1 @@
-<% content_for :page_title do %>
- <%= page_header_back_button spree.admin_webhooks_subscribers_path %>
- <%= Spree.t('admin.webhooks_subscribers.new_webhooks_subscriber') %>
-<% end %>
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @webhooks_subscriber } %>
-<%= form_for [:admin, @webhooks_subscriber] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </fieldset>
-<% end %>
+<%= render 'spree/admin/shared/new_resource' %>
diff --git a/admin/app/views/spree/admin/webhooks_subscribers/show.html.erb b/admin/app/views/spree/admin/webhooks_subscribers/show.html.erb
index 1da675905a..7ba60c318d 100644
--- a/admin/app/views/spree/admin/webhooks_subscribers/show.html.erb
+++ b/admin/app/views/spree/admin/webhooks_subscribers/show.html.erb
@@ -39,13 +39,13 @@
<table class="table card-body pb-0">
<thead>
<tr>
- <th><%= Spree.t('admin.name') %></th>
- <th><%= Spree.t('admin.successful') %></th>
- <th><%= Spree.t('admin.created_at') %></th>
- <th><%= Spree.t('admin.response_code') %></th>
- <th><%= Spree.t('admin.execution_time') %></th>
- <th><%= Spree.t('admin.errors') %></th>
- <th></th>
+ <th scope="col"><%= Spree.t('admin.name') %></th>
+ <th scope="col"><%= Spree.t('admin.successful') %></th>
+ <th scope="col"><%= Spree.t('admin.created_at') %></th>
+ <th scope="col"><%= Spree.t('admin.response_code') %></th>
+ <th scope="col"><%= Spree.t('admin.execution_time') %></th>
+ <th scope="col"><%= Spree.t('admin.errors') %></th>
+ <th scope="col"></th>
</tr>
</thead>
<tbody>
diff --git a/admin/app/views/spree/admin/zones/_table_header.html.erb b/admin/app/views/spree/admin/zones/_table_header.html.erb
new file mode 100644
index 0000000000..0d9aa059ca
--- /dev/null
+++ b/admin/app/views/spree/admin/zones/_table_header.html.erb
@@ -0,0 +1,8 @@
+<tr>
+ <th scope="col"><%= sort_link @search,:name, Spree.t(:name) %></th>
+ <th scope="col">
+ <%= sort_link @search,:description, Spree.t(:description) %>
+ </th>
+ <th scope="col"><%= Spree.t(:default_tax_zone) %></th>
+ <th scope="col"></th>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/zones/_table_row.html.erb b/admin/app/views/spree/admin/zones/_table_row.html.erb
new file mode 100644
index 0000000000..0fb6d6ac42
--- /dev/null
+++ b/admin/app/views/spree/admin/zones/_table_row.html.erb
@@ -0,0 +1,8 @@
+<tr id="<%= spree_dom_id zone %>" class="cursor-pointer" data-controller="row-link">
+ <td class="w-25" data-action="click->row-link#openLink"><%= zone.name %></td>
+ <td class="w-40 text-muted text-wrap" data-action="click->row-link#openLink"><%= zone.description %></td>
+ <td class="w-10" data-action="click->row-link#openLink"><%= active_badge(zone.default_tax?) %></td>
+ <td class="w-10 actions">
+ <%= link_to_edit(zone, data: { row_link_target: :link, turbo_frame: '_top' }) if can? :edit, zone %>
+ </td>
+</tr>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/zones/index.html.erb b/admin/app/views/spree/admin/zones/index.html.erb
index 64e4e0747b..3b5c446fd3 100644
--- a/admin/app/views/spree/admin/zones/index.html.erb
+++ b/admin/app/views/spree/admin/zones/index.html.erb
@@ -4,8 +4,8 @@
<% content_for :page_actions do %>
<%= render_admin_partials(:zones_actions_partials) %>
- <%= link_to_with_icon 'plus', Spree.t(:new_zone), new_object_url, class: "btn btn-primary" %>
-<% end if can? :create, Spree::Zone %>
+ <%= link_to_with_icon 'plus', Spree.t(:new_zone), new_object_url, class: "btn btn-primary" if can? :create, Spree::Zone %>
+<% end %>
<% content_for :page_alerts do %>
<div class="alert alert-info">
@@ -15,36 +15,4 @@
<%= render_admin_partials(:zones_header_partials) %>
-<div class="card-lg">
- <% if @collection.any? %>
- <div class="table-responsive">
- <table class="table">
- <thead>
- <tr>
- <th><%= sort_link @search,:name, Spree.t(:name) %></th>
- <th>
- <%= sort_link @search,:description, Spree.t(:description) %>
- </th>
- <th><%= Spree.t(:default_tax_zone) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <% @collection.each do |zone| %>
- <tr id="<%= spree_dom_id zone %>" class="cursor-pointer" data-controller="row-link">
- <td class="w-25" data-action="click->row-link#openLink"><%= zone.name %></td>
- <td class="w-40 text-muted text-wrap" data-action="click->row-link#openLink"><%= zone.description %></td>
- <td class="w-10" data-action="click->row-link#openLink"><%= active_badge(zone.default_tax?) %></td>
- <td class="w-10 actions">
- <%= link_to_edit(zone, data: { row_link_target: :link, turbo_frame: '_top' }) if can? :edit, zone %>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- <%= render 'spree/admin/shared/index_table_options', collection: @collection %>
- </div>
- <% else %>
- <%= render 'spree/admin/shared/no_resource_found' %>
- <% end %>
-</div>
\ No newline at end of file
+<%= render 'spree/admin/shared/index_table' %>
\ No newline at end of file
diff --git a/admin/config/locales/en.yml b/admin/config/locales/en.yml
index 41029b3708..f956a68ef6 100644
--- a/admin/config/locales/en.yml
+++ b/admin/config/locales/en.yml
@@ -102,6 +102,7 @@ en:
notifications: Notifications
num_orders: No. of Orders
oauth_applications:
+ client_id: Client ID
last_used: Last used
list: API keys
never: Never
diff --git a/api/app/models/spree/webhooks/subscriber.rb b/api/app/models/spree/webhooks/subscriber.rb
index 2cdf26ab2b..c5da0d81a9 100644
--- a/api/app/models/spree/webhooks/subscriber.rb
+++ b/api/app/models/spree/webhooks/subscriber.rb
@@ -11,7 +11,6 @@ module Spree
has_secure_token :secret_key
end
-
has_many :events, inverse_of: :subscriber
validates :url, 'spree/url': true, presence: true
@@ -55,6 +54,10 @@ module Spree
end
end
+ def name
+ url
+ end
+
private
def check_uri_path