Display included releases count in records grid
This commit is contained in:
@@ -234,11 +234,25 @@ defmodule MusicLibraryWeb.RecordComponents do
|
||||
>
|
||||
<li :for={{id, record} <- @records} id={id} class="relative">
|
||||
<div class="group overflow-hidden rounded-lg bg-zinc-100 focus-within:ring-2 focus-within:ring-zinc-500 focus-within:ring-offset-2 focus-within:ring-offset-zinc-100">
|
||||
<img
|
||||
alt={record.title}
|
||||
src={~p"/covers/#{record.id}?vsn=#{record.cover_hash}"}
|
||||
class="pointer-events-none aspect-square object-cover group-hover:opacity-75"
|
||||
/>
|
||||
<div class="relative">
|
||||
<img
|
||||
alt={record.title}
|
||||
src={~p"/covers/#{record.id}?vsn=#{record.cover_hash}"}
|
||||
class="pointer-events-none aspect-square object-cover group-hover:opacity-75"
|
||||
/>
|
||||
<span
|
||||
:if={Records.Record.included_release_groups_count(record) > 0}
|
||||
class={[
|
||||
"absolute right-0 bottom-0 rounded-br-lg rounded-tl-lg px-2",
|
||||
"text-sm font-medium",
|
||||
"bg-zinc-50 dark:bg-zinc-500/10",
|
||||
"text-zinc-700 dark:text-zinc-400",
|
||||
"border-1 border-zinc-600/20 dark:border-zinc-500/20"
|
||||
]}
|
||||
>
|
||||
{Records.Record.included_release_groups_count(record)}
|
||||
</span>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="absolute inset-0 focus:outline-hidden"
|
||||
|
||||
Reference in New Issue
Block a user