diff --git a/lib/music_library_web/components/record_components.ex b/lib/music_library_web/components/record_components.ex index 80c5540c..e8f87aed 100644 --- a/lib/music_library_web/components/record_components.ex +++ b/lib/music_library_web/components/record_components.ex @@ -212,14 +212,17 @@ defmodule MusicLibraryWeb.RecordComponents do id={@id} phx-update="stream" role="list" - class="mt-4 grid grid-cols-3 gap-x-4 gap-y-8 sm:grid-cols-4 sm:gap-x-6 xl:gap-x-8" + class="mt-4 grid grid-cols-2 gap-x-4 gap-y-8 sm:grid-cols-4 sm:gap-x-6 xl:gap-x-8" >
  • -
    -
    +
    +
    <.record_cover record={record} - class="pointer-events-none aspect-square object-cover group-hover:opacity-75" + class="aspect-square object-cover hover:opacity-75" width={460} /> {Records.Record.included_release_groups_count(record)} +
    + <.dropdown id={"actions-#{record.id}"} placement="bottom-end"> + <:toggle> + {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" + phx-click={JS.toggle_class("pointer-events-none", to: "#{@id} > li")} + phx-click-away={JS.remove_class("pointer-events-none", to: "#{@id} > li")} + /> + + <.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")} + + + +
    -
    -

    +

    {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)}