Navigate to individual artist from collection
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
defmodule MusicLibraryWeb.RecordLive.Index do
|
||||
use MusicLibraryWeb, :live_view
|
||||
import MusicLibraryWeb.Pagination
|
||||
import MusicLibraryWeb.ArtistHelpers
|
||||
|
||||
alias MusicLibrary.Records
|
||||
|
||||
@@ -65,7 +64,7 @@ defmodule MusicLibraryWeb.RecordLive.Index do
|
||||
total_records = Records.search_records_count(query)
|
||||
|
||||
record_list_params =
|
||||
socket.assigns.record_list_params
|
||||
@default_records_list_params
|
||||
|> merge_query(params["query"])
|
||||
|> merge_pagination(params, total_records)
|
||||
|
||||
|
||||
@@ -46,7 +46,14 @@
|
||||
</span>
|
||||
</:col>
|
||||
<:col :let={{_id, record}}>
|
||||
<p class="text-sm max-sm:text-xs"><%= format_artist_names(record.artists) %></p>
|
||||
<p class="text-sm max-sm:text-xs">
|
||||
<.link
|
||||
:for={artist <- record.artists}
|
||||
patch={~p"/records?query=mbid:#{artist.musicbrainz_id}"}
|
||||
>
|
||||
<%= artist.name %>
|
||||
</.link>
|
||||
</p>
|
||||
<p class="text-base font-semibold text-wrap max-sm:text-xs"><%= record.title %></p>
|
||||
<p class="text-sm max-sm:text-xs">
|
||||
<%= Records.Record.format_release(record.release) %>
|
||||
|
||||
Reference in New Issue
Block a user