diff --git a/lib/music_library_web/artist_helpers.ex b/lib/music_library_web/artist_helpers.ex deleted file mode 100644 index 42e80603..00000000 --- a/lib/music_library_web/artist_helpers.ex +++ /dev/null @@ -1,7 +0,0 @@ -defmodule MusicLibraryWeb.ArtistHelpers do - def format_artist_names(artists) do - artists - |> Enum.map(fn a -> a.name end) - |> Enum.join(", ") - end -end diff --git a/lib/music_library_web/controllers/stats_html.ex b/lib/music_library_web/controllers/stats_html.ex index 726d7d7f..dcb1ef01 100644 --- a/lib/music_library_web/controllers/stats_html.ex +++ b/lib/music_library_web/controllers/stats_html.ex @@ -1,8 +1,6 @@ defmodule MusicLibraryWeb.StatsHTML do use MusicLibraryWeb, :html - import MusicLibraryWeb.ArtistHelpers - alias MusicLibrary.Records.Record embed_templates "stats_html/*" diff --git a/lib/music_library_web/controllers/stats_html/index.html.heex b/lib/music_library_web/controllers/stats_html/index.html.heex index 0058aad8..e59ea7ad 100644 --- a/lib/music_library_web/controllers/stats_html/index.html.heex +++ b/lib/music_library_web/controllers/stats_html/index.html.heex @@ -16,9 +16,13 @@
- - <%= format_artist_names(@latest_record.artists) %> - + <.link + :for={artist <- @latest_record.artists} + class="text-sm md:text-base lg:text-2xl text-gray-900 hover:text-gray-500" + patch={~p"/records?query=mbid:#{artist.musicbrainz_id}"} + > + <%= artist.name %> + <%= @latest_record.title %> diff --git a/lib/music_library_web/live/record_live/index.html.heex b/lib/music_library_web/live/record_live/index.html.heex index b4cd6262..3a743301 100644 --- a/lib/music_library_web/live/record_live/index.html.heex +++ b/lib/music_library_web/live/record_live/index.html.heex @@ -49,6 +49,7 @@
<.link :for={artist <- record.artists} + class=" hover:text-gray-500" patch={~p"/records?query=mbid:#{artist.musicbrainz_id}"} > <%= artist.name %> diff --git a/lib/music_library_web/live/record_live/show.ex b/lib/music_library_web/live/record_live/show.ex index a3844128..29b8ef0b 100644 --- a/lib/music_library_web/live/record_live/show.ex +++ b/lib/music_library_web/live/record_live/show.ex @@ -1,6 +1,5 @@ defmodule MusicLibraryWeb.RecordLive.Show do use MusicLibraryWeb, :live_view - import MusicLibraryWeb.ArtistHelpers alias MusicLibrary.Records diff --git a/lib/music_library_web/live/record_live/show.html.heex b/lib/music_library_web/live/record_live/show.html.heex index 3f214419..3a28e89f 100644 --- a/lib/music_library_web/live/record_live/show.html.heex +++ b/lib/music_library_web/live/record_live/show.html.heex @@ -1,5 +1,11 @@ <.header> - <%= format_artist_names(@record.artists) %> + <.link + :for={artist <- @record.artists} + class=" hover:text-gray-500" + patch={~p"/records?query=mbid:#{artist.musicbrainz_id}"} + > + <%= artist.name %> + <:subtitle> <%= @record.title %>