Add record format (defaulting to CD)

This commit is contained in:
Claudio Ortolina
2024-09-28 19:16:15 +01:00
parent 154b94646a
commit 82e5962c74
5 changed files with 39 additions and 3 deletions
@@ -24,7 +24,12 @@
row_click={fn {_id, record} -> JS.navigate(~p"/records/#{record}") end}
>
<:col :let={{_id, record}} label="Image">
<img class="max-w-16 rounded-lg shadow" src={~p"/images/#{record.id}"} alt={record.title} />
<span class="relative inline-block">
<img class="max-w-16 rounded-lg shadow" src={~p"/images/#{record.id}"} alt={record.title} />
<span class="absolute right-0 bottom-0 block h-6 w-6 text-white drop-shadow-md">
<%= Records.Record.format_short_label(record.format) %>
</span>
</span>
</:col>
<:col :let={{_id, record}} label="Record">
<p class="text-sm max-sm:text-xs"><%= Enum.map(record.artists, fn a -> a.name end) %></p>
@@ -12,7 +12,12 @@
</.header>
<div class="columns-2">
<img class="w-full" src={~p"/images/#{@record.id}"} alt={@record.title} />
<span class="relative inline-block">
<img class="w-full shadow" src={~p"/images/#{@record.id}"} alt={@record.title} />
<span class="absolute right-2 bottom-1 block h-6 w-6 text-white drop-shadow-md">
<%= Records.Record.format_short_label(@record.format) %>
</span>
</span>
<.list>
<:item title="Type"><%= @record.type %></:item>