From a9870fb5d7340c7c98683ed4a9bb395fce6a0fff Mon Sep 17 00:00:00 2001 From: Kieran Eglin Date: Thu, 21 Nov 2024 12:18:22 -0800 Subject: [PATCH] [Unrelated] added direct links to various tabs on the sources table --- .../media_profile_html/index.html.heex | 6 +++--- .../sources/source_html/index_table_live.ex | 13 ++++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/pinchflat_web/controllers/media_profiles/media_profile_html/index.html.heex b/lib/pinchflat_web/controllers/media_profiles/media_profile_html/index.html.heex index 913213c..cff9635 100644 --- a/lib/pinchflat_web/controllers/media_profiles/media_profile_html/index.html.heex +++ b/lib/pinchflat_web/controllers/media_profiles/media_profile_html/index.html.heex @@ -10,8 +10,6 @@ -<%!-- TODO: link the sources count to the sources tab --%> -<%!-- TODO: consider doing the same for other tables, like the source index's media item counts --%>
@@ -25,7 +23,9 @@ <%= media_profile.preferred_resolution %> <:col :let={media_profile} label="Sources"> - <.localized_number number={media_profile.source_count} /> + <.subtle_link href={~p"/media_profiles/#{media_profile.id}/#tab-sources"}> + <.localized_number number={media_profile.source_count} /> + <:col :let={media_profile} label="" class="flex justify-end"> <.icon_link href={~p"/media_profiles/#{media_profile.id}/edit"} icon="hero-pencil-square" class="mr-4" /> diff --git a/lib/pinchflat_web/controllers/sources/source_html/index_table_live.ex b/lib/pinchflat_web/controllers/sources/source_html/index_table_live.ex index 5b8ec5f..bba907b 100644 --- a/lib/pinchflat_web/controllers/sources/source_html/index_table_live.ex +++ b/lib/pinchflat_web/controllers/sources/source_html/index_table_live.ex @@ -9,7 +9,6 @@ defmodule PinchflatWeb.Sources.IndexTableLive do alias Pinchflat.Media.MediaItem # TODO: test (and maybe remove existing index tests) - # TODO: see comments in media profile index view def render(assigns) do ~H""" <.table rows={@sources} table_class="text-white"> @@ -18,8 +17,16 @@ defmodule PinchflatWeb.Sources.IndexTableLive do <%= StringUtils.truncate(source.custom_name || source.collection_name, 35) %> - <:col :let={source} label="Pending"><.localized_number number={source.pending_count} /> - <:col :let={source} label="Downloaded"><.localized_number number={source.downloaded_count} /> + <:col :let={source} label="Pending"> + <.subtle_link href={~p"/sources/#{source.id}/#tab-pending"}> + <.localized_number number={source.pending_count} /> + + + <:col :let={source} label="Downloaded"> + <.subtle_link href={~p"/sources/#{source.id}/#tab-downloaded"}> + <.localized_number number={source.downloaded_count} /> + + <:col :let={source} label="Retention"> <%= if source.retention_period_days && source.retention_period_days > 0 do %> <.localized_number number={source.retention_period_days} />