Add more artist links with correct style
This commit is contained in:
@@ -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
|
||||
@@ -1,8 +1,6 @@
|
||||
defmodule MusicLibraryWeb.StatsHTML do
|
||||
use MusicLibraryWeb, :html
|
||||
|
||||
import MusicLibraryWeb.ArtistHelpers
|
||||
|
||||
alias MusicLibrary.Records.Record
|
||||
|
||||
embed_templates "stats_html/*"
|
||||
|
||||
@@ -16,9 +16,13 @@
|
||||
</dt>
|
||||
<dd class="ml-24 flex items-baseline pb-6 sm:pb-7">
|
||||
<p class="font-semibold">
|
||||
<span class="text-sm md:text-base lg:text-2xl text-gray-900">
|
||||
<%= format_artist_names(@latest_record.artists) %>
|
||||
</span>
|
||||
<.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 %>
|
||||
</.link>
|
||||
<span class="text-sm md:text-base block text-gray-600">
|
||||
<%= @latest_record.title %>
|
||||
</span>
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
<p class="text-sm max-sm:text-xs">
|
||||
<.link
|
||||
:for={artist <- record.artists}
|
||||
class=" hover:text-gray-500"
|
||||
patch={~p"/records?query=mbid:#{artist.musicbrainz_id}"}
|
||||
>
|
||||
<%= artist.name %>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
defmodule MusicLibraryWeb.RecordLive.Show do
|
||||
use MusicLibraryWeb, :live_view
|
||||
import MusicLibraryWeb.ArtistHelpers
|
||||
|
||||
alias MusicLibrary.Records
|
||||
|
||||
|
||||
@@ -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 %>
|
||||
</.link>
|
||||
<:subtitle>
|
||||
<%= @record.title %>
|
||||
</:subtitle>
|
||||
|
||||
Reference in New Issue
Block a user