diff --git a/lib/music_library_web/components/record_components.ex b/lib/music_library_web/components/record_components.ex index e89a6281..462cc9ec 100644 --- a/lib/music_library_web/components/record_components.ex +++ b/lib/music_library_web/components/record_components.ex @@ -190,16 +190,21 @@ defmodule MusicLibraryWeb.RecordComponents do end attr :records, :list, required: true - attr :records_count, :integer, required: true - attr :title, :string, required: true + attr :records_count, :integer, default: 0 + attr :title, :string, default: nil attr :id, :string, required: true attr :record_show_path, :any, required: true attr :record_edit_path, :any, required: true + attr :display_artist_names, :boolean, default: false + attr :density, :atom, values: [:low, :high], default: :low def record_grid(assigns) do ~H"""
- {record.title} -
-- {format_label(record.format)} · {type_label(record.type)} -
-- {Records.Record.format_release_date(record.release_date)} -
- - - - """ - end - - attr :records, :list, required: true - attr :id, :string, required: true - attr :record_show_path, :any, required: true - attr :record_edit_path, :any, required: true - - def dense_record_grid(assigns) do - ~H""" -+ <.artist_links joinphrase_class="text-xs" artists={record.artists} /> + +
{record.title}
- <.dropdown id={"actions-#{record.id}"} placement="bottom-end"> - <:toggle> - <.button variant="ghost" class="mt-2"> - {gettext("Actions")} - <.icon - name="hero-ellipsis-vertical" - class="h-5 w-5 text-zinc-500 dark:text-zinc-400 cursor-pointer" - aria-hidden="true" - data-slot="icon" - /> - - - <.focus_wrap id={"actions-#{record.id}-focus-wrap"}> - <.dropdown_link id={"actions-#{record.id}-edit"} patch={@record_edit_path.(record)}> - {gettext("Edit")} - - - <.dropdown_link - :if={!record.purchased_at} - id={"actions-#{record.id}-purchase"} - phx-click={ - JS.dispatch("music_library:confetti") - |> JS.push("add-to-collection", value: %{id: record.id}) - } - > - {gettext("Purchased")} - - <.dropdown_separator /> - <.dropdown_link - id={"actions-#{record.id}-delete"} - phx-click={JS.push("delete", value: %{id: record.id}) |> hide("##{id}")} - data-confirm={gettext("Are you sure?")} - class="text-red-900! hover:bg-red-50! dark:text-red-500! dark:hover:bg-red-900/30! dark:hover:text-red-600!" - > - {gettext("Delete")} - - -{format_label(record.format)} · {type_label(record.type)} diff --git a/lib/music_library_web/live/collection_live/index.html.heex b/lib/music_library_web/live/collection_live/index.html.heex index 55681ad3..796c0323 100644 --- a/lib/music_library_web/live/collection_live/index.html.heex +++ b/lib/music_library_web/live/collection_live/index.html.heex @@ -89,12 +89,14 @@