Add ability to order wishlisted records by release date

This commit is contained in:
Claudio Ortolina
2025-12-15 10:15:40 +03:00
parent df4d5ad02f
commit 9413082ef9
4 changed files with 13 additions and 0 deletions
@@ -196,6 +196,7 @@ defmodule MusicLibraryWeb.WishlistLive.Index do
defp parse_order("alphabetical"), do: :alphabetical
defp parse_order("insertion"), do: :insertion
defp parse_order("release"), do: :release
defp order_path(record_list_params, order) do
qs =
@@ -38,6 +38,16 @@
<.icon name="hero-user-solid" class="icon" aria-hidden="true" data-slot="icon" />
<span class="sr-only sm:not-sr-only">{gettext("A->Z")}</span>
</.button>
<.button
patch={order_path(@record_list_params, :release)}
size="sm"
class={[
@record_list_params.order == :release && "bg-zinc-100! dark:bg-zinc-700!"
]}
>
<.icon name="hero-calendar-days" class="icon" aria-hidden="true" data-slot="icon" />
<span class="sr-only sm:not-sr-only">{gettext("Release")}</span>
</.button>
</.button_group>
<.button_group>
+1
View File
@@ -1630,6 +1630,7 @@ msgid "Never"
msgstr ""
#: lib/music_library_web/live/collection_live/index.html.heex
#: lib/music_library_web/live/wishlist_live/index.html.heex
#, elixir-autogen, elixir-format
msgid "Release"
msgstr ""
+1
View File
@@ -1630,6 +1630,7 @@ msgid "Never"
msgstr ""
#: lib/music_library_web/live/collection_live/index.html.heex
#: lib/music_library_web/live/wishlist_live/index.html.heex
#, elixir-autogen, elixir-format, fuzzy
msgid "Release"
msgstr ""