From ccefc6e6976afa47422e2b65f0134862a9f72502 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Mon, 2 Dec 2024 23:28:11 +0000 Subject: [PATCH] Update to new interpolation syntax Includes a fix to a brittle test that failed due to changes in the number of linebreaks. --- .../components/core_components.ex | 60 +++++++++---------- .../components/layouts/app.html.heex | 12 ++-- .../components/layouts/root.html.heex | 6 +- .../layouts/unauthenticated.html.heex | 2 +- .../components/pagination.ex | 12 ++-- .../controllers/session_html/new.html.heex | 6 +- .../live/artist_live/show.html.heex | 28 ++++----- .../live/collection_live/index.html.heex | 38 ++++++------ .../live/collection_live/show.html.heex | 50 ++++++++-------- .../live/record_live/form_component.ex | 10 ++-- .../live/record_live/import_component.ex | 16 ++--- .../live/stats_live/data_components.ex | 10 ++-- .../live/stats_live/index.html.heex | 36 +++++------ .../live/wishlist_live/index.html.heex | 40 ++++++------- .../live/wishlist_live/show.html.heex | 46 +++++++------- .../live/stats_live/index_test.exs | 10 ++-- 16 files changed, 191 insertions(+), 191 deletions(-) diff --git a/lib/music_library_web/components/core_components.ex b/lib/music_library_web/components/core_components.ex index b13f79d5..34971f90 100644 --- a/lib/music_library_web/components/core_components.ex +++ b/lib/music_library_web/components/core_components.ex @@ -84,7 +84,7 @@ defmodule MusicLibraryWeb.CoreComponents do
- <%= render_slot(@inner_block) %> + {render_slot(@inner_block)}
@@ -129,9 +129,9 @@ defmodule MusicLibraryWeb.CoreComponents do

<.icon :if={@kind == :info} name="hero-information-circle-mini" class="h-4 w-4" /> <.icon :if={@kind == :error} name="hero-exclamation-circle-mini" class="h-4 w-4" /> - <%= @title %> + {@title}

-

<%= msg %>

+

{msg}

@@ -162,7 +162,7 @@ defmodule MusicLibraryWeb.CoreComponents do phx-connected={hide("#client-error")} hidden > - <%= gettext("Attempting to reconnect") %> + {gettext("Attempting to reconnect")} <.icon name="hero-arrow-path" class="ml-1 h-3 w-3 animate-spin" /> @@ -174,7 +174,7 @@ defmodule MusicLibraryWeb.CoreComponents do phx-connected={hide("#server-error")} hidden > - <%= gettext("Hang in there while we get back on track") %> + {gettext("Hang in there while we get back on track")} <.icon name="hero-arrow-path" class="ml-1 h-3 w-3 animate-spin" /> @@ -208,9 +208,9 @@ defmodule MusicLibraryWeb.CoreComponents do ~H""" <.form :let={f} for={@for} as={@as} {@rest}>
- <%= render_slot(@inner_block, f) %> + {render_slot(@inner_block, f)}
- <%= render_slot(action, f) %> + {render_slot(action, f)}
@@ -245,7 +245,7 @@ defmodule MusicLibraryWeb.CoreComponents do ]} {@rest} > - <%= render_slot(@inner_block) %> + {render_slot(@inner_block)} """ end @@ -330,9 +330,9 @@ defmodule MusicLibraryWeb.CoreComponents do class="rounded border-zinc-300 text-zinc-900 focus:ring-0" {@rest} /> - <%= @label %> + {@label} - <.error :for={msg <- @errors}><%= msg %> + <.error :for={msg <- @errors}>{msg} """ end @@ -340,7 +340,7 @@ defmodule MusicLibraryWeb.CoreComponents do def input(%{type: "select"} = assigns) do ~H"""
- <.label for={@id}><%= @label %> + <.label for={@id}>{@label} - <.error :for={msg <- @errors}><%= msg %> + <.error :for={msg <- @errors}>{msg}
""" end @@ -369,7 +369,7 @@ defmodule MusicLibraryWeb.CoreComponents do def input(%{type: "textarea"} = assigns) do ~H"""
- <.label for={@id}><%= @label %> + <.label for={@id}>{@label} - <.error :for={msg <- @errors}><%= msg %> + <.error :for={msg <- @errors}>{msg}
""" end @@ -389,7 +389,7 @@ defmodule MusicLibraryWeb.CoreComponents do def input(assigns) do ~H"""
- <.label for={@id}><%= @label %> + <.label for={@id}>{@label} - <.error :for={msg <- @errors}><%= msg %> + <.error :for={msg <- @errors}>{msg}
""" end @@ -424,7 +424,7 @@ defmodule MusicLibraryWeb.CoreComponents do def label(assigns) do ~H""" """ end @@ -438,7 +438,7 @@ defmodule MusicLibraryWeb.CoreComponents do ~H"""

<.icon name="hero-exclamation-circle-mini" class="mt-0.5 h-5 w-5 flex-none" /> - <%= render_slot(@inner_block) %> + {render_slot(@inner_block)}

""" end @@ -460,13 +460,13 @@ defmodule MusicLibraryWeb.CoreComponents do ]}>

- <%= render_slot(@inner_block) %> + {render_slot(@inner_block)}

- <%= render_slot(@subtitle) %> + {render_slot(@subtitle)}

-
<%= render_slot(@actions) %>
+
{render_slot(@actions)}
""" end @@ -507,9 +507,9 @@ defmodule MusicLibraryWeb.CoreComponents do - + @@ -527,7 +527,7 @@ defmodule MusicLibraryWeb.CoreComponents do
- <%= render_slot(col, @row_item.(row)) %> + {render_slot(col, @row_item.(row))}
@@ -538,7 +538,7 @@ defmodule MusicLibraryWeb.CoreComponents do :for={action <- @action} class="relative ml-4 max-sm:ml-2 max-sm:text-sm font-semibold leading-6 text-zinc-900 hover:text-zinc-700" > - <%= render_slot(action, @row_item.(row)) %> + {render_slot(action, @row_item.(row))} @@ -568,8 +568,8 @@ defmodule MusicLibraryWeb.CoreComponents do
-
<%= item.title %>
-
<%= render_slot(item) %>
+
{item.title}
+
{render_slot(item)}
@@ -594,7 +594,7 @@ defmodule MusicLibraryWeb.CoreComponents do class="text-sm font-semibold leading-6 text-zinc-900 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-300" > <.icon name="hero-arrow-left-solid" class="h-3 w-3" /> - <%= render_slot(@inner_block) %> + {render_slot(@inner_block)} """ diff --git a/lib/music_library_web/components/layouts/app.html.heex b/lib/music_library_web/components/layouts/app.html.heex index 0c569472..c880f9ad 100644 --- a/lib/music_library_web/components/layouts/app.html.heex +++ b/lib/music_library_web/components/layouts/app.html.heex @@ -4,28 +4,28 @@
<.link navigate={~p"/"} class={section_link_classes(assigns[:nav_section], :stats)}> - <%= gettext("Stats") %> + {gettext("Stats")} <.link navigate={~p"/collection"} class={section_link_classes(assigns[:nav_section], :records)} > - <%= gettext("Collection") %> + {gettext("Collection")} <.link navigate={~p"/wishlist"} class={section_link_classes(assigns[:nav_section], :wishlist)} > - <%= gettext("Wishlist") %> + {gettext("Wishlist")}
- <%= gettext("Dev dashboard") %> + {gettext("Dev dashboard")} - <%= gettext("Logout") %> + {gettext("Logout")}
@@ -34,6 +34,6 @@
<.flash_group flash={@flash} /> - <%= @inner_content %> + {@inner_content}
diff --git a/lib/music_library_web/components/layouts/root.html.heex b/lib/music_library_web/components/layouts/root.html.heex index 276baae7..97bce30f 100644 --- a/lib/music_library_web/components/layouts/root.html.heex +++ b/lib/music_library_web/components/layouts/root.html.heex @@ -5,7 +5,7 @@ <.live_title suffix=" · Music Library"> - <%= assigns[:page_title] || assigns.conn.request_path %> + {assigns[:page_title] || assigns.conn.request_path} @@ -35,7 +35,7 @@ - <%= @inner_content %> + {@inner_content}
<%= col[:label] %>{col[:label]} - <%= gettext("Actions") %> + {gettext("Actions")}