From faaaeb5a0fe3deaabbd853efab53cc5cf0261314 Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Sat, 28 Jan 2023 16:47:32 +0100 Subject: [PATCH 01/11] Fix missing or bad closing tags --- .../app/views/spree/admin/stock_movements/index.html.erb | 6 ++---- .../spree/admin/style_guide/topics/forms/_inputs.html.erb | 2 +- .../admin/style_guide/topics/messaging/_flashes.html.erb | 2 +- .../admin/style_guide/topics/typography/_lists.html.erb | 2 +- backend/app/views/spree/admin/tax_categories/index.html.erb | 1 + backend/app/views/spree/admin/users/items.html.erb | 1 + 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/app/views/spree/admin/stock_movements/index.html.erb b/backend/app/views/spree/admin/stock_movements/index.html.erb index f88822a715a..63641852a61 100644 --- a/backend/app/views/spree/admin/stock_movements/index.html.erb +++ b/backend/app/views/spree/admin/stock_movements/index.html.erb @@ -50,7 +50,7 @@ - <%= Spree::StockMovement.human_attribute_name(:variant) %> + <%= Spree::StockMovement.human_attribute_name(:variant) %> <%= Spree::StockMovement.human_attribute_name(:quantity) %> <%= Spree::StockMovement.human_attribute_name(:originated_by) %> @@ -58,9 +58,7 @@ <% @stock_movements.each do |stock_movement|%> - - <%= display_variant(stock_movement) %> - + <%= display_variant(stock_movement) %> <%= stock_movement.quantity %> <%= pretty_originator(stock_movement) %> diff --git a/backend/app/views/spree/admin/style_guide/topics/forms/_inputs.html.erb b/backend/app/views/spree/admin/style_guide/topics/forms/_inputs.html.erb index ab51c0b991d..dd81e8a8fcb 100644 --- a/backend/app/views/spree/admin/style_guide/topics/forms/_inputs.html.erb +++ b/backend/app/views/spree/admin/style_guide/topics/forms/_inputs.html.erb @@ -28,7 +28,7 @@ 2/3 column
(main content area) 1/3 column
(secondary content area) 1/2 column
(main content, small screen) - 1 column
(main & secondary content, small screen) + 1 column
(main & secondary content, small screen) text field - 'normal' diff --git a/backend/app/views/spree/admin/style_guide/topics/messaging/_flashes.html.erb b/backend/app/views/spree/admin/style_guide/topics/messaging/_flashes.html.erb index 5dd45c22f87..2413dc2cae2 100644 --- a/backend/app/views/spree/admin/style_guide/topics/messaging/_flashes.html.erb +++ b/backend/app/views/spree/admin/style_guide/topics/messaging/_flashes.html.erb @@ -7,7 +7,7 @@ type = $(this).data('flashType'); if (!$('.flash.' + type).is('*')) { - flash = $("
") + flash = $("
") .text(type) .addClass(type) .appendTo('.js-flash-wrapper') diff --git a/backend/app/views/spree/admin/style_guide/topics/typography/_lists.html.erb b/backend/app/views/spree/admin/style_guide/topics/typography/_lists.html.erb index c3635d7e71f..f3e3b9978b0 100644 --- a/backend/app/views/spree/admin/style_guide/topics/typography/_lists.html.erb +++ b/backend/app/views/spree/admin/style_guide/topics/typography/_lists.html.erb @@ -22,4 +22,4 @@
List
Term
Description
- + diff --git a/backend/app/views/spree/admin/tax_categories/index.html.erb b/backend/app/views/spree/admin/tax_categories/index.html.erb index c52f54e7a86..9017e043366 100644 --- a/backend/app/views/spree/admin/tax_categories/index.html.erb +++ b/backend/app/views/spree/admin/tax_categories/index.html.erb @@ -50,6 +50,7 @@ <% if can?(:destroy, tax_category) %> <%= link_to_delete tax_category, no_text: true %> <% end %> + <% end %> diff --git a/backend/app/views/spree/admin/users/items.html.erb b/backend/app/views/spree/admin/users/items.html.erb index 4eab112855b..cf2373071c9 100644 --- a/backend/app/views/spree/admin/users/items.html.erb +++ b/backend/app/views/spree/admin/users/items.html.erb @@ -69,6 +69,7 @@ <% end %> <% end %> + <% else %>
From f5377a37f6e80678834eac6382732434a0d9b5de Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Sat, 28 Jan 2023 17:10:01 +0100 Subject: [PATCH 02/11] Simplify some ERB workarounds --- .../spree/admin/images/_image_row.html.erb | 3 +-- .../topics/components/_modals.html.erb | 26 +++++++++---------- .../views/spree/admin/users/_tabs.html.erb | 10 +++---- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/backend/app/views/spree/admin/images/_image_row.html.erb b/backend/app/views/spree/admin/images/_image_row.html.erb index d421c41f638..2b92012fc14 100644 --- a/backend/app/views/spree/admin/images/_image_row.html.erb +++ b/backend/app/views/spree/admin/images/_image_row.html.erb @@ -1,5 +1,4 @@ - <% if can?(:update_positions, Spree::Image) %> @@ -28,7 +27,7 @@ <%= f.select :viewable_id, options_for_select(@variants, image.viewable_id), {}, class: 'select2 fullwidth', autocomplete: "off" %> <% end %> - <% end # @product.has_variants? %> + <% end %> <%= fields_for image do |f| %> diff --git a/backend/app/views/spree/admin/style_guide/topics/components/_modals.html.erb b/backend/app/views/spree/admin/style_guide/topics/components/_modals.html.erb index 49bc6d8966a..0768179c376 100644 --- a/backend/app/views/spree/admin/style_guide/topics/components/_modals.html.erb +++ b/backend/app/views/spree/admin/style_guide/topics/components/_modals.html.erb @@ -19,21 +19,19 @@ -<%- snippet = capture do %> - - - <%= render( - "spree/admin/shared/modal", - target: "your-target", - title: "Your Title", - content: "The modal's content, could be another partial" - ) %> -<%- end %> -
-
<%= escape_once snippet %>
+
<%= %{
+    
+
+    \<\%= render(
+      "spree/admin/shared/modal",
+      target: "your-target",
+      title: "Your Title",
+      content: "The modal's content, could be another partial"
+    ) \%\>
+  }.strip_heredoc %>
diff --git a/backend/app/views/spree/admin/users/_tabs.html.erb b/backend/app/views/spree/admin/users/_tabs.html.erb index b9d5a4050ae..f48bffdd305 100644 --- a/backend/app/views/spree/admin/users/_tabs.html.erb +++ b/backend/app/views/spree/admin/users/_tabs.html.erb @@ -1,26 +1,26 @@ <% content_for :tabs do %>