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.

Small admin fixes

Damian Legawiec2353aa62a1b8
diff --git a/admin/app/views/spree/admin/admin_users/show.html.erb b/admin/app/views/spree/admin/admin_users/show.html.erb
index 608b8be555..cb4b72f548 100644
--- a/admin/app/views/spree/admin/admin_users/show.html.erb
+++ b/admin/app/views/spree/admin/admin_users/show.html.erb
@@ -37,6 +37,7 @@
<%= Spree.t(:email) %>
<span>
<%= @admin_user.email %>
+ <%= clipboard_component(@admin_user.email) %>
</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
@@ -101,7 +102,7 @@
<li class="list-group-item d-flex justify-content-between align-items-center">
<%= Spree.t(:invited_by) %>
<span>
- <%= @admin_user.invited_by.name %>
+ <%= link_to @admin_user.invited_by.email, spree.admin_admin_user_path(@admin_user.invited_by), class: 'text-decoration-none', data: { turbo_frame: '_top' } %>
</span>
</li>
<% end %>
diff --git a/admin/app/views/spree/admin/payment_methods/edit.html.erb b/admin/app/views/spree/admin/payment_methods/edit.html.erb
index 24df2dcee8..f63ee0963b 100644
--- a/admin/app/views/spree/admin/payment_methods/edit.html.erb
+++ b/admin/app/views/spree/admin/payment_methods/edit.html.erb
@@ -3,7 +3,7 @@
<%= @payment_method.name %>
<% end %>
-<%= form_for @payment_method, as: :payment_method, url: spree.admin_payment_method_path(@payment_method) do |f| %>
+<%= form_for @payment_method, as: :payment_method, url: spree.admin_payment_method_path(@payment_method), html: { id: "edit_payment_method_#{@payment_method.id}" } do |f| %>
<div class="row">
<div class="col-lg-6 offset-lg-3">
<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @payment_method } %>
diff --git a/admin/app/views/spree/admin/shared/_content_header.html.erb b/admin/app/views/spree/admin/shared/_content_header.html.erb
index 0fa1cbe4ef..fea74e9d53 100644
--- a/admin/app/views/spree/admin/shared/_content_header.html.erb
+++ b/admin/app/views/spree/admin/shared/_content_header.html.erb
@@ -1,4 +1,4 @@
-<% record = @object || @customer_return || @order || @product || @vendor || @user || @taxon || @store_credit %>
+<% record = @object || @customer_return || @order || @product || @vendor || @user || @admin_user || @taxon || @store_credit %>
<% record = nil if @user&.is_a?(Spree.admin_user_class) %>
<% show_record_subtitle = record && record.persisted? && record.has_attribute?(:updated_at) %>
@@ -24,7 +24,8 @@
<%= yield :page_actions if content_for?(:page_actions) %>
<% if action_name == 'edit' && @object %>
- <%= turbo_save_button_tag Spree.t('actions.update'), class: 'btn btn-primary', form: "edit_#{@object.class.name.demodulize.underscore}_#{@object.id}" %>
+ <% class_name = defined?(model_class) ? model_class.to_s : @object.class.name %>
+ <%= turbo_save_button_tag Spree.t('actions.update'), class: 'btn btn-primary', form: "edit_#{class_name.demodulize.underscore}_#{@object.id}" %>
<% end %>
<% if show_record_subtitle || content_for(:page_actions_dropdown) %>