[Unrelated] added direct links to various tabs on the sources table

This commit is contained in:
Kieran Eglin 2024-11-21 12:18:22 -08:00
parent 53ab5daa96
commit a9870fb5d7
No known key found for this signature in database
GPG key ID: 193984967FCF432D
2 changed files with 13 additions and 6 deletions

View file

@ -10,8 +10,6 @@
</.link>
</nav>
</div>
<%!-- 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 --%>
<div class="rounded-sm border border-stroke bg-white shadow-default dark:border-strokedark dark:bg-boxdark">
<div class="max-w-full overflow-x-auto">
<div class="flex flex-col gap-10 min-w-max">
@ -25,7 +23,9 @@
<%= media_profile.preferred_resolution %>
</:col>
<: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} />
</.subtle_link>
</:col>
<: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" />

View file

@ -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) %>
</.subtle_link>
</:col>
<:col :let={source} label="Pending"><.localized_number number={source.pending_count} /></:col>
<:col :let={source} label="Downloaded"><.localized_number number={source.downloaded_count} /></:col>
<:col :let={source} label="Pending">
<.subtle_link href={~p"/sources/#{source.id}/#tab-pending"}>
<.localized_number number={source.pending_count} />
</.subtle_link>
</:col>
<:col :let={source} label="Downloaded">
<.subtle_link href={~p"/sources/#{source.id}/#tab-downloaded"}>
<.localized_number number={source.downloaded_count} />
</.subtle_link>
</:col>
<:col :let={source} label="Retention">
<%= if source.retention_period_days && source.retention_period_days > 0 do %>
<.localized_number number={source.retention_period_days} />