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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Admin: Improved Order View (#12561)
Damian Legawiecb8a97049f9de
diff --git a/admin/app/assets/stylesheets/spree/admin/application.scss b/admin/app/assets/stylesheets/spree/admin/application.scssindex 1041f56417..a39def2a41 100644--- a/admin/app/assets/stylesheets/spree/admin/application.scss+++ b/admin/app/assets/stylesheets/spree/admin/application.scss@@ -20,6 +20,7 @@@import 'components/line_items_form';@import 'components/search_picker';@import 'components/sortable_tree';+@import 'components/bulk_panel';@import 'plugins/tinymce_custom';@import 'plugins/trix_custom';diff --git a/admin/app/assets/stylesheets/spree/admin/components/_badges.scss b/admin/app/assets/stylesheets/spree/admin/components/_badges.scssindex 498b05ac2f..9f20af8ea9 100644--- a/admin/app/assets/stylesheets/spree/admin/components/_badges.scss+++ b/admin/app/assets/stylesheets/spree/admin/components/_badges.scss@@ -49,6 +49,9 @@.badge-rejected,.badge-destroy,.badge-closed,+.badge-canceled,+.badge-partially_canceled,+.badge-void,.badge-danger {background-color: #fee2e1 !important;color: #8e1f0b !important;@@ -60,9 +63,6 @@.badge-balance_due,.badge-backorder,.badge-checkout,-.badge-canceled,-.badge-partially_canceled,-.badge-void,.badge-suspended,.badge-archived,.badge-warning,diff --git a/admin/app/assets/stylesheets/spree/admin/components/_bulk_panel.scss b/admin/app/assets/stylesheets/spree/admin/components/_bulk_panel.scssnew file mode 100644index 0000000000..dd2efee50c--- /dev/null+++ b/admin/app/assets/stylesheets/spree/admin/components/_bulk_panel.scss@@ -0,0 +1,31 @@+.bulk-panel-container {+ display: inline-flex;+ align-items: center;+ border-radius: $border-radius-lg;+ background-color: $white;+ padding: 0.5rem;+ box-shadow: $dropdown-box-shadow;+}++#bulk-panel {+ position: fixed;+ width: 100%;+ text-align: center;+ bottom: 1rem;+ left: 0;+ z-index: 1020;+}++@include media-breakpoint-up(lg) {+ #bulk-panel {+ left: 25%;+ width: 75%;+ }+}++@include media-breakpoint-up(xl) {+ #bulk-panel {+ left: 16.66666667%;+ width: 83.33333333%;+ }+}\ No newline at end of filediff --git a/admin/app/assets/stylesheets/spree/admin/components/_cards.scss b/admin/app/assets/stylesheets/spree/admin/components/_cards.scssindex 1f18112afb..538d4a774d 100644--- a/admin/app/assets/stylesheets/spree/admin/components/_cards.scss+++ b/admin/app/assets/stylesheets/spree/admin/components/_cards.scss@@ -44,7 +44,7 @@.card-header {display: flex;align-items: center;- height: 52px;+ height: 50px;border-bottom-color: $gray-50;.card-title {diff --git a/admin/app/assets/stylesheets/spree/admin/components/_dropdowns.scss b/admin/app/assets/stylesheets/spree/admin/components/_dropdowns.scssindex 34a817b6cc..ef0651c130 100644--- a/admin/app/assets/stylesheets/spree/admin/components/_dropdowns.scss+++ b/admin/app/assets/stylesheets/spree/admin/components/_dropdowns.scss@@ -30,15 +30,10 @@&:hover {background-color: $gray-50;-- i {- color: $gray-700 !important;- }}i {margin-right: 0.7rem;- color: $gray-500 !important;}.badge {diff --git a/admin/app/assets/stylesheets/spree/admin/components/_line_items_form.scss b/admin/app/assets/stylesheets/spree/admin/components/_line_items_form.scssindex 4901f285fc..8755a9d6b8 100644--- a/admin/app/assets/stylesheets/spree/admin/components/_line_items_form.scss+++ b/admin/app/assets/stylesheets/spree/admin/components/_line_items_form.scss@@ -1,16 +1,17 @@.order-line-items {- &__row,&__form {- display: grid;- grid-template-columns: [product_description] 1fr [price] 10% [quantity] 10% [subtotal] 10% [tax] 10% [discount] 10% [total] 10% [actions] 5%;- grid-auto-flow: row;- padding-bottom: 0.75rem;- padding-top: 0.75rem;+ padding: 0.75rem;+ border-bottom: 1px solid #e9ecef;+ }++ &__form:last-child {+ border-bottom: none;}&__form {- grid-column: 1/-1;- row-gap: 0.5rem;+ &:hover {+ background-color: $gray-25;+ }}}diff --git a/admin/app/assets/stylesheets/spree/admin/components/_main.scss b/admin/app/assets/stylesheets/spree/admin/components/_main.scssindex 430b5e1bf8..e8f1b8baa8 100644--- a/admin/app/assets/stylesheets/spree/admin/components/_main.scss+++ b/admin/app/assets/stylesheets/spree/admin/components/_main.scss@@ -10,36 +10,6 @@ turbo-frame[loading] .spinner-border, turbo-frame[busy] .spinner-border {white-space: nowrap;}-.list-group-item {- padding-left: 1rem;- padding-right: 1rem;-}--.border-1 {- border-width: 1px !important;-}--.list-group-item {- background-color: transparent;-}-.list-group-item.active, .list-group-item:active {- background-color: $gray-50;- .badge {- @extend .badge-primary;- }-}-.list-group-sidebar {- .list-group-item {- @extend .border-0;- @extend .bg-transparent;- @extend .text-dark;- border-radius: 9999px !important;- }- .list-group-item.active, .list-group-item:focus {- @extend .font-weight-bold;- }-}-#page-header {min-height: 74px;}diff --git a/admin/app/assets/stylesheets/spree/admin/components/_modals.scss b/admin/app/assets/stylesheets/spree/admin/components/_modals.scssindex 312b9575cb..370666d241 100644--- a/admin/app/assets/stylesheets/spree/admin/components/_modals.scss+++ b/admin/app/assets/stylesheets/spree/admin/components/_modals.scss@@ -35,15 +35,6 @@ body.modal-open {}}-.bulk-panel-container {- @extend .d-inline-flex;- @extend .p-2;- @extend .align-items-center;- @extend .rounded-lg;- @extend .bg-white;- box-shadow: $dropdown-box-shadow;-}-#multi-backdrop {z-index: 0;height: 0;diff --git a/admin/app/assets/stylesheets/spree/admin/global/_variables.scss b/admin/app/assets/stylesheets/spree/admin/global/_variables.scssindex df61c30c66..33ab02286c 100644--- a/admin/app/assets/stylesheets/spree/admin/global/_variables.scss+++ b/admin/app/assets/stylesheets/spree/admin/global/_variables.scss@@ -46,7 +46,7 @@ $theme-colors: ();$body-color: #303030 !default;-$body-bg: #FAFAF9 !default;+$body-bg: #FCFCFC !default;$enable-shadows: false;$enable-responsive-font-sizes: true;$font-family-sans-serif: Inter, sans-serif !default;@@ -114,8 +114,8 @@ $transition-collapse-width: width .15s ease !default;$badge-font-size: 0.70rem !default;$badge-font-weight: 500 !default;-$badge-padding-y: .35em !default;-$badge-padding-x: .5em !default;+$badge-padding-y: .25em !default;+$badge-padding-x: .45em !default;$badge-border-radius: $border-radius-sm !default;$transition-collapse: height .15s ease !default;@@ -143,7 +143,7 @@ $display4-weight: 400 !default;$dropdown-border-width: 0px !default;$dropdown-border-radius: $border-radius-lg !default;$dropdown-link-hover-bg: $gray-50 !default;-$dropdown-box-shadow: rgba(209, 217, 224, 0.5) 0px 0px 0px 1px, rgba(37, 41, 46, 0.04) 0px 6px 12px -3px, rgba(37, 41, 46, 0.12) 0px 6px 18px 0px !default;+$dropdown-box-shadow: rgba(209, 217, 224, 0.8) 0px 0px 0px 1px, rgba(37, 41, 46, 0.04) 0px 6px 12px -3px, rgba(37, 41, 46, 0.12) 0px 6px 18px 0px !default;$dropdown-padding-x: 0.25rem !default;$dropdown-padding-y: 0.25rem !default;@@ -171,4 +171,7 @@ $embed-responsive-aspect-ratios: (// tables$table-cell-padding: .75rem .50rem !default;-$code-color: $gray-600 !default;\ No newline at end of file+$code-color: $gray-600 !default;++$list-group-bg: transparent !default;+$list-group-item-padding-x: 1rem !default;\ No newline at end of filediff --git a/admin/app/assets/stylesheets/spree/admin/shared/_base.scss b/admin/app/assets/stylesheets/spree/admin/shared/_base.scssindex 719d0f6ef5..a2dfd3c630 100644--- a/admin/app/assets/stylesheets/spree/admin/shared/_base.scss+++ b/admin/app/assets/stylesheets/spree/admin/shared/_base.scss@@ -98,6 +98,9 @@ strong {.w-30 {width: 30%;}+.w-35 {+ width: 35%;+}.w-40 {width: 40%;}@@ -655,18 +658,14 @@ turbo-frame[busy] #turbo-spinner {.border-bottom-dashed {border-bottom-style: dashed !important;}+.border-top-dashed {+ border-top-style: dashed !important;+}body:has(.lg-container.lg-show) .modal {z-index: 1040;}-code {- @extend .bg-gray-50;- @extend .rounded;- @extend .px-2;- @extend .py-1;-}-.z-10 {z-index: 10;}@@ -674,29 +673,6 @@ code {z-index: 1000;}-#bulk-panel {- position: fixed;- width: 100%;- text-align: center;- bottom: 1rem;- left: 0;- z-index: 1020;-}--@include media-breakpoint-up(lg) {- #bulk-panel {- left: 25%;- width: 75%;- }-}--@include media-breakpoint-up(xl) {- #bulk-panel {- left: 16.66666667%;- width: 83.33333333%;- }-}-.turbo-frame-error {display: flex;width: 100%;diff --git a/admin/app/helpers/spree/admin/orders_helper.rb b/admin/app/helpers/spree/admin/orders_helper.rbindex 02e38058e9..a1a06f6626 100644--- a/admin/app/helpers/spree/admin/orders_helper.rb+++ b/admin/app/helpers/spree/admin/orders_helper.rb@@ -30,7 +30,7 @@ module Spreeelsif order.payment_state == 'paid'icon('check') + Spree.t('payment_states.paid')else- Spree.t("payment_states.#{order.payment_state}")+ icon('progress') + Spree.t("payment_states.#{order.payment_state}")endendenddiff --git a/admin/app/views/spree/admin/coupon_codes/_coupon_code.html.erb b/admin/app/views/spree/admin/coupon_codes/_coupon_code.html.erbindex 3c2d59068a..cf2e3d08ac 100644--- a/admin/app/views/spree/admin/coupon_codes/_coupon_code.html.erb+++ b/admin/app/views/spree/admin/coupon_codes/_coupon_code.html.erb@@ -2,8 +2,8 @@<td class="w-50"><div data-controller="clipboard"><code data-clipboard-target="source"><%= coupon_code[1].upcase %></code>- <button type="button" class="btn btn-link p-1 ml-2 with-tip" data-action="clipboard#copy" title="<%= Spree.t(:copy_to_clipboard) %>">- <%= icon('copy', class: 'mr-0 font-size-sm') %>+ <button type="button" class="btn btn-link p-1 ml-2 with-tip" data-action="clipboard#copy" title="<%= Spree.t('admin.copy_to_clipboard') %>">+ <%= icon('copy-check', class: 'mr-0 font-size-sm') %></button></div></td>diff --git a/admin/app/views/spree/admin/line_items/edit.html.erb b/admin/app/views/spree/admin/line_items/edit.html.erbindex 3759ceb410..f46a96f4fa 100644--- a/admin/app/views/spree/admin/line_items/edit.html.erb+++ b/admin/app/views/spree/admin/line_items/edit.html.erb@@ -1,36 +1,20 @@<%= turbo_frame_tag dom_id(@line_item) do %>- <%= form_with model: @line_item, url: spree.admin_order_line_item_path(@order, @line_item), class: "order-line-items__form" do |f| %>- <%= render 'spree/admin/variants/variant', variant: @line_item.variant %>- <span class="d-flex align-items-center justify-content-center">+ <div class="order-line-items__form d-flex align-items-center">+ <div class="w-35">+ <%= render 'spree/admin/variants/variant', variant: @line_item.variant %>+ </div>+ <div class="w-10"><%= @line_item.single_money.to_html %>- </span>- <span class="d-flex align-items-center justify-content-center">- <%= f.number_field :quantity, class: 'form-control', required: true, max: @line_item.variant.should_track_inventory? && !@line_item.variant.backorderable? ? @line_item.variant.total_on_hand + @line_item.quantity : nil, min: 1 %>- </span>- <span class="d-flex align-items-center justify-content-center">- <%= @line_item.display_amount %>- </span>- <span class="d-flex align-items-center justify-content-center">- <%= @line_item.display_additional_tax_total || @line_item.display_included_tax_total %>- </span>- <span class="d-flex align-items-center justify-content-center">- <%= @line_item.display_promo_total %>- </span>- <span class="d-flex align-items-center justify-content-center">- <%= @line_item.display_total %>- </span>- <span>- </span>- <% if can?(:delete, @line_item) %>- <span style="grid-column-start: product_description/">- <%= link_to Spree.t('actions.destroy'), spree.admin_order_line_item_path(@order, @line_item), data: { turbo_method: :delete, turbo_frame: '_top', turbo_confirm: Spree.t(:are_you_sure )}, class: 'btn btn-danger btn-sm' %>- </span>- <% end %>- <span class="d-flex gap-2 justify-content-center" style="grid-column: discount/-1">- <% if can?(:update, @line_item) %>+ </div>++ <div class="w-40 border rounded p-2 bg-white shadow-xs mx-auto">+ <%= form_with model: @line_item, url: spree.admin_order_line_item_path(@order, @line_item), class: "d-flex align-items-center gap-2 justify-content-between" do |f| %>+ <%= f.label :quantity, Spree.t('quantity'), class: 'm-0' %>+ <%= f.number_field :quantity, class: 'form-control form-control-sm', required: true, max: @line_item.variant.should_track_inventory? && !@line_item.variant.backorderable? ? @line_item.variant.total_on_hand + @line_item.quantity : nil, min: 1, autofocus: true %>+<%= turbo_save_button_tag Spree.t('actions.save'), data: { turbo_frame: '_top' }, type: :submit, class: 'btn btn-primary text-center btn-sm' %>+ <%= link_to Spree.t('actions.discard'), spree.edit_admin_order_path(@order), class: "btn btn-light btn-sm" %><% end %>- <%= link_to Spree.t('actions.discard'), spree.edit_admin_order_path(@order), class: "btn btn-light btn-sm" %>- </span>- <% end %>+ </div>+ </div><% end %>diff --git a/admin/app/views/spree/admin/orders/_customer_returns.html.erb b/admin/app/views/spree/admin/orders/_customer_returns.html.erbindex 88640b7058..e27b9edb63 100644--- a/admin/app/views/spree/admin/orders/_customer_returns.html.erb+++ b/admin/app/views/spree/admin/orders/_customer_returns.html.erb@@ -5,7 +5,7 @@<%= Spree.t(:customer_returns) %></h5></div><div class="card-body p-0">- <div class="table-responsive bg-white">+ <div class="table-responsive"><table class="table"><thead class="border-bottom"><tr>diff --git a/admin/app/views/spree/admin/orders/_customer_summary.html.erb b/admin/app/views/spree/admin/orders/_customer_summary.html.erbindex 69e7f767f2..028ee72c3b 100644--- a/admin/app/views/spree/admin/orders/_customer_summary.html.erb+++ b/admin/app/views/spree/admin/orders/_customer_summary.html.erb@@ -16,7 +16,7 @@<%= help_bubble('This order was placed by a guest customer') %><% else %><span class="text-muted">- <%= Spree.t(:not_provided) %>+ <%= Spree.t(:not_available) %></span><% end %><% end %>diff --git a/admin/app/views/spree/admin/orders/_header.html.erb b/admin/app/views/spree/admin/orders/_header.html.erbindex b0df3b0429..97d6fe600c 100644--- a/admin/app/views/spree/admin/orders/_header.html.erb+++ b/admin/app/views/spree/admin/orders/_header.html.erb@@ -7,9 +7,12 @@<%= @order.number %><%= order_payment_state(@order, class: "ml-3") %><%= order_shipment_state(@order, class: "ml-3") %>- <%= if @order.completed?- local_time(@order.completed_at, class: "badge badge-light with-tip ml-3")- end %>+ <% if @order.completed? %>+ <span class="text-muted font-size-sm font-weight-normal with-tip ml-3">+ <%= I18n.t('activerecord.attributes.spree/order.completed_at') %>+ <%= local_time(@order.completed_at) %>+ </span>+ <% end %><% end %><%# TODO: Fix mobile %>diff --git a/admin/app/views/spree/admin/orders/_line_item.html.erb b/admin/app/views/spree/admin/orders/_line_item.html.erbindex fe08149015..2f4c5baf53 100644--- a/admin/app/views/spree/admin/orders/_line_item.html.erb+++ b/admin/app/views/spree/admin/orders/_line_item.html.erb@@ -1,74 +1,61 @@-<%= turbo_frame_tag dom_id(line_item), class: "px-3 order-line-items__form hover-light" do %>- <%= render "spree/admin/variants/variant", variant: line_item.variant %>- <span class="d-flex align-items-center justify-content-center">- <%= line_item.single_money.to_html %>- </span>- <span class="d-flex align-items-center justify-content-center">- <%= line_item.quantity %>- </span>- <span class="d-flex align-items-center justify-content-center">- <%= line_item.display_amount %>- </span>- <span class="d-flex align-items-center justify-content-center">- <%= line_item.display_additional_tax_total || line_item.display_included_tax_total %>- </span>- <span class="d-flex align-items-center justify-content-center">- <%= line_item.display_promo_total %>- </span>- <span class="d-flex align-items-center justify-content-center">- <%= line_item.display_total %>- </span>- <span class="d-flex align-items-center justify-content-end">+<%= turbo_frame_tag dom_id(line_item) do %>+ <div class="order-line-items__form d-flex align-items-center">+ <div class="w-35">+ <%= render "spree/admin/variants/variant", variant: line_item.variant %>+ </div>+ <div class="w-10">+ <%= line_item.single_money.to_html %>+ </div>+ <div class="w-10">+ <%= line_item.quantity %>+ </div>+ <div class="w-10">+ <%= line_item.display_amount %>+ </div>+ <div class="w-10">+ <%= line_item.display_tax_total %>+ </div>+ <div class="w-10">+ <%= line_item.display_promo_total %>+ </div>+ <div class="w-10">+ <%= line_item.display_total %>+ </div>+ <div class="w-5">+ <% if can?(:edit, line_item) %>+ <div class="dropdown">+ <button+ class="btn btn-sm btn-light"+ type="button"+ data-toggle="dropdown"+ aria-expanded="false"+ >+ <%= icon "dots-vertical", class: "mr-0" %>+ </button>+ <div class="dropdown-menu dropdown-menu-right w-100">+ <%= link_to_with_icon "edit",+ Spree.t(:edit),+ spree.edit_admin_order_line_item_path(@order, line_item),+ class: "dropdown-item" %>+ <% if line_item.digital_links.any? %>+ <%= link_to_with_icon "refresh",+ Spree.t("admin.reset_digital_link_download_limits"),+ spree.reset_digital_links_limit_admin_order_line_item_path(@order, line_item),+ data: {+ turbo_method: :post,+ turbo_confirm: Spree.t(:are_you_sure),+ turbo_frame: :_top,+ },+ class: "dropdown-item" %>+ <% end %>- <% if line_item.digital_links.any? && can?(:edit, line_item) %>- <div class="dropdown">- <button- class="btn btn-sm btn-light"- type="button"- data-toggle="dropdown"- aria-expanded="false"- >- <%= icon "dots-vertical", class: "mr-0" %>- </button>- <div class="dropdown-menu dropdown-menu-right w-100" style="min-width: 200px;">- <%= link_to_with_icon "edit",- Spree.t(:edit),- spree.edit_admin_order_line_item_path(@order, line_item),- class: "btn-light dropdown-item",- data: {- test_id: :edit_line_item,- } %>- <%= link_to_with_icon "refresh",- Spree.t("admin.reset_digital_link_download_limits"),- spree.reset_digital_links_limit_admin_order_line_item_path(@order, line_item),- data: {- turbo_method: :post,- turbo_confirm: Spree.t(:are_you_sure),- turbo_frame: :_top,- },- class: "btn-light dropdown-item" %>+ <% if can?(:destroy, line_item) %>+ <div class="dropdown-divider"></div>+ <%= link_to_with_icon "trash", Spree.t('actions.destroy'), spree.admin_order_line_item_path(@order, line_item), data: { turbo_method: :delete, turbo_frame: '_top', turbo_confirm: Spree.t(:are_you_sure )}, class: 'dropdown-item btn-danger' %>+ <% end %>+ </div></div>- </div>- <% elsif line_item.digital_links.any? %>- <%= link_to_with_icon "refresh",- Spree.t("admin.reset_digital_link_download_limits"),- spree.reset_digital_links_limit_admin_order_line_item_path(@order, line_item),- data: {- turbo_method: :post,- turbo_confirm: Spree.t(:are_you_sure),- turbo_frame: :_top,- },- no_text: true,- class: "with-tip btn btn-sm btn-light" %>- <% elsif can?(:edit, line_item) %>- <%= link_to_with_icon "edit",- Spree.t(:edit),- spree.edit_admin_order_line_item_path(@order, line_item),- class: "with-tip btn btn-sm btn-light",- no_text: true,- data: {- test_id: :edit_line_item,- } %>- <% end %>- </span>+ <% end %>+ </div>+ </div><% end %>diff --git a/admin/app/views/spree/admin/orders/_line_items.html.erb b/admin/app/views/spree/admin/orders/_line_items.html.erbindex 952212b295..2b2ff64b30 100644--- a/admin/app/views/spree/admin/orders/_line_items.html.erb+++ b/admin/app/views/spree/admin/orders/_line_items.html.erb@@ -3,6 +3,7 @@<% if @line_items.any? %><div class="card-header d-flex justify-content-between align-items-center"><h5 class="card-title d-flex align-items-center">+ <%= icon('shopping-cart', class: 'mr-2') %><%= Spree.t(:line_items) %><span class="badge badge-info ml-2"><%= @line_items.count %></span></h5>@@ -15,48 +16,48 @@<% if @order.completed? %><button class="btn btn-light btn-sm" type="button" data-toggle="collapse" data-target="#line-items" aria-expanded="false" aria-controls="collapseExample"><%= Spree.t(:show_details) %>- <%= icon('selector', height: 12, class: 'mr-0 ml-1') %>+ <%= icon('selector', class: 'mr-0 ml-1') %></button><% end %></div></div><div class="card-body mb-0 p-0 <% if @order.completed? && params[:line_item_updated].blank? %>collapse<% else %>show<% end %>" id="line-items"><div class="order-line-items">- <div class="text-muted text-center border-bottom py-2 px-3 font-size-sm order-line-items__row">- <span class="text-left">+ <div class="d-flex align-items-center text-muted border-bottom py-2 px-3 font-size-sm order-line-items__row">+ <div class="w-35"><%= Spree.t(:item_description) %>- </span>- <span>+ </div>+ <div class="w-10"><%= Spree.t(:price) %>- </span>- <span>+ </div>+ <div class="w-10"><%= Spree.t(:quantity) %>- </span>- <span>+ </div>+ <div class="w-10"><%= Spree.t(:subtotal) %>- </span>- <span>+ </div>+ <div class="w-10"><%= Spree.t(:tax) %>- </span>- <span>+ </div>+ <div class="w-10"><%= Spree.t(:discount) %>- </span>- <span>+ </div>+ <div class="w-10"><%= Spree.t(:total) %>- </span>- <span>- </span>- </div>- <% if @line_items.any? %>- <%= render collection: @line_items, partial: 'spree/admin/orders/line_item', cached: spree_base_cache_scope %>- <% else %>- <div class="px-3 py-3 text-center text-muted" style="grid-column: 0/-1" >- No line items for this order yet.</div>- <% end %>+ <div class="w-5">+ </div>+ </div>+ <%= render collection: @line_items, partial: 'spree/admin/orders/line_item', cached: spree_base_cache_scope %></div></div><% elsif can?(:create, Spree::LineItem.new(order: @order)) %>+ <div class="card-header">+ <h5 class="card-title">+ <%= icon('shopping-cart', class: 'mr-2') %>+ <%= Spree.t(:line_items) %>+ </h5>+ </div><div class="card-body"><div data-toggle="modal" data-target="#modal"><%= link_to_with_icon 'plus', Spree.t(:new_line_item), spree.new_admin_order_line_item_path(@order), data: { turbo_frame: :dialog_modal }, class: "btn btn-link w-100 py-3" %>diff --git a/admin/app/views/spree/admin/orders/_list.html.erb b/admin/app/views/spree/admin/orders/_list.html.erbindex 4f0c714dfb..3483f390b3 100644--- a/admin/app/views/spree/admin/orders/_list.html.erb+++ b/admin/app/views/spree/admin/orders/_list.html.erb@@ -10,7 +10,7 @@<th><%= sort_link @search, :created_at, Spree.t(:date) %></th><% end %><th class="d-customer"><%= Spree.t(:customer) %></th>- <th><%= Spree.t(:fulfilled_from) %></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 class="text-right"><%= sort_link @search, :item_count, I18n.t(:item_count, scope: 'activerecord.attributes.spree/order') %></th>diff --git a/admin/app/views/spree/admin/orders/_payments.html.erb b/admin/app/views/spree/admin/orders/_payments.html.erbindex f57d1c5326..08ec06a9a7 100644--- a/admin/app/views/spree/admin/orders/_payments.html.erb+++ b/admin/app/views/spree/admin/orders/_payments.html.erb@@ -1,72 +1,35 @@-<% if @payments.any? && can?(:read, Spree::Payment) %>- <div class="card mb-4">- <% if @order.payment_state.present? %>- <div class="card-header justify-content-between">- <%= order_payment_state(@order) %>- <%= local_time(@payments.first.updated_at, class: 'badge badge-light with-tip') %>- </div>- <% else %>- <div class="card-header justify-content-between">- <span class="badge badge-info"><%= icon('progress') %><%= Spree.t(:processing) %></span>- <%= local_time(@payments.first.updated_at, class: 'badge badge-light with-tipl') %>- </div>- <% end %>- <div class="card-body p-0">- <% @payments.each do |payment| %>- <div class="p-3 border-bottom">- <%= render 'spree/admin/shared/payment', payment: payment %>- </div>+<% if can?(:read, Spree::Payment) && (@order.payment_required? && @order.bill_address.present?) || @payments.any? %>+ <div class="card mb-4 bg-transparent">+ <div class="card-header d-flex align-items-center border-0">+ <h6 class="card-title">+ <%= icon('credit-card-pay', class: 'mr-2') %>+ <%= Spree.t(:payments) %>+ </h6>+ <% if @payments.any? %>+ <span class="badge badge-info ml-2"><%= @payments.count %></span>+ <%= order_payment_state(@order, class: "ml-auto") %><% end %></div>- <div class="card-body">- <p class="d-flex justify-content-between align-items-center mb-0" id="risk-analysis-header">- <span>- <%= Spree.t(:risk_analysis) %>- - <% if @order.is_risky? %>- <span class="text-warning font-weight-normal"><%= icon('exclamation-circle') %> <%= Spree.t(:risky) %></span>- <% else %>- <span class="text-success font-weight-normal"><%= icon('check') %> <%= Spree.t(:not_risky) %></span>- <% end %>- </span>- <%= link_to '#risk-analysis', class: 'btn btn-light btn-sm', data: { toggle: 'collapse' } do %>- <%= Spree.t(:show_details) %>- <%= icon('selector', height: 12, class: 'mr-0 ml-1') %>- <% end %>- </p>- <%= render 'spree/admin/orders/risk_analysis', latest_payment: @payments.first %>- </div>+ <div class="card-body d-flex flex-column gap-2 px-1 pt-0 pb-1">+ <%= render collection: @payments, partial: 'spree/admin/payments/payment', as: :payment %>- <% if @refunds.any? %>- <div class="card-body border-top">- <h6><%= Spree.t(:refunds) %></h6>- <%= render partial: 'spree/admin/shared/refunds', locals: { refunds: @refunds, show_actions: can?(:edit, @refunds.first) } %>- </div>- <% end %>- </div>-<% end %>+ <% if @order.payment_total < @order.total && can?(:create, Spree::Payment.new(order: @order)) %>+ <div class="d-flex justify-content-center w-100 gap-3 p-3">+ <%= link_to_with_icon 'plus', Spree.t(:new_payment), spree.new_admin_order_payment_path(@order), class: 'btn btn-primary' %>-<% if @order.payment_required? && @order.bill_address.present? && @order.payment_total < @order.total && can?(:create, Spree::Payment.new(order: @order)) %>- <div class="card mb-4">- <div class="card-header justify-content-between">- <h5 class="card-title"><%= Spree.t(:payments) %></h5>- </div>- <div class="card-body">- <div class="d-flex mb-3 w-100 gap-3">- <%= link_to_with_icon 'plus', Spree.t(:new_payment), spree.new_admin_order_payment_path(@order), class: 'btn btn-primary' %>+ <% if spree.respond_to?(:checkout_state_url) %>+ <%= link_to_with_icon 'send', Spree.t('admin.send_payment_link'), spree.admin_order_payment_links_path(@order), data: { turbo_method: :post }, class: 'btn btn-light with-tip', title: Spree.t(:send_payment_link_title) %>- <% if spree.respond_to?(:checkout_state_url) %>- <%= link_to_with_icon 'send', Spree.t('admin.send_payment_link'), spree.admin_order_payment_links_path(@order), data: { turbo_method: :post }, class: 'btn btn-light with-tip', title: Spree.t(:send_payment_link_title) %>-- <div data-controller="clipboard">- <input type="hidden" value="<%= spree.checkout_state_url(@order.token, :payment, host: current_store.url_or_custom_domain) %>" readonly data-clipboard-target="source">- <button class="btn btn-light" type="button" data-action="click->clipboard#copy">- <%= icon('copy') %>- <%= Spree.t('admin.copy_payment_link') %>- </button>- </div>- <% end %>- </div>+ <div data-controller="clipboard" data-clipboard-success-content-value="<%= Spree.t('admin.copied') %>">+ <input type="hidden" value="<%= spree.checkout_state_url(@order.token, :payment, host: current_store.url_or_custom_domain) %>" readonly data-clipboard-target="source">+ <button class="btn btn-light" type="button" data-clipboard-target="button" data-action="click->clipboard#copy">+ <%= icon('copy-check') %>+ <%= Spree.t('admin.copy_payment_link') %>+ </button>+ </div>+ <% end %>+ </div>+ <% end %></div></div>-<% end %>+<% end %>\ No newline at end of filediff --git a/admin/app/views/spree/admin/orders/_refunds.html.erb b/admin/app/views/spree/admin/orders/_refunds.html.erbnew file mode 100644index 0000000000..18b1ea135a--- /dev/null+++ b/admin/app/views/spree/admin/orders/_refunds.html.erb@@ -0,0 +1,49 @@+<% if @refunds.any? %>+ <div class="card mb-4">+ <div class="card-header d-flex align-items-center">+ <h6 class="card-title">+ <%= icon('credit-card-refund', class: 'mr-2') %>+ <%= Spree.t(:refunds) %>+ </h6>+ <span class="badge badge-info ml-2"><%= @refunds.count %></span>+ </div>+ <div class="card-body p-0">+ <div class="table-responsive">+ <table class="table table-condensed" id='refunds' data-order-id='<%= @order.number %>'>+ <thead class="text-muted">+ <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>+ </tr>+ </thead>+ <tbody>+ <% @refunds.each do |refund| %>+ <tr id="<%= spree_dom_id(refund) %>">+ <td class="amount"><%= refund.display_amount %></td>+ <td>+ <% if refund.transaction_id.present? %>+ <span class="badge badge-success"><%= icon('check') %><%= Spree.t('state_machine_states.completed') %></span>+ <% else %>+ <span class="badge badge-warning"><%= icon('clock') %><%= Spree.t('state_machine_states.pending') %></span>+ <% end %>+ </td>+ <td><%= truncate(refund.reason.name, length: 100) %></td>+ <td><%= local_time(refund.created_at) %></td>+ <% if refund.editable? && can?(:edit, refund) %>+ <td class="actions">+ <span data-toggle="modal" data-target="#modal">+ <%= link_to_with_icon('edit', Spree.t(:edit), spree.edit_admin_order_payment_refund_path(refund.payment.order, refund.payment, refund), no_text: true, data: { turbo_frame: 'dialog_modal' }, class: "btn btn-light btn-sm") if can?(:edit, refund) %>+ </span>+ </td>+ <% end %>+ </tr>+ <% end %>+ </tbody>+ </table>+ </div>+ </div>+ </div>+<% end %>\ No newline at end of filediff --git a/admin/app/views/spree/admin/orders/_return_authorizations.html.erb b/admin/app/views/spree/admin/orders/_return_authorizations.html.erbindex ec81d311b8..2df9f7ec6b 100644--- a/admin/app/views/spree/admin/orders/_return_authorizations.html.erb+++ b/admin/app/views/spree/admin/orders/_return_authorizations.html.erb@@ -5,7 +5,7 @@<%= Spree.t(:return_authorizations) %></h5></div><div class="card-body p-0">- <div class="table-responsive bg-white">+ <div class="table-responsive"><table class="table"><thead class="border-bottom"><tr>diff --git a/admin/app/views/spree/admin/orders/_risk_analysis.html.erb b/admin/app/views/spree/admin/orders/_risk_analysis.html.erbindex 7f98d41358..21c0b3890c 100644--- a/admin/app/views/spree/admin/orders/_risk_analysis.html.erb+++ b/admin/app/views/spree/admin/orders/_risk_analysis.html.erb@@ -1,21 +1,10 @@-<ul class="list-group mt-3 mb-3 collapse" id="risk-analysis">- <li class="list-group-item d-flex justify-content-between align-items-center">- <%= Spree.t(:failed_payment_attempts) %>- <span class="badge badge-<%= @payments.failed.any? ? 'warning' : 'complete' %>">- <% if @payments.failed.any? %>- <%= icon('exclamation-circle') %>- <% else %>- <%= icon('check') %>- <% end %>- <%= Spree.t 'payments_count', count: @payments.failed.count, default: pluralize(@payments.failed.count, Spree.t(:payment_attempts)) %>- </span>- </li>+<ul class="list-group mt-3 collapse" id="risk-analysis-<%= payment.id %>"><li class="list-group-item d-flex justify-content-between align-items-center"><%= Spree.t(:avs_response) %>- <span class="badge badge-<%= latest_payment.is_avs_risky? ? 'warning' : 'complete' %>">- <% if latest_payment.is_avs_risky? %>+ <span class="badge badge-<%= payment.is_avs_risky? ? 'warning' : 'complete' %>">+ <% if payment.is_avs_risky? %><%= icon('exclamation-circle') %>- <%= "#{Spree.t(:error)}: #{avs_response_code[latest_payment.avs_response]}" %>+ <%= "#{Spree.t(:error)}: #{avs_response_code[payment.avs_response]}" %><% else %><%= icon('check') %><%= Spree.t(:success) %>@@ -24,10 +13,10 @@</li><li class="list-group-item d-flex justify-content-between align-items-center"><%= Spree.t(:cvv_response) %>- <span class="badge badge-<%= latest_payment.is_cvv_risky? ? 'warning' : 'complete' %>">- <% if latest_payment.is_cvv_risky? %>+ <span class="badge badge-<%= payment.is_cvv_risky? ? 'warning' : 'complete' %>">+ <% if payment.is_cvv_risky? %><%= icon('exclamation-circle') %>- <%= "#{Spree.t(:error)}: #{cvv_response_code[latest_payment.cvv_response_code]}" %>+ <%= "#{Spree.t(:error)}: #{cvv_response_code[payment.cvv_response_code]}" %><% else %><%= icon('check') %><%= Spree.t(:success) %>diff --git a/admin/app/views/spree/admin/orders/_shipment.html.erb b/admin/app/views/spree/admin/orders/_shipment.html.erbindex 76f9a12b21..561c535bc3 100644--- a/admin/app/views/spree/admin/orders/_shipment.html.erb+++ b/admin/app/views/spree/admin/orders/_shipment.html.erb@@ -1,20 +1,24 @@<% order ||= shipment.order %>-<%= turbo_frame_tag dom_id(shipment), class: "card mb-4" do %>- <div class="card-header stock-location justify-content-between flex-wrap pb-3" data-hook="stock-location" id="shipment">- <span class="shipment-number d-none"><%= shipment.number %></span>- <span class="d-flex align-items-center"><%= shipment_state(shipment.state, class: 'mr-3') %></span>- <% if shipment.shipped_at.present? %>- <small class="text-muted text-xs mr-2">- <%= Spree.t(:fulfilled_at).downcase %>- <%= local_time_ago(shipment.shipped_at, class: 'with-tip') %>- </small>- <% end %>+<%= turbo_frame_tag dom_id(shipment), class: "card" do %>+ <div class="card-header align-items-center justify-content-between">+ <div class="d-flex align-items-center gap-2">+ <span class="d-flex align-items-center"><%= shipment_state(shipment.state) %></span>+ <strong class="shipment-number"><%= shipment.number %></strong>+ <% if shipment.shipped_at.present? %>+ <small class="text-muted">+ <%= local_time_ago(shipment.shipped_at, class: 'with-tip') %>+ </small>+ <% end %>+ </div><span class="d-flex justify-content-between align-items-center gap-2">- <strong><%= shipment.number %></strong>- <small class="text-muted"><%= Spree.t(:fulfilled_from).downcase %></small>- <strong class="stock-location-name" data-hook="stock-location-name">- <%= shipment.stock_location.name %>+ <small class="text-muted"><%= Spree.t(:package_from).downcase %></small>+ <strong>+ <% if can?(:edit, shipment.stock_location) %>+ <%= link_to shipment.stock_location.name, spree.edit_admin_stock_location_path(shipment.stock_location), data: { turbo_frame: '_top' } %>+ <% else %>+ <%= shipment.stock_location.name %>+ <% end %></strong></span></div>@@ -38,7 +42,7 @@</div><%= render collection: shipment.manifest, partial: 'spree/admin/orders/shipment_manifest_item', as: :item, locals: { shipment: shipment } %></div>- <%= turbo_frame_tag dom_id(shipment, :shipping_method), class: "hover-light py-2 px-3 d-flex justify-content-between align-items-center min-h-14" do %>+ <%= turbo_frame_tag dom_id(shipment, :shipping_method), class: "py-2 px-3 d-flex justify-content-between align-items-center min-h-14" do %><div><% if rate = shipment.selected_shipping_rate %><strong><%= rate.name %></strong>@@ -56,33 +60,37 @@<% end %><% unless shipment.digital? %>- <%= turbo_frame_tag dom_id(shipment, :tracking), class: "hover-light border-top px-3 d-flex justify-content-between align-items-center min-h-14" do %>+ <%= turbo_frame_tag dom_id(shipment, :tracking), class: "border-top px-3 d-flex justify-content-between align-items-center min-h-14" do %><div class="py-3">+ <strong><%= Spree.t(:tracking) %>: </strong><% if shipment.tracked? %>- <strong><%= Spree.t(:tracking) %>: </strong><% if shipment.tracking_url.present? %><span><%= link_to shipment.tracking, shipment.tracking_url, target: '_blank', rel: "noopener noreferrer" %></span><% elsif shipment.tracking.present? %><span><%= shipment.tracking %></span><% end %><% else %>- <%= Spree.t('admin.add_tracking_details') %>+ <span class="text-muted"><%= Spree.t(:no_tracking_present) %></span><% end %></div><% if can?(:update, shipment) && (!order.canceled? && !shipment.canceled?) %>- <%= link_to_with_icon 'edit', Spree.t(:edit), spree.edit_admin_order_shipment_path(order, shipment), class: 'edit-tracking btn btn-light btn-sm with-tip', no_text: true, title: Spree.t(:edit) %>+ <% if shipment.tracking.present? %>+ <%= link_to_with_icon 'edit', Spree.t(:edit), spree.edit_admin_order_shipment_path(order, shipment), class: 'btn btn-light btn-sm with-tip', no_text: true, title: Spree.t(:edit) %>+ <% else %>+ <%= link_to_with_icon 'plus', Spree.t(:add_one), spree.edit_admin_order_shipment_path(order, shipment), class: 'btn btn-light btn-sm with-tip', no_text: true, title: Spree.t(:add_one) %>+ <% end %><% end %><% end %><% end %><% if can_ship?(shipment) %>- <div class="card-footer d-flex justify-content-end">+ <div class="card-footer d-flex justify-content-end border-top bg-gray-25"><% if shipment.tracked? %><%= link_to_with_icon 'send.svg', Spree.t(:ship), spree.ship_admin_order_shipment_path(order, shipment), class: 'ml-auto btn btn-primary mb-0', data: {turbo_method: :post, turbo_confirm: Spree.t(:are_you_sure)} %><% elsif !shipment.digital? %><span class="ship-tooltip with-tip ship ml-auto btn btn-primary disabled mb-0" data-toggle="tooltip" data-placement="left" title="Before marking shipment as shipped please provide tracking details">- <%= icon 'send.svg'%>+ <%= icon 'send' %><%= Spree.t(:ship) %></span><% else %>diff --git a/admin/app/views/spree/admin/orders/_shipments.html.erb b/admin/app/views/spree/admin/orders/_shipments.html.erbindex ed92e19982..a745ef6a24 100644--- a/admin/app/views/spree/admin/orders/_shipments.html.erb+++ b/admin/app/views/spree/admin/orders/_shipments.html.erb@@ -1,7 +1,22 @@-<% if @shipments.any? %>- <%= render partial: "shipment", collection: @shipments %>-<% elsif [email protected]?(['address', 'cart']) %>- <p class="text-center text-muted p-3">- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Shipment)) %>- </p>-<% end %>\ No newline at end of file+<div class="card mb-4 bg-transparent">+ <div class="card-header d-flex align-items-center border-0">+ <h6 class="card-title">+ <%= icon('truck', class: 'mr-2') %>+ <%= Spree.t(:shipments) %>+ </h6>+ <% if @shipments.any? %>+ <span class="badge badge-info ml-2"><%= @shipments.count %></span>++ <%= order_shipment_state(@order, class: "ml-auto") %>+ <% end %>+ </div>+ <div class="card-body px-1 pt-0 pb-1 d-flex flex-column gap-2">+ <% if @shipments.any? %>+ <%= render partial: "shipment", collection: @shipments %>+ <% else %>+ <p class="text-center text-muted p-5">+ <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Shipment)) %>+ </p>+ <% end %>+ </div>+</div>diff --git a/admin/app/views/spree/admin/orders/_summary.html.erb b/admin/app/views/spree/admin/orders/_summary.html.erbindex c001f04670..608087b863 100644--- a/admin/app/views/spree/admin/orders/_summary.html.erb+++ b/admin/app/views/spree/admin/orders/_summary.html.erb@@ -29,7 +29,7 @@<% if @order.promo_total != 0 %><li class="list-group-item d-flex justify-content-between align-items-center border-0">- <span><%= Spree.t(:discounts) %></span>+ <span><%= Spree.t(:discount_amount) %></span><span class="text-right span" id='date_complete'><%= @order.display_promo_total.to_html %></span>@@ -47,36 +47,32 @@</li><% end %>- <% if @order.included_tax_total != 0 %>- <li class="list-group-item d-flex justify-content-between align-items-center border-0">- <span data-hook='admin_order_tab_included_tax_title'><%= Spree.t(:tax_included) %></span>- <span id='included_tax_total'>- <%= @order.display_included_tax_total.to_html %>- </span>- </li>- <% end %>+ <li class="list-group-item d-flex justify-content-between align-items-center border-0">+ <span data-hook='admin_order_tab_included_tax_title'><%= Spree.t(:tax_included) %></span>+ <span id='included_tax_total'>+ <%= @order.display_included_tax_total.to_html %>+ </span>+ </li>- <% if @order.additional_tax_total != 0 %>- <% tax_lines = order_summary_tax_lines_additional(@order) %>+ <% tax_lines = order_summary_tax_lines_additional(@order) %>- <li class="list-group-item border-0">- <span class="d-flex justify-content-between align-items-center">- <span><%= Spree.t(:tax) %></span>- <span id="additional_tax_total">- <% if tax_lines.any? %>- <%= link_to '#tax-lines-additional', class: 'btn btn-light btn-sm mr-2', data: { toggle: 'collapse' } do %>- <%= Spree.t(:show_details) %>- <%= icon('selector', height: 12, class: 'mr-0 ml-1') %>- <% end %>+ <li class="list-group-item border-0">+ <span class="d-flex justify-content-between align-items-center">+ <span><%= Spree.t(:tax) %></span>+ <span id="additional_tax_total">+ <% if tax_lines.any? %>+ <%= link_to '#tax-lines-additional', class: 'btn btn-light btn-sm mr-2', data: { toggle: 'collapse' } do %>+ <%= Spree.t(:show_details) %>+ <%= icon('selector', height: 12, class: 'mr-0 ml-1') %><% end %>+ <% end %>- <%= @order.display_additional_tax_total.to_html %>- </span>+ <%= @order.display_additional_tax_total.to_html %></span>+ </span>- <%= render 'tax_lines', tax_lines: tax_lines, id: 'tax-lines-additional' %>- </li>- <% end %>+ <%= render 'tax_lines', tax_lines: tax_lines, id: 'tax-lines-additional' %>+ </li><%= render 'summary_custom', order: @order %>@@ -86,5 +82,19 @@<%= @order.display_total.to_html %></span></li>++ <li class="list-group-item d-flex justify-content-between align-items-center border-top bg-gray-25">+ <span data-hook='admin_order_tab_payment_total_title'><%= Spree.t(:payment_total) %></span>+ <span id='payment_total'>+ <%= @order.display_payment_total.to_html %>+ </span>+ </li>++ <li class="list-group-item d-flex justify-content-between align-items-center bg-gray-25">+ <span data-hook='admin_order_tab_outstanding_balance_title'><%= Spree.t(:outstanding_balance) %></span>+ <span id='outstanding_balance'>+ <%= @order.display_outstanding_balance.to_html %>+ </span>+ </li></ul></div>diff --git a/admin/app/views/spree/admin/orders/customer_returns/_customer_return.html.erb b/admin/app/views/spree/admin/orders/customer_returns/_customer_return.html.erbindex 73bd1d2e5d..d9c35acb50 100644--- a/admin/app/views/spree/admin/orders/customer_returns/_customer_return.html.erb+++ b/admin/app/views/spree/admin/orders/customer_returns/_customer_return.html.erb@@ -26,7 +26,7 @@</td><td data-action="click->row-link#openLink"><%= customer_return.display_pre_tax_total.to_html %></td><td data-action="click->row-link#openLink"><%= local_time(customer_return.created_at) %></td>- <td>+ <td class="text-right"><% if can_create_reimbursement %><span class="dropdown"><buttondiff --git a/admin/app/views/spree/admin/orders/customer_returns/edit.html.erb b/admin/app/views/spree/admin/orders/customer_returns/edit.html.erbindex caead0c1fa..0476ab31a0 100644--- a/admin/app/views/spree/admin/orders/customer_returns/edit.html.erb+++ b/admin/app/views/spree/admin/orders/customer_returns/edit.html.erb@@ -1,13 +1,12 @@<% content_for :page_title do %><%= page_header_back_button spree.edit_admin_order_path(@order) %><div class="d-flex gap-3 align-items-center">- <span><%= Spree.t(:customer_return) %></span>- <span><%= @customer_return.number %></span>+ <%= @customer_return.number %><% if @customer_return.fully_reimbursed? %>- <span class="badge badge-pill badge-success"><%= Spree.t(:reimbursed) %></span>+ <span class="badge badge-success"><%= Spree.t(:reimbursed) %></span><% else %>- <span class="badge badge-pill badge-inactive"><%= Spree.t(:incomplete) %></span>+ <span class="badge badge-inactive"><%= Spree.t(:incomplete) %></span><% end %></div><% end %>diff --git a/admin/app/views/spree/admin/orders/edit.html.erb b/admin/app/views/spree/admin/orders/edit.html.erbindex a3c19c5384..33becd1ef8 100644--- a/admin/app/views/spree/admin/orders/edit.html.erb+++ b/admin/app/views/spree/admin/orders/edit.html.erb@@ -10,6 +10,7 @@<%= render 'customer_returns' %><%= render 'return_authorizations' %><%= render 'payments'%>+ <%= render 'refunds'%><%= render 'body_custom' %><%= render 'summary' %>diff --git a/admin/app/views/spree/admin/orders/return_authorizations/_return_authorization.html.erb b/admin/app/views/spree/admin/orders/return_authorizations/_return_authorization.html.erbindex 87416f491b..5020e1714c 100644--- a/admin/app/views/spree/admin/orders/return_authorizations/_return_authorization.html.erb+++ b/admin/app/views/spree/admin/orders/return_authorizations/_return_authorization.html.erb@@ -17,13 +17,13 @@<%= link_to return_authorization.number, edit_link %></td><td data-action="click->row-link#openLink">- <small class="badge badge-pill badge-<%= return_authorization.state %>">+ <small class="badge badge-<%= return_authorization.state %>"><%= Spree.t("return_authorization_states.#{return_authorization.state}") %></small></td><td data-action="click->row-link#openLink"><%= return_authorization.display_pre_tax_total.to_html %></td><td data-action="click->row-link#openLink"><%= local_time(return_authorization.created_at) %></td>- <td data-action="click->row-link#openLink">+ <td data-action="click->row-link#openLink" class="text-right"><%= link_to_edit(return_authorization,no_text: true,diff --git a/admin/app/views/spree/admin/orders/return_authorizations/edit.html.erb b/admin/app/views/spree/admin/orders/return_authorizations/edit.html.erbindex fdbaae59cf..663d078c85 100644--- a/admin/app/views/spree/admin/orders/return_authorizations/edit.html.erb+++ b/admin/app/views/spree/admin/orders/return_authorizations/edit.html.erb@@ -2,10 +2,9 @@<%= page_header_back_button spree.edit_admin_order_path(@order) %><div class="d-flex gap-3 align-items-center">- <span><%= Spree.t(:return_authorization) %></span>- <span><%= @return_authorization.number %></span>+ <%= @return_authorization.number %>- <span class="badge badge-pill badge-<%= @return_authorization.state %>">+ <span class="badge badge-<%= @return_authorization.state %>"><%= Spree.t("return_authorization_states.#{@return_authorization.state}") %></span></div>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.erbindex 473a9abd92..0a7e2475bc 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@@ -3,7 +3,7 @@<div class="d-flex gap-3 align-items-center"><span><%= Spree.t(:return_authorization) %></span><span><%= @return_authorization.number %></span>- <span class="badge badge-pill badge-<%= @return_authorization.state %>">+ <span class="badge badge-<%= @return_authorization.state %>"><%= Spree.t("return_authorization_states.#{@return_authorization.state}") %></span><%= local_time(diff --git a/admin/app/views/spree/admin/payments/_payment.html.erb b/admin/app/views/spree/admin/payments/_payment.html.erbnew file mode 100644index 0000000000..449b404055--- /dev/null+++ b/admin/app/views/spree/admin/payments/_payment.html.erb@@ -0,0 +1,81 @@+<div class="card" id="<%= dom_id(payment) %>">+ <div class="card-header d-flex align-items-center gap-2">+ <span class="badge badge-<%= payment.state %>">+ <% if payment.completed? %>+ <%= icon('check', class: 'mr-2') %>+ <% else %>+ <%= icon('progress', class: 'mr-2') %>+ <% end %>+ <%= Spree.t('payment_states.' + payment.state) %>+ </span>+ <% if payment.payment_method.payment_icon_name.present? %>+ <%= payment_method_icon_tag(payment.payment_method.payment_icon_name) %>+ <% end %>+ <strong><%= payment.number.upcase %></strong>+ <%= local_time(payment.created_at, class: 'ml-auto text-muted font-size-sm') %>++ <div class="dropdown">+ <button class="btn btn-light btn-sm" type="button" data-toggle="dropdown" aria-expanded="false">+ <%= icon('dots', class: 'mr-0') %>+ </button>+ <div class="dropdown-menu">+ <% if payment.try(:gateway_dashboard_payment_url).present? %>+ <%= link_to_with_icon 'eye', Spree.t(:details), payment.gateway_dashboard_payment_url, class: 'dropdown-item', target: '_blank' %>+ <% end %>+ <% if payment.source.is_a?(Spree::StoreCredit) && payment.source.respond_to?(:gift_card) && payment.source.gift_card.present? %>+ <%= link_to_with_icon 'eye', Spree.t(:details), spree.edit_admin_gift_card_path(payment.source.gift_card), class: 'dropdown-item' %>+ <% end %>++ <% if can?(:update, payment) && (payment.checkout? || payment.pending?) %>+ <%= link_to_with_icon 'check', Spree.t(:capture), spree.capture_admin_order_payment_path(@order, payment), class: 'dropdown-item', data: { turbo_method: :put, turbo_confirm: Spree.t(:are_you_sure) } %>+ <% end %>+ <% if can?(:refund, @order) && payment.completed? && payment.can_credit? %>+ <%= link_to_with_icon 'credit-card-refund', Spree.t(:refund), spree.new_admin_order_payment_refund_path(@order, payment), class: 'dropdown-item' %>+ <% end %>+ <% if can?(:cancel, payment) && payment.pending? %>+ <%= link_to_with_icon 'cancel', Spree.t(:void), spree.void_admin_order_payment_path(@order, payment), class: 'dropdown-item', data: { turbo_method: :put, turbo_confirm: Spree.t(:are_you_sure) } %>+ <% end %>+ <% if can?(:destroy, payment) && payment.can_be_deleted? %>+ <div class="dropdown-divider"></div>+ <%= link_to_with_icon 'trash', Spree.t('actions.destroy'), spree.admin_order_payment_path(@order, payment), class: 'dropdown-item btn-danger', data: { turbo_method: :delete, turbo_confirm: Spree.t(:are_you_sure) } %>+ <% end %>+ </div>+ </div>+ </div>+ <div class="card-body">+ <div class="d-flex">+ <div class="w-50">+ <p class="mb-2"><%= Spree.t(:payment_method) %>:</p>+ <strong><%= link_to payment.payment_method.name, spree.admin_payment_method_path(payment.payment_method) %></strong>+ </div>+ <% if payment.source.present? %>+ <div class="w-50">+ <p class="mb-2"><%= Spree.t(:payment_source) %>:</p>+ <div class="rounded-lg bg-gray-25 border shadow-xs p-3">+ <%= render 'spree/shared/payment', payment: payment %>+ </div>+ </div>+ <% end %>+ </div>+ </div>+ <% if payment.transaction_id.present? %>+ <div class="card-footer border-top border-top-dashed">+ <p class="mb-0 d-flex justify-content-between align-items-center">+ <span>+ <%= Spree.t(:risk_analysis) %>+ + <% if @order.is_risky? %>+ <span class="badge badge-warning"><%= icon('shield-off') %> <%= Spree.t(:risky) %></span>+ <% else %>+ <span class="text-success"><%= icon('shield-check-filled') %> <%= Spree.t(:not_risky) %></span>+ <% end %>+ </span>+ <%= link_to "#risk-analysis-#{payment.id}", class: 'btn btn-light btn-sm bg-transparent', data: { toggle: 'collapse' } do %>+ <%= Spree.t(:show_details) %>+ <%= icon('selector', class: 'mr-0 ml-1') %>+ <% end %>+ </p>+ <%= render 'spree/admin/orders/risk_analysis', payment: payment %>+ </div>+ <% end %>+</div>\ No newline at end of filediff --git a/admin/app/views/spree/admin/payments/source_views/_storecredit.html.erb b/admin/app/views/spree/admin/payments/source_views/_storecredit.html.erbindex b1202a859d..1dbdae344e 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@@ -1,5 +1,5 @@<fieldset data-hook="store_credit">- <legend><%= Spree.t(:store_credit_name) %></legend>+ <legend><%= Spree.t(:store_credits) %></legend><div class="table-responsive border rounded bg-white"><table class="table table-condensed border rounded"><tr>diff --git a/admin/app/views/spree/admin/promotion_actions/_promotion_action.html.erb b/admin/app/views/spree/admin/promotion_actions/_promotion_action.html.erbindex 29737e62b3..70e02b2c68 100644--- a/admin/app/views/spree/admin/promotion_actions/_promotion_action.html.erb+++ b/admin/app/views/spree/admin/promotion_actions/_promotion_action.html.erb@@ -1,5 +1,5 @@<%= turbo_frame_tag promotion_action do %>- <div class="card mb-3" id="<%= spree_dom_id(promotion_action) %>">+ <div class="card" id="<%= spree_dom_id(promotion_action) %>"><div class="card-header d-flex justify-content-between align-items-center"><h5 class="card-title"><%= promotion_action.human_name %></h5>diff --git a/admin/app/views/spree/admin/promotion_rules/_promotion_rule.html.erb b/admin/app/views/spree/admin/promotion_rules/_promotion_rule.html.erbindex 080ee0f82a..a5126f2cbf 100644--- a/admin/app/views/spree/admin/promotion_rules/_promotion_rule.html.erb+++ b/admin/app/views/spree/admin/promotion_rules/_promotion_rule.html.erb@@ -1,5 +1,5 @@<%= turbo_frame_tag promotion_rule do %>- <div class="card mb-3" id="<%= spree_dom_id(promotion_rule) %>">+ <div class="card" id="<%= spree_dom_id(promotion_rule) %>"><div class="card-header d-flex justify-content-between align-items-center"><h5 class="card-title"><%= promotion_rule.human_name %></h5>@@ -21,25 +21,28 @@<% end %><% if promotion_rule.respond_to?(:products) %>- <div class="small mt-3">+ <div class="mt-3">+ <span><%= Spree.t(:products) %>:</span><% promotion_rule.products.pluck(:name).each do |product_name| %>- <code><%= product_name %></code>+ <strong><%= product_name %></strong><% end %></div><% end %><% if promotion_rule.respond_to?(:taxons) %>- <div class="small mt-3">+ <div class="mt-3">+ <span><%= Spree.t(:taxons) %>:</span><% promotion_rule.taxons.pluck(:pretty_name).each do |taxon_name| %>- <code><%= taxon_name %></code>+ <strong><%= taxon_name %></strong><% end %></div><% end %><% if promotion_rule.respond_to?(:users) %>- <div class="small mt-3">+ <div class="mt-3">+ <span><%= Spree.t(:users) %>:</span><% promotion_rule.users.pluck(:email).each do |user_email| %>- <code><%= user_email %></code>+ <strong><%= user_email %></strong><% end %></div><% end %>diff --git a/admin/app/views/spree/admin/promotions/_actions.html.erb b/admin/app/views/spree/admin/promotions/_actions.html.erbindex 8591de8f38..41de056109 100644--- a/admin/app/views/spree/admin/promotions/_actions.html.erb+++ b/admin/app/views/spree/admin/promotions/_actions.html.erb@@ -1,5 +1,5 @@-<div class="card mb-4">- <div class="card-header d-flex justify-content-between">+<div class="card mb-4 bg-transparent">+ <div class="card-header d-flex justify-content-between border-0"><h5 class="card-title"><%= icon('bolt', class: 'mr-2') %><%= Spree.t(:promotion_actions) %>@@ -8,7 +8,7 @@<%= link_to_with_icon 'plus', Spree.t(:add_one), spree.new_admin_promotion_action_path(@promotion), class: 'btn btn-primary btn-sm', data: { turbo_frame: 'dialog_modal' } %></span></div>- <div class="card-body pb-0">+ <div class="card-body d-flex flex-column gap-2 px-1 pt-0 pb-1"><% if @promotion.promotion_actions.empty? %><div class="text-muted p-5 d-flex align-items-center w-100 justify-content-center"><%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::PromotionAction)) %>diff --git a/admin/app/views/spree/admin/promotions/_rules.html.erb b/admin/app/views/spree/admin/promotions/_rules.html.erbindex ac6f18491f..b87655295b 100644--- a/admin/app/views/spree/admin/promotions/_rules.html.erb+++ b/admin/app/views/spree/admin/promotions/_rules.html.erb@@ -1,9 +1,10 @@-<div class="card mb-4">+<div class="card mb-4 bg-transparent"><div class="card-header d-flex justify-content-between"><h5 class="card-title"><%= icon('checklist', class: 'mr-2') %><%= Spree.t(:rules) %></h5>+<span data-toggle="modal" data-target="#modal"><%= link_to_with_icon 'plus', Spree.t(:add_one), spree.new_admin_promotion_rule_path(@promotion), class: 'btn btn-primary btn-sm', data: { turbo_frame: 'dialog_modal' } %></span>@@ -22,7 +23,7 @@</div></div></div>- <div class="card-body py-0">+ <div class="card-body p-1 d-flex flex-column gap-2"><% if @promotion.promotion_rules.empty? %><div class="text-muted p-5 d-flex align-items-center w-100 justify-content-center"><%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::PromotionRule)) %>diff --git a/admin/app/views/spree/admin/promotions/_sidebar.html.erb b/admin/app/views/spree/admin/promotions/_sidebar.html.erbindex 22f61cc34d..ec4a8eb6be 100644--- a/admin/app/views/spree/admin/promotions/_sidebar.html.erb+++ b/admin/app/views/spree/admin/promotions/_sidebar.html.erb@@ -18,7 +18,7 @@</div><div class="card-footer d-flex justify-content-between"><span class="badge badge-light">- Used: <%= used_coupon_codes_count %> / <%= coupon_codes_count %>+ <%= Spree.t(:used) %>: <%= used_coupon_codes_count %> / <%= coupon_codes_count %></span><span class="badge badge-light">Remaining: <%= coupon_codes_count - used_coupon_codes_count %>@@ -36,8 +36,8 @@</h5><%= link_to_with_icon 'edit', Spree.t(:edit), spree.edit_admin_promotion_path(@promotion), icon: 'pencil', class: 'btn btn-sm btn-light' %></div>- <div class="card-body">- <ul class="list-group">+ <div class="card-body p-0">+ <ul class="list-group list-group-flush"><li class="list-group-item d-flex justify-content-between align-items-center"><span class="text-muted"><%= Spree.t(:name) %>@@ -57,7 +57,7 @@</li><% if @promotion.code.present? %>- <li class="list-group-item d-flex justify-content-between align-items-center" data-controller="clipboard" data-clipboard-success-content="Copied!">+ <li class="list-group-item d-flex justify-content-between align-items-center py-2" data-controller="clipboard" data-clipboard-success-content="Copied!"><span class="text-muted"><%= Spree.t(:coupon_code) %></span><div class="d-flex align-items-center gap-1"><span class="form-control form-control-sm">@@ -83,8 +83,8 @@</h5><%= link_to_with_icon 'edit', Spree.t(:edit), spree.edit_admin_promotion_path(@promotion), icon: 'pencil', class: 'btn btn-sm btn-light' %></div>- <div class="card-body">- <ul class="list-group">+ <div class="card-body p-0">+ <ul class="list-group list-group-flush"><% unless @promotion.multi_codes? %><li class="list-group-item d-flex justify-content-between align-items-center"><span class="text-muted"><%= Spree.t(:usage_limit) %></span>diff --git a/admin/app/views/spree/admin/refunds/_form.html.erb b/admin/app/views/spree/admin/refunds/_form.html.erbindex 14e53c5e00..394388a14e 100644--- a/admin/app/views/spree/admin/refunds/_form.html.erb+++ b/admin/app/views/spree/admin/refunds/_form.html.erb@@ -1,12 +1,15 @@-<div class="form-group">- <%= f.label :amount, Spree.t(:amount) %>- <div class="input-group">- <%= f.text_field :amount, class: 'form-control', required: true %>- <div class="input-group-append">- <span class="input-group-text"><%= currency_symbol(@order.currency) %></span>+<% if f.object.new_record? %>+ <div class="form-group">+ <%= f.label :amount, Spree.t(:amount) %>+ <div class="input-group">+ <%= f.text_field :amount, class: 'form-control', required: true %>+ <div class="input-group-append">+ <span class="input-group-text"><%= currency_symbol(@order.currency) %></span>+ </div></div></div>-</div>+<% end %>+<div class="form-group mb-0"><%= f.label :refund_reason_id, Spree.t(:reason) %><%= f.collection_select(:refund_reason_id, refund_reasons, :id, :name, { include_blank: true }, { data: { controller: 'autocomplete-select' }, required: true }) %>diff --git a/admin/app/views/spree/admin/refunds/edit.html.erb b/admin/app/views/spree/admin/refunds/edit.html.erbindex ab75901e23..06b4095f64 100644--- a/admin/app/views/spree/admin/refunds/edit.html.erb+++ b/admin/app/views/spree/admin/refunds/edit.html.erb@@ -1,5 +1,5 @@<%= turbo_frame_tag :dialog_modal do %>- <%= form_for [:admin, @refund.payment.order, @refund.payment, @refund], data: { turbo: false } do |f| %>+ <%= form_for [:admin, @refund.payment.order, @refund.payment, @refund], data: { turbo_frame: '_top' } do |f| %><div class="modal-content"><div class="modal-header"><h5 class="modal-title" id="exampleModalLabel">diff --git a/admin/app/views/spree/admin/shared/_head.html.erb b/admin/app/views/spree/admin/shared/_head.html.erbindex a9f9a5c998..304a4bf88b 100644--- a/admin/app/views/spree/admin/shared/_head.html.erb+++ b/admin/app/views/spree/admin/shared/_head.html.erb@@ -10,16 +10,11 @@<% else %><% if @object.present? && @object.persisted? %><%= @object.try(:name) || @object.try(:title) %> - <% end %><% if @order.present? && @order.persisted? %><%= @order.number %> - <% end %>- <% if @parent.present? && @parent.persisted? %>- - <%= @parent.try(:name) || @parent.try(:title) || @parent.try(:number) %>- <% end %><%= Spree.t(controller_name, default: controller_name.titleize) %><% end %>- -<% if defined?(current_store) && current_store.present? %>- <%= current_store.name.capitalize %>+ - <%= current_store.name.capitalize %><% end %>- - Spree Commerce</title><link rel="preconnect" href="https://fonts.googleapis.com">diff --git a/admin/app/views/spree/admin/shared/_header.html.erb b/admin/app/views/spree/admin/shared/_header.html.erbindex f42fc55575..f600657648 100644--- a/admin/app/views/spree/admin/shared/_header.html.erb+++ b/admin/app/views/spree/admin/shared/_header.html.erb@@ -17,8 +17,8 @@<% end if spree.respond_to?(:admin_search_admin_path) && defined?(current_store) && current_store %></div>- <%= link_to spree.admin_dashboard_path, class: 'navbar-brand d-flex d-lg-none h-100 align-items-center mx-0' do %>- <%= inline_svg_tag 'logo_white.svg', height: 32 %>+ <%= link_to spree.admin_dashboard_path, class: 'navbar-brand d-flex d-lg-none h-100 align-items-center mx-0 text-white' do %>+ <%= current_store.name %><% end %><div class="text-right d-flex justify-content-end p-0" id="header-user-account" data-turbo-permanent>diff --git a/admin/app/views/spree/admin/shared/_payment.html.erb b/admin/app/views/spree/admin/shared/_payment.html.erbdeleted file mode 100644index 0f0ce392ef..0000000000--- a/admin/app/views/spree/admin/shared/_payment.html.erb+++ /dev/null@@ -1,46 +0,0 @@-<div class="d-flex justify-content-between align-items-center" id="<%= spree_dom_id(payment) %>">- <div class="w-40">- <%= render 'spree/shared/payment', payment: payment %>- </div>- <div class="text-xs text-muted w-20">- <%= local_time(payment.updated_at) %>- </div>-- <div class="text-xs text-muted w-15">- <%= payment_state_badge(payment.state) %>- </div>-- <div class="text-xs text-muted w-10">- <%= payment.display_amount %>- </div>-- <div class="w-10 d-flex justify-content-end">- <div class="dropdown">- <button class="btn btn-light btn-sm" type="button" data-toggle="dropdown" aria-expanded="false">- <%= icon('dots', class: 'mr-0') %>- </button>- <div class="dropdown-menu">- <% if payment.try(:gateway_dashboard_payment_url).present? %>- <%= link_to_with_icon 'eye', Spree.t(:details), payment.gateway_dashboard_payment_url, class: 'dropdown-item', target: '_blank' %>- <% end %>- <% if payment.source.is_a?(Spree::StoreCredit) && payment.source.respond_to?(:gift_card) && payment.source.gift_card.present? %>- <%= link_to_with_icon 'eye', Spree.t(:details), spree.edit_admin_gift_card_path(payment.source.gift_card), class: 'dropdown-item' %>- <% end %>-- <% if payment.checkout? || payment.pending? %>- <%= link_to_with_icon 'check', Spree.t(:capture), spree.capture_admin_order_payment_path(@order, payment), class: 'dropdown-item', data: { turbo_method: :put, turbo_confirm: Spree.t(:are_you_sure) } %>- <% end %>- <% if can?(:refund, @order) && (payment.completed? || payment.pending?) %>- <%= link_to_with_icon 'credit-card-refund', Spree.t(:refund), spree.new_admin_order_payment_refund_path(@order, payment), class: 'dropdown-item' %>- <% end %>- <% if payment.void? || payment.pending? %>- <%= link_to_with_icon 'cancel', Spree.t(:void), spree.void_admin_order_payment_path(@order, payment), class: 'dropdown-item', data: { turbo_method: :put, turbo_confirm: Spree.t(:are_you_sure) } %>- <% end %>- <% if payment.checkout? && payment.can_be_deleted? %>- <div class="dropdown-divider"></div>- <%= link_to_with_icon 'trash', Spree.t('actions.destroy'), spree.admin_order_payment_path(@order, payment), class: 'dropdown-item btn-danger', data: { turbo_method: :delete, turbo_confirm: Spree.t(:are_you_sure) } %>- <% end %>- </div>- </div>- </div>-</div>diff --git a/admin/app/views/spree/admin/shared/_preferences.html.erb b/admin/app/views/spree/admin/shared/_preferences.html.erbindex a30200636a..262cdf74fb 100644--- a/admin/app/views/spree/admin/shared/_preferences.html.erb+++ b/admin/app/views/spree/admin/shared/_preferences.html.erb@@ -2,8 +2,8 @@<p class="mb-0"><% object.preferences.each do |key, value| %><% next if value.blank? %>- <span><%= Spree.t(key) %></span>- <code><%= value %></code>+ <span><%= Spree.t(key) %>:</span>+ <strong><%= value %></strong><% end %></p><% end %>\ No newline at end of filediff --git a/admin/app/views/spree/admin/shared/_refunds.html.erb b/admin/app/views/spree/admin/shared/_refunds.html.erbindex bd2efb5c54..3e20286dad 100644--- a/admin/app/views/spree/admin/shared/_refunds.html.erb+++ b/admin/app/views/spree/admin/shared/_refunds.html.erb@@ -1,7 +1,3 @@-<div class="alert alert-info">- It may take a few days for the money to reach the customer's bank account.-</div>-<div class="table-responsive card-lg p-0"><table class="table table-condensed" id='refunds' data-order-id='<%= @order.number %>'><thead class="text-muted">diff --git a/admin/app/views/spree/admin/store_credits/_list.html.erb b/admin/app/views/spree/admin/store_credits/_list.html.erbindex 3a56067bda..b5523be5d8 100644--- a/admin/app/views/spree/admin/store_credits/_list.html.erb+++ b/admin/app/views/spree/admin/store_credits/_list.html.erb@@ -2,17 +2,23 @@<div class="table-responsive"><table class="table"><thead class="text-muted">- <th><%= Spree.t(:credited) %></th>- <th><%= Spree.t(:used) %></th>+ <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 data-hook="admin_store_credits_index_header_actions" class="actions"></th>- <thead class="text-muted">+ <th></th>+ </thead><tbody><% @store_credits.each do |store_credit| %><tr>+ <td><%= store_credit.currency %></td><td><%= store_credit.display_amount.to_html %></td>+ <td><%= store_credit.display_amount_authorized.to_html %></td><td><%= store_credit.display_amount_used.to_html %></td>+ <td><%= store_credit.display_amount_remaining.to_html %></td><td><%= store_credit.created_by_email %></td><td><%= local_date(store_credit.created_at) %></td><td class="actions">diff --git a/admin/app/views/spree/admin/store_credits/edit.html.erb b/admin/app/views/spree/admin/store_credits/edit.html.erbindex 571173e58d..a4e766016b 100644--- a/admin/app/views/spree/admin/store_credits/edit.html.erb+++ b/admin/app/views/spree/admin/store_credits/edit.html.erb@@ -1,10 +1,10 @@<% content_for :title do %>- <%= Spree.t(:store_credit_name) %>+ <%= Spree.t(:store_credits) %><% end %><% content_for :page_title do %><%= page_header_back_button spree.admin_user_path(@user) %>- <%= Spree.t(:new_store_credit) %>+ <%= @user.email %><% end %><%= render partial: 'spree/admin/shared/error_messages', locals: { target: @store_credit } %>@@ -13,7 +13,7 @@<div class="card mb-4"><div class="card-header"><h5 class="card-title">- <%= Spree.t(:store_credit_name) %>+ <%= Spree.t(:store_credits) %></h5></div>diff --git a/admin/app/views/spree/admin/store_credits/index.html.erb b/admin/app/views/spree/admin/store_credits/index.html.erbindex 7e49f43b41..a5b955a0f7 100644--- a/admin/app/views/spree/admin/store_credits/index.html.erb+++ b/admin/app/views/spree/admin/store_credits/index.html.erb@@ -1,7 +1,7 @@<% unless turbo_frame_request? %><% content_for :page_title do %><%= page_header_back_button spree.admin_user_path(@user) %>- <%= Spree.t(:store_credit_name) %>+ <%= Spree.t(:store_credits) %><% end %><% content_for :page_actions do %>diff --git a/admin/app/views/spree/admin/store_credits/new.html.erb b/admin/app/views/spree/admin/store_credits/new.html.erbindex 99f2848713..a5f7a4d0f7 100644--- a/admin/app/views/spree/admin/store_credits/new.html.erb+++ b/admin/app/views/spree/admin/store_credits/new.html.erb@@ -1,5 +1,5 @@<% content_for :title do %>- <%= Spree.t(:store_credit_name) %>+ <%= Spree.t(:store_credits) %><% end %><% content_for :page_title do %>@@ -13,7 +13,7 @@<div class="card mb-4"><div class="card-header"><h5 class="card-title">- <%= Spree.t(:store_credit_name) %>+ <%= Spree.t(:store_credits) %></h5></div>diff --git a/admin/app/views/spree/admin/storefront/edit.html.erb b/admin/app/views/spree/admin/storefront/edit.html.erbindex f3858bd967..6c6cc43236 100644--- a/admin/app/views/spree/admin/storefront/edit.html.erb+++ b/admin/app/views/spree/admin/storefront/edit.html.erb@@ -92,7 +92,7 @@<%= Spree.t(:images) %></h5></div>- <div class="card-body">+ <div class="card-body pb-0"><div class="form-group"><%= f.label :favicon_image do %>Favicon imagediff --git a/admin/app/views/spree/admin/users/_billing.html.erb b/admin/app/views/spree/admin/users/_billing.html.erbindex f56e4fb694..6dcbdd7f3f 100644--- a/admin/app/views/spree/admin/users/_billing.html.erb+++ b/admin/app/views/spree/admin/users/_billing.html.erb@@ -70,7 +70,7 @@<% else %><%= turbo_frame_tag :new_address_billing do %><div class="text-center p-5 text-muted">- <%= Spree.t(:not_provided) %>+ <%= Spree.t(:not_available) %></div><% end %><% end %>diff --git a/admin/app/views/spree/admin/users/_details.html.erb b/admin/app/views/spree/admin/users/_details.html.erbindex 1203fc5aa0..fe2a812897 100644--- a/admin/app/views/spree/admin/users/_details.html.erb+++ b/admin/app/views/spree/admin/users/_details.html.erb@@ -1,37 +1,37 @@<div class="card mb-4" id="user-details">- <div class="card-header d-flex align-items-center justify-content-between">- <h5 class="card-title">- Details- </h5>- <%= link_to_with_icon 'edit', Spree.t(:edit), spree.edit_admin_user_path(@user), class: 'btn btn-light btn-sm', data: { turbo_frame: :edit_user } %>- </div>- <div class="card-body">- <%= turbo_frame_tag :edit_user do %>- <ul class="list-group">+ <%= turbo_frame_tag :edit_user do %>+ <div class="card-header d-flex align-items-center justify-content-between">+ <h5 class="card-title">+ <%= Spree.t(:details) %>+ </h5>+ <%= link_to_with_icon 'edit', Spree.t(:edit), spree.edit_admin_user_path(@user), class: 'btn btn-light btn-sm', data: { turbo_frame: :edit_user } %>+ </div>+ <div class="card-body p-0">+ <ul class="list-group list-group-flush"><li class="list-group-item d-flex justify-content-between align-items-center">+ <%= Spree.t(:email) %><span><%= @user.email %></span></li><li class="list-group-item d-flex justify-content-between align-items-center">- Phone+ <%= Spree.t(:phone) %><span><%= @user.phone.presence || Spree.t(:not_available) %></span></li><li class="list-group-item d-flex justify-content-between align-items-center">- Name+ <%= Spree.t(:name) %><span><%= customer_full_name(@user) %></span></li><li class="list-group-item d-flex justify-content-between align-items-center">- Email marketing+ <%= Spree.t(:email_marketing) %><%= active_badge(@user.accepts_email_marketing?) %></li><li class="list-group-item d-flex justify-content-between align-items-center">- Tags+ <%= Spree.t(:tags) %><span><% @user.tag_list.each do |tag| %><span class="tag small"><%= tag %></span>@@ -47,6 +47,6 @@</span></li></ul>- <% end %>- </div>+ </div>+ <% end %></div>\ No newline at end of filediff --git a/admin/app/views/spree/admin/users/_form.html.erb b/admin/app/views/spree/admin/users/_form.html.erbindex 32370e160b..f1690aab09 100644--- a/admin/app/views/spree/admin/users/_form.html.erb+++ b/admin/app/views/spree/admin/users/_form.html.erb@@ -4,20 +4,20 @@<%= f.error_message_on :email %></div><div class="form-group">- <%= f.label :phone, Spree.t(:phone) %>- <%= f.text_field :phone, class: 'form-control' %>- <%= f.error_message_on :phone %>-</div>-<div class="form-group">- <%= f.label :first_name, Spree.t(:first_name) %>+ <%= f.label :first_name, raw(Spree.t(:first_name) + required_span_tag) %><%= f.text_field :first_name, class: 'form-control', required: true %><%= f.error_message_on :first_name %></div><div class="form-group">- <%= f.label :last_name, Spree.t(:last_name) %>+ <%= f.label :last_name, raw(Spree.t(:last_name) + required_span_tag) %><%= f.text_field :last_name, class: 'form-control', required: true %><%= f.error_message_on :last_name %></div>+<div class="form-group">+ <%= f.label :phone, Spree.t(:phone) %>+ <%= f.text_field :phone, class: 'form-control' %>+ <%= f.error_message_on :phone %>+</div><div class="form-group"><%= f.label :tag_list, Spree.t(:tags) %><%= tom_select_tag 'user[tag_list]', multiple: true, class: 'w-100', options: user_tags_json_array, active_option: @user.tag_list, value_field: :name, create: true %>diff --git a/admin/app/views/spree/admin/users/_last_order.html.erb b/admin/app/views/spree/admin/users/_last_order.html.erbindex e4df34cf7f..c1956be14c 100644--- a/admin/app/views/spree/admin/users/_last_order.html.erb+++ b/admin/app/views/spree/admin/users/_last_order.html.erb@@ -5,9 +5,9 @@<%= Spree.t('admin.user.last_order_placed') %></h5></div>- <div class="card-body">+ <div class="card-body p-0"><% cache spree_base_cache_scope.call(@last_order) do %>- <ul class="list-group">+ <ul class="list-group list-group-flush"><li class="list-group-item"><div class="row"><div class="col-lg-9">@@ -29,8 +29,5 @@</ul><% end %></div>- <div class="card-footer d-flex justify-content-end pt-0 mb-1">- <%= link_to Spree.t('admin.view_all_orders'), spree.admin_orders_path(q: { user_id_eq: @user.id }), class: 'btn btn-light btn-sm' %>- </div></div><% end %>diff --git a/admin/app/views/spree/admin/users/_lifetime_stats.html.erb b/admin/app/views/spree/admin/users/_lifetime_stats.html.erbindex b0b9d7a63e..64faf2d6c9 100644--- a/admin/app/views/spree/admin/users/_lifetime_stats.html.erb+++ b/admin/app/views/spree/admin/users/_lifetime_stats.html.erb@@ -32,6 +32,15 @@<hr /><div class="row">+ <div class="col-lg-4">+ <div class="d-flex justify-content-center flex-column mb-3 mb-lg-0 border-right">+ <span class="text-muted"><%= Spree.t(:store_credits) %></span>+ <span class="font-size-lg text-dark font-weight-bold mt-1 me-3">+ <%= Spree::Money.new(@user.total_available_store_credit(current_currency, current_store), currency: current_currency) %>+ </span>+ </div>+ </div>+<div class="col-lg-4"><div class="d-flex justify-content-center flex-column mb-3 mb-lg-0 border-right"><span class="text-muted"><%= Spree.t('admin.member_since') %></span>diff --git a/admin/app/views/spree/admin/users/_shipping.html.erb b/admin/app/views/spree/admin/users/_shipping.html.erbindex 3533beb00f..50f3ab13ed 100644--- a/admin/app/views/spree/admin/users/_shipping.html.erb+++ b/admin/app/views/spree/admin/users/_shipping.html.erb@@ -25,7 +25,7 @@<% else %><%= turbo_frame_tag :new_address_shipping do %><div class="text-center p-5 text-muted">- <%= Spree.t(:not_provided) %>+ <%= Spree.t(:not_available) %></div><% end %><% end %>diff --git a/admin/app/views/spree/admin/users/_tabs.html.erb b/admin/app/views/spree/admin/users/_tabs.html.erbindex f16bf83f88..8dce5aadde 100644--- a/admin/app/views/spree/admin/users/_tabs.html.erb+++ b/admin/app/views/spree/admin/users/_tabs.html.erb@@ -19,7 +19,7 @@<% end %><li class="nav-item" role="presentation">- <a class="nav-link" id="pills-store-credits-tab" data-toggle="pill" data-target="#pills-store-credits" role="tab" aria-controls="pills-store-credits" aria-selected="false"><%= Spree.t(:store_credit_name) %></a>+ <a class="nav-link" id="pills-store-credits-tab" data-toggle="pill" data-target="#pills-store-credits" role="tab" aria-controls="pills-store-credits" aria-selected="false"><%= Spree.t(:store_credits) %></a></li></ul>diff --git a/admin/app/views/spree/admin/users/edit.html.erb b/admin/app/views/spree/admin/users/edit.html.erbindex f85a3d3de9..5b58850caf 100644--- a/admin/app/views/spree/admin/users/edit.html.erb+++ b/admin/app/views/spree/admin/users/edit.html.erb@@ -1,8 +1,17 @@<%= turbo_frame_tag :edit_user do %>- <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @user } %>-+ <div class="card-header d-flex align-items-center justify-content-between">+ <h5 class="card-title">+ <%= Spree.t(:details) %>+ </h5>+ <%= link_to Spree.t('actions.discard'), spree.admin_user_path(@user), class: 'btn btn-light btn-sm' %>+ </div><%= form_for [:admin, @user], as: :user, url: spree.admin_user_path(@user), method: :put do |f| %>- <%= render 'form', f: f %>- <%= render 'spree/admin/shared/edit_resource_links', f: f, turbo_frame: '_top' %>+ <div class="card-body pb-0">+ <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @user } %>+ <%= render 'form', f: f %>+ </div>+ <div class="card-footer">+ <%= render 'spree/admin/shared/edit_resource_links', f: f, turbo_frame: '_top' %>+ </div><% end %>-<% end %>\ No newline at end of file+<% end%>\ No newline at end of filediff --git a/admin/app/views/spree/admin/variants/_variant.html.erb b/admin/app/views/spree/admin/variants/_variant.html.erbindex 441d1d3e8d..1d0876ca55 100644--- a/admin/app/views/spree/admin/variants/_variant.html.erb+++ b/admin/app/views/spree/admin/variants/_variant.html.erb@@ -1,5 +1,5 @@<% cache variant do %>- <%= link_to spree.edit_admin_product_variant_path(variant.product, variant), data: { turbo_frame: :_top }, class: 'd-flex align-items-center justify-content-start text-decoration-none' do %>+ <%= link_to spree.edit_admin_product_variant_path(variant.product, variant), id: spree_dom_id(variant), data: { turbo_permanent: true, turbo_frame: :_top }, class: 'd-flex align-items-center justify-content-start text-decoration-none' do %><%= render 'spree/admin/shared/product_image', object: variant %><div class="ml-3"><strong><%= variant.name %></strong>diff --git a/admin/config/locales/en.yml b/admin/config/locales/en.ymlindex cf51051772..801f123f33 100644--- a/admin/config/locales/en.yml+++ b/admin/config/locales/en.yml@@ -3,7 +3,6 @@ en:spree:admin:active: Active- add_tracking_details: Add tracking detailsamount_spent: Amount spentaudit_log: Audit Logavg_order_value: Avg. Order Value@@ -45,6 +44,7 @@ en:description: Allow customers to checkout without creating an account.label: Allow guest checkoutpolicy_copy: Checkout footer links are added automatically based on the %{policies_link} content.+ copied: Copied!copy_payment_link: Copy Payment Linkcopy_to_clipboard: Copy to clipboardcoupon_codes:@@ -249,7 +249,6 @@ en:compare_at_price_description: This price is used to show marked down price on the product page.stock_locations_link: To add more stock locations please go to <a href="%{link}">Stock Locations</a>total_inventory_html: 'Total inventory at %{stock_location} location: %{count} available'- view_all_orders: View all orderswebhooks_subscribers:addresses: Addressesall_events: All Eventsdiff --git a/core/app/models/spree/order.rb b/core/app/models/spree/order.rbindex 402e72dd18..b833a2d042 100644--- a/core/app/models/spree/order.rb+++ b/core/app/models/spree/order.rb@@ -42,7 +42,8 @@ module Spreemoney_methods :outstanding_balance, :item_total, :adjustment_total,:included_tax_total, :additional_tax_total, :tax_total,:shipment_total, :promo_total, :total,- :cart_promo_total, :pre_tax_item_amount, :pre_tax_total+ :cart_promo_total, :pre_tax_item_amount, :pre_tax_total,+ :payment_totalalias display_ship_total display_shipment_totalalias_attribute :ship_total, :shipment_totaldiff --git a/core/app/models/spree/payment.rb b/core/app/models/spree/payment.rbindex 4a86f0027c..be5f8be6c5 100644--- a/core/app/models/spree/payment.rb+++ b/core/app/models/spree/payment.rb@@ -173,6 +173,11 @@ module Spreecredit_allowed > 0end+ # we shouldn't allow deleting payments via admin interface+ def can_be_deleted?+ false+ end+# see https://github.com/spree/spree/issues/981def build_sourcereturn unless new_record?diff --git a/core/app/models/spree/refund.rb b/core/app/models/spree/refund.rbindex 8c320f49ae..c1d61e1ca1 100644--- a/core/app/models/spree/refund.rb+++ b/core/app/models/spree/refund.rb@@ -58,6 +58,13 @@ module Spreereimbursement.customer_return&.return_items || reimbursement.return_itemsend+ # Returns true if the refund is editable.+ #+ # @return [Boolean]+ def editable?+ !payment.order.canceled?+ end+private# attempts to perform the refund.diff --git a/core/app/models/spree/store_credit.rb b/core/app/models/spree/store_credit.rbindex b8e5d89351..59f1b2f918 100644--- a/core/app/models/spree/store_credit.rb+++ b/core/app/models/spree/store_credit.rb@@ -49,7 +49,7 @@ module Spreeattr_accessor :action, :action_amount, :action_originator, :action_authorization_codeextend Spree::DisplayMoney- money_methods :amount, :amount_used, :amount_remaining+ money_methods :amount, :amount_used, :amount_remaining, :amount_authorizedself.whitelisted_ransackable_attributes = %w[user_id created_by_id amount currency type_id]self.whitelisted_ransackable_associations = %w[type user created_by]diff --git a/core/app/views/spree/shared/_payment.html.erb b/core/app/views/spree/shared/_payment.html.erbindex e963c8efd4..8f9621a1a2 100644--- a/core/app/views/spree/shared/_payment.html.erb+++ b/core/app/views/spree/shared/_payment.html.erb@@ -1,5 +1,5 @@<% source = payment.source %>-<div class="d-flex flex items-center align-items-center gap-2">+<div class="d-flex flex items-top align-items-top gap-3"><% if source.is_a?(Spree::CreditCard) %><div class="flex-shrink-0"><% # display wallet icon, eg. Apple Pay, Google Pay, etc. %>@@ -8,8 +8,8 @@<%= payment_method_icon_tag source.cc_type, height: 30 %></div><div>- <p class="mb-1"><%= Spree.t(:ending_with) %> <%=source.last_digits %></p>- <p class="mb-0"><%= Spree.t(:expires) %> <%= source.month %> / <%= source.year %></p>+ <p class="mb-1"> •••• <%=source.last_digits %></p>+ <p class="mb-0"><%= Spree.t(:expiration) %> <%= source.month %>/<%= source.year %></p></div><% elsif source.is_a?(Spree::StoreCredit) %><% if source.respond_to?(:gift_card) && source.gift_card.present? %>diff --git a/core/config/locales/en.yml b/core/config/locales/en.ymlindex 105b887fb1..a9ccf3c9fd 100644--- a/core/config/locales/en.yml+++ b/core/config/locales/en.yml@@ -752,7 +752,6 @@ en:compare_at_amount: Compare at amountcompare_at_price: Compare at pricecomplete: complete- completed_at: Completed atconditions: Conditionsconfiguration: Configurationconfigurations: Configurations@@ -772,8 +771,6 @@ en:copy: Copycopy_id: Copy IDcopy_link: Copy link- copy_payment_link: Copy payment link- copy_to_clipboard: Copy to clipboardcost_currency: Cost Currencycost_price: Cost Pricecould_not_create_customer_return: Could not create customer return@@ -1034,9 +1031,6 @@ en:free_shipping_amount: "-"from: Fromfront_end: Front End- fulfilled_at: Fulfilled at- fulfilled_by: Fulfilled by- fulfilled_from: Fulfilled fromgateway: Gatewaygateway_error: Gateway Errorgeneral: General@@ -1303,7 +1297,6 @@ en:not_available: N/Anot_enough_stock: There is not enough inventory at the source location to complete this transfer.not_found: "%{resource} is not found"- not_provided: Not providednot_risky: Not riskynot_subscribed: Not subscribednote: Note@@ -1403,6 +1396,7 @@ en:origin: Originother: Otherout_of_stock: Out of Stock+ outstanding_balance: Outstanding Balanceoverview: Overviewpackage_from: package frompage: Page@@ -1494,6 +1488,7 @@ en:processing: Processingrefunded: Refundedvoid: Void+ payment_total: Payment Totalpayment_type: Payment typepayment_updated: Payment Updatedpayments: Payments@@ -1786,7 +1781,7 @@ en:send_mails_as: Send Mails Assend_message: Send messagesend_payment_link: Send payment link- send_payment_link_title: Send payment link title+ send_payment_link_title: Send payment link to the customer by email. They will be able to complete the payment later.send_us_a_message: Send us a messageseo: SEOseo_robots: SEO Robots@@ -1818,9 +1813,9 @@ en:backorder: Backordercanceled: Canceledpartial: Partial- pending: Unfulfilled- ready: Unfulfilled- shipped: Fulfilled+ pending: Pending+ ready: Ready+ shipped: Shippedshipment_successfully_shipped: Shipment successfully shippedshipment_transfer_error: There was an error transferring variantsshipment_transfer_success: Variants successfully transferred@@ -1961,6 +1956,7 @@ en:unable_to_delete: Unable to delete store creditunable_to_fund: Unable to pay for order using store creditsunable_to_update: Unable to update store credit+ remaining: Remainingremaining_amount: You have <strong>%{amount}</strong> remaining in your account's Store Credit.remove: Removestore_credit_categories: Store Credit Categoriesdiff --git a/storefront/app/controllers/spree/account/store_credits_controller.rb b/storefront/app/controllers/spree/account/store_credits_controller.rbindex ba632552e8..0625ff0f49 100644--- a/storefront/app/controllers/spree/account/store_credits_controller.rb+++ b/storefront/app/controllers/spree/account/store_credits_controller.rb@@ -12,7 +12,7 @@ module Spreeprivatedef accurate_title- Spree.t(:store_credit_name)+ Spree.t(:store_credits)enddef user_store_creditsdiff --git a/storefront/app/views/themes/default/spree/shared/_order_details.html.erb b/storefront/app/views/themes/default/spree/shared/_order_details.html.erbindex f9b63ebe94..a2af9d8ae0 100644--- a/storefront/app/views/themes/default/spree/shared/_order_details.html.erb+++ b/storefront/app/views/themes/default/spree/shared/_order_details.html.erb@@ -15,7 +15,7 @@<% end %><p class="mb-6">- <%= Spree.t(:completed_at) %> <%= local_time(order.completed_at) %>+ <%= I18n.t('activerecord.attributes.spree/order.completed_at') %> <%= local_time(order.completed_at) %></p><%== color_options_style_for_line_items(shipments.flat_map(&:line_items)) %>