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.

Fix button layout on customer returns section.

Matthew Kennedy03b85e146916
diff --git a/backend/app/assets/stylesheets/spree/backend/shared/_base.scss b/backend/app/assets/stylesheets/spree/backend/shared/_base.scss
index 3ccaf2a14c..86e9692450 100644
--- a/backend/app/assets/stylesheets/spree/backend/shared/_base.scss
+++ b/backend/app/assets/stylesheets/spree/backend/shared/_base.scss
@@ -55,3 +55,7 @@
.resize-animation-stopper * {
transition: none !important;
}
+
+.button_to {
+ display: inline-block;
+}
diff --git a/backend/app/views/spree/admin/customer_returns/_return_item_decision.html.erb b/backend/app/views/spree/admin/customer_returns/_return_item_decision.html.erb
index bd809fba7c..7feebbb65f 100644
--- a/backend/app/views/spree/admin/customer_returns/_return_item_decision.html.erb
+++ b/backend/app/views/spree/admin/customer_returns/_return_item_decision.html.erb
@@ -1,54 +1,54 @@
<div class="table-responsive">
-<table class="show return-items-table table table-condensed table-bordered index">
- <thead>
- <tr>
- <th><%= Spree.t(:product) %></th>
- <th><%= Spree.t(:sku) %></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>
- <% if show_decision %>
- <th></th>
- <% end %>
- </tr>
- </thead>
- <tbody>
- <% return_items.each do |return_item| %>
+ <table class="show return-items-table table table-condensed table-bordered index">
+ <thead>
<tr>
- <td>
- <div class="variant-name">
- <%= link_to return_item.inventory_unit.variant.name, spree.edit_admin_product_path(return_item.inventory_unit.variant.product) %>
- </div>
- <div class="variant-options"><%= return_item.inventory_unit.variant.options_text %></div>
- </td>
- <td>
- <%= return_item.inventory_unit.variant.sku %>
- </td>
- <td>
- <%= return_item.display_pre_tax_amount %>
- </td>
- <td>
- <%= reimbursement_type_name(return_item.preferred_reimbursement_type) %>
- </td>
- <td>
- <%= return_item.exchange_variant.try(:exchange_name) %>
- </td>
- <td>
- <%= return_item.acceptance_status_errors %>
- </td>
+ <th><%= Spree.t(:product) %></th>
+ <th><%= Spree.t(:sku) %></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>
<% if show_decision %>
- <td class='actions actions-2'>
- <%= button_to [:admin, return_item], { class: 'with-tip display-inline btn btn-success btn-sm', params: { "return_item[acceptance_status]" => 'accepted' }, "data-action" => 'save', title: Spree.t(:accept), method: 'put' } do %>
- <%= Spree.t(:accept) %>
- <% end if can?(:accept, return_item) %>
- <%= button_to [:admin, return_item], { class: 'with-tip display-inline btn btn-danger btn-sm', params: { "return_item[acceptance_status]" => 'rejected' }, "data-action" => 'remove', title: Spree.t(:reject), method: 'put' } do %>
- <%= Spree.t(:reject) %>
- <% end if can?(:reject, return_item) %>
- </td>
+ <th></th>
<% end %>
</tr>
- <% end %>
- </tbody>
-</table>
+ </thead>
+ <tbody>
+ <% return_items.each do |return_item| %>
+ <tr>
+ <td>
+ <div class="variant-name">
+ <%= link_to return_item.inventory_unit.variant.name, spree.edit_admin_product_path(return_item.inventory_unit.variant.product) %>
+ </div>
+ <div class="variant-options"><%= return_item.inventory_unit.variant.options_text %></div>
+ </td>
+ <td>
+ <%= return_item.inventory_unit.variant.sku %>
+ </td>
+ <td>
+ <%= return_item.display_pre_tax_amount %>
+ </td>
+ <td>
+ <%= reimbursement_type_name(return_item.preferred_reimbursement_type) %>
+ </td>
+ <td>
+ <%= return_item.exchange_variant.try(:exchange_name) %>
+ </td>
+ <td>
+ <%= return_item.acceptance_status_errors if return_item.acceptance_status_errors.present? %>
+ </td>
+ <% if show_decision %>
+ <td class='actions actions-2'>
+ <%= button_to [:admin, return_item], { class: 'with-tip display-inline btn btn-success btn-sm', params: { "return_item[acceptance_status]" => 'accepted' }, "data-action" => 'save', title: Spree.t(:accept), method: 'put' } do %>
+ <%= Spree.t(:accept) %>
+ <% end if can?(:accept, return_item) %>
+ <%= button_to [:admin, return_item], { class: 'with-tip display-inline btn btn-danger btn-sm', params: { "return_item[acceptance_status]" => 'rejected' }, "data-action" => 'remove', title: Spree.t(:reject), method: 'put' } do %>
+ <%= Spree.t(:reject) %>
+ <% end if can?(:reject, return_item) %>
+ </td>
+ <% end %>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
</div>
diff --git a/backend/app/views/spree/admin/customer_returns/edit.html.erb b/backend/app/views/spree/admin/customer_returns/edit.html.erb
index f155f0de61..c54bc4f54b 100644
--- a/backend/app/views/spree/admin/customer_returns/edit.html.erb
+++ b/backend/app/views/spree/admin/customer_returns/edit.html.erb
@@ -44,7 +44,7 @@
</fieldset>
<% if !@customer_return.fully_reimbursed? && @pending_reimbursements.empty? && can?(:create, Spree::Reimbursement) %>
- <fieldset data-hook="reimbursements" class="marginb">
+ <fieldset data-hook="reimbursements" class="mb-3">
<% if @customer_return.completely_decided? %>
<%= form_for [:admin, @order, Spree::Reimbursement.new] do |f| %>
<%= hidden_field_tag :build_from_customer_return_id, @customer_return.id %>
diff --git a/backend/app/views/spree/admin/reimbursements/edit.html.erb b/backend/app/views/spree/admin/reimbursements/edit.html.erb
index 2c2779958b..7939b730b1 100644
--- a/backend/app/views/spree/admin/reimbursements/edit.html.erb
+++ b/backend/app/views/spree/admin/reimbursements/edit.html.erb
@@ -93,7 +93,6 @@
<%= "#{Spree.t('note')}: #{Spree.t('this_order_has_already_received_a_refund')}. #{Spree.t('make_sure_the_above_reimbursement_amount_is_correct')}." %>
</div>
<% end %>
-
<div class="form-actions" data-hook="reimburse-buttons">
<%= button_to [:perform, :admin, @order, @reimbursement], { class: 'btn btn-primary', method: 'post' } do %>