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.

Change <% javascript do %> for basic <script> tags

Matthew Kennedyb378bfb0a714
diff --git a/backend/app/views/spree/admin/adjustments/index.html.erb b/backend/app/views/spree/admin/adjustments/index.html.erb
index 0d3fcd6ed7..29f09a8b80 100644
--- a/backend/app/views/spree/admin/adjustments/index.html.erb
+++ b/backend/app/views/spree/admin/adjustments/index.html.erb
@@ -29,8 +29,8 @@
</div>
<% end %>
-<%= javascript_tag do %>
+<script>
var order_number = '<%= @order.number %>';
-<% end %>
+</script>
<%= render partial: 'spree/admin/shared/order_summary' %>
diff --git a/backend/app/views/spree/admin/orders/_form.html.erb b/backend/app/views/spree/admin/orders/_form.html.erb
index a599792238..6b3560fc8b 100644
--- a/backend/app/views/spree/admin/orders/_form.html.erb
+++ b/backend/app/views/spree/admin/orders/_form.html.erb
@@ -31,7 +31,7 @@
</div>
<% end %>
- <%= javascript_tag do %>
+ <script>
var order_number = '<%= @order.number %>';
var shipments = [];
@@ -48,5 +48,5 @@
<% end %>
<%= render partial: 'spree/admin/shared/update_order_state', formats: [:js], handlers: [:erb] %>
- <% end %>
+ </script>
</div>
diff --git a/backend/app/views/spree/admin/orders/_line_items_edit_form.html.erb b/backend/app/views/spree/admin/orders/_line_items_edit_form.html.erb
index 71b5a4b3a5..410530530e 100644
--- a/backend/app/views/spree/admin/orders/_line_items_edit_form.html.erb
+++ b/backend/app/views/spree/admin/orders/_line_items_edit_form.html.erb
@@ -23,7 +23,7 @@
</div>
<% end %>
- <%= javascript_tag do %>
+ <script>
var order_number = '<%= @order.number %>';
var shipments = [];
@@ -32,5 +32,5 @@
<% end %>
<%= render partial: 'spree/admin/shared/update_order_state', formats: [:js], handlers: [:erb] %>
- <% end %>
+ </script>
</div>
diff --git a/backend/app/views/spree/admin/prices/index.html.erb b/backend/app/views/spree/admin/prices/index.html.erb
index 1091cc6933..3e9c0491d2 100644
--- a/backend/app/views/spree/admin/prices/index.html.erb
+++ b/backend/app/views/spree/admin/prices/index.html.erb
@@ -10,7 +10,7 @@
</form>
<%= form_tag nil, { class: 'form-horizontal' } do %>
- <div class="mt-3">
+ <div class="my-3">
<%= render 'variant_prices', variant: @product.master %>
</div>
<div class="form-actions" data-hook="buttons">
diff --git a/backend/app/views/spree/admin/product_properties/index.html.erb b/backend/app/views/spree/admin/product_properties/index.html.erb
index 5b0d95046f..c043ebcdc6 100644
--- a/backend/app/views/spree/admin/product_properties/index.html.erb
+++ b/backend/app/views/spree/admin/product_properties/index.html.erb
@@ -19,7 +19,7 @@
<%= form_for @product, url: spree.admin_product_url(@product), method: :put do |f| %>
<fieldset>
<div id="prototypes" data-hook></div>
- <div class=" table-responsive">
+ <div class=" table-responsive mb-3">
<table id="product_properties" class="table sortable" data-hook data-sortable-link="<%= update_positions_admin_product_product_properties_url %>">
<thead>
<tr data-hook="product_properties_header">
@@ -41,7 +41,7 @@
</fieldset>
<% end %>
-<%= javascript_tag do %>
+<script>
var properties = <%= raw(@properties.to_json) %>;
$('#product_properties').on('keydown', 'input.autocomplete', function() {
already_auto_completed = $(this).is('ac_input');
@@ -50,7 +50,7 @@
$(this).focus();
}
});
-<% end %>
+</script>
<style>
div.ui-helper-hidden-accessible {display:none;}
diff --git a/backend/app/views/spree/admin/promotions/index.html.erb b/backend/app/views/spree/admin/promotions/index.html.erb
index acfcc978dc..ec64e72b1d 100644
--- a/backend/app/views/spree/admin/promotions/index.html.erb
+++ b/backend/app/views/spree/admin/promotions/index.html.erb
@@ -67,10 +67,12 @@
<td><%= promotion.usage_limit.nil? ? "∞" : promotion.usage_limit %></td>
<td><%= Spree.t(:current_promotion_usage, count: promotion.credits_count) %></td>
<td><%= promotion.expires_at.to_date.to_s(:short_date) if promotion.expires_at %></td>
- <td class="actions actions-2" data-hook="admin_promotions_index_row_actions">
- <%= link_to_edit promotion, no_text: true if can?(:edit, promotion) %>
- <%= link_to_clone_promotion promotion, no_text: true if can?(:clone, promotion) %>
- <%= link_to_delete promotion, no_text: true if can?(:delete, promotion) %>
+ <td class="actions" data-hook="admin_promotions_index_row_actions">
+ <span class="d-flex justify-content-end">
+ <%= link_to_edit promotion, no_text: true if can?(:edit, promotion) %>
+ <%= link_to_clone_promotion promotion, no_text: true if can?(:clone, promotion) %>
+ <%= link_to_delete promotion, no_text: true if can?(:delete, promotion) %>
+ </span>
</td>
</tr>
<% end %>
diff --git a/backend/app/views/spree/admin/shared/_address_form.html.erb b/backend/app/views/spree/admin/shared/_address_form.html.erb
index 983aa46358..2a2bfae47c 100644
--- a/backend/app/views/spree/admin/shared/_address_form.html.erb
+++ b/backend/app/views/spree/admin/shared/_address_form.html.erb
@@ -36,9 +36,9 @@
</div>
<% content_for :head do %>
- <%= javascript_tag do %>
+ <script>
$(document).ready(function(){
$('#<%= s_or_b %>country select').on('change', function() { update_state('<%= s_or_b %>'); });
});
- <% end %>
+ </script>
<% end %>
diff --git a/backend/app/views/spree/admin/shared/_head.html.erb b/backend/app/views/spree/admin/shared/_head.html.erb
index b5046520f0..61beba6945 100644
--- a/backend/app/views/spree/admin/shared/_head.html.erb
+++ b/backend/app/views/spree/admin/shared/_head.html.erb
@@ -19,13 +19,13 @@
<%= javascript_include_tag 'spree/backend/all' %>
<%= render "spree/admin/shared/translations" %>
-<%= javascript_tag do %>
+<script>
<%== "var AUTH_TOKEN = #{form_authenticity_token.inspect};" %>
<%== "Spree.api_key = '#{try_spree_current_user.spree_api_key}';" if try_spree_current_user %>
<%== "var ADDRESS_FIELDS = #{Spree::Address::ADDRESS_FIELDS}" %>
<% if Rails.env.test? %>
jQuery.fx.off = false
<% end %>
-<% end %>
+</script>
<%= yield :head %>