Move filters/selectors to the side of the title

This commit is contained in:
Claudio Ortolina
2026-03-21 18:21:39 +00:00
parent 19428b85f2
commit b85ce0831c
4 changed files with 85 additions and 82 deletions
@@ -65,8 +65,11 @@ defmodule MusicLibraryWeb.StatsLive.Index do
</div> </div>
</div> </div>
<div class="mt-5 grid grid-cols-1 gap-5 lg:grid-cols-3"> <div class="grid grid-cols-1 gap-5 lg:grid-cols-3 mt-5">
<TopArtists.live id="top-artists" timezone={@timezone} last_updated_uts={@last_updated_uts} />
<TopAlbums.live id="top-albums" timezone={@timezone} last_updated_uts={@last_updated_uts} />
<div> <div>
<div class="flex items-center justify-between">
<h1 class="text-base font-semibold text-zinc-900 lg:text-2xl dark:text-zinc-200"> <h1 class="text-base font-semibold text-zinc-900 lg:text-2xl dark:text-zinc-200">
{gettext("On This day")} {gettext("On This day")}
</h1> </h1>
@@ -74,7 +77,6 @@ defmodule MusicLibraryWeb.StatsLive.Index do
:let={f} :let={f}
for={to_form(%{"current_date" => @current_date})} for={to_form(%{"current_date" => @current_date})}
phx-change="set_current_date" phx-change="set_current_date"
class="mt-4 w-fit"
> >
<.date_picker size="xs" field={f[:current_date]}> <.date_picker size="xs" field={f[:current_date]}>
<:outer_suffix> <:outer_suffix>
@@ -90,6 +92,7 @@ defmodule MusicLibraryWeb.StatsLive.Index do
</:outer_suffix> </:outer_suffix>
</.date_picker> </.date_picker>
</.form> </.form>
</div>
<div class="rounded-md bg-white shadow-sm dark:bg-zinc-800"> <div class="rounded-md bg-white shadow-sm dark:bg-zinc-800">
<.records_on_this_day <.records_on_this_day
current_date={@current_date} current_date={@current_date}
@@ -98,8 +101,6 @@ defmodule MusicLibraryWeb.StatsLive.Index do
/> />
</div> </div>
</div> </div>
<TopArtists.live id="top-artists" timezone={@timezone} last_updated_uts={@last_updated_uts} />
<TopAlbums.live id="top-albums" timezone={@timezone} last_updated_uts={@last_updated_uts} />
</div> </div>
<div class="flow-root"> <div class="flow-root">
@@ -20,10 +20,11 @@ defmodule MusicLibraryWeb.StatsLive.TopByPeriod do
def render(assigns) do def render(assigns) do
~H""" ~H"""
<div> <div>
<.tabs>
<div class="flex justify-between">
<h1 class="text-base font-semibold text-zinc-900 lg:text-2xl dark:text-zinc-200"> <h1 class="text-base font-semibold text-zinc-900 lg:text-2xl dark:text-zinc-200">
{@title} {@title}
</h1> </h1>
<.tabs class="mt-4">
<.tabs_list active_tab={name_from_period(@key, @period)} variant="segmented" size="xs"> <.tabs_list active_tab={name_from_period(@key, @period)} variant="segmented" size="xs">
<:tab <:tab
class="flex-1" class="flex-1"
@@ -63,9 +64,10 @@ defmodule MusicLibraryWeb.StatsLive.TopByPeriod do
phx-click={JS.push("set_period", value: %{period: "all_time"})} phx-click={JS.push("set_period", value: %{period: "all_time"})}
phx-target={@myself} phx-target={@myself}
> >
{gettext("All time")} {gettext("")}
</:tab> </:tab>
</.tabs_list> </.tabs_list>
</div>
<.async_result :let={items} assign={assigns[@key]}> <.async_result :let={items} assign={assigns[@key]}>
<:loading> <:loading>
<div class="flex h-182 items-center justify-center"> <div class="flex h-182 items-center justify-center">
+5 -5
View File
@@ -852,11 +852,6 @@ msgstr ""
msgid "Top Artists" msgid "Top Artists"
msgstr "" msgstr ""
#: lib/music_library_web/live/stats_live/top_by_period.ex
#, elixir-autogen, elixir-format
msgid "All time"
msgstr ""
#: lib/music_library_web/components/scrobble_components.ex #: lib/music_library_web/components/scrobble_components.ex
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Copy album MusicBrainz ID to clipboard" msgid "Copy album MusicBrainz ID to clipboard"
@@ -2341,3 +2336,8 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Top 20 Release Years" msgid "Top 20 Release Years"
msgstr "" msgstr ""
#: lib/music_library_web/live/stats_live/top_by_period.ex
#, elixir-autogen, elixir-format
msgid "∞"
msgstr ""
+5 -5
View File
@@ -852,11 +852,6 @@ msgstr ""
msgid "Top Artists" msgid "Top Artists"
msgstr "" msgstr ""
#: lib/music_library_web/live/stats_live/top_by_period.ex
#, elixir-autogen, elixir-format
msgid "All time"
msgstr ""
#: lib/music_library_web/components/scrobble_components.ex #: lib/music_library_web/components/scrobble_components.ex
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
msgid "Copy album MusicBrainz ID to clipboard" msgid "Copy album MusicBrainz ID to clipboard"
@@ -2341,3 +2336,8 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Top 20 Release Years" msgid "Top 20 Release Years"
msgstr "" msgstr ""
#: lib/music_library_web/live/stats_live/top_by_period.ex
#, elixir-autogen, elixir-format
msgid "∞"
msgstr ""