package templates import "net/url" // PodcastFacetLink links a facet value back into the podcasts page's // server-side filter (the /bookshelf FacetLink targets the wrong // surface for podcasts). templ PodcastFacetLink(facet string, value string) { { value } } // The /podcasts page (plan task 1.9, D13/D14/D18): Add Feed wizard, // subscription-scoped search, facet bar, All-Feeds grid. Server-side // filtering (GET form, like the series page — no JS needed); the grid // is templ-rendered server data per the rendering-ownership rule. templ PodcastsPage(user User, data PodcastsPageData, currentPath string) { Podcasts - Bookhoard @Header(user, currentPath)
@Icon("podcast", "h-5 w-5")

Podcasts

Your subscriptions

if data.HasLibrary { }
if data.ErrorMsg != "" {
{ data.ErrorMsg }
} if !data.HasLibrary {

No podcasts library yet

An admin creates a Podcasts library (with a download folder) first — then feeds can be added here.

} else { @PodcastsFilterBar(data) if len(data.Feeds) == 0 {

No subscriptions

Add an RSS feed to start listening — episodes land here and download on demand.

} else { @PodcastsGrid(data.Feeds) } }
@PodcastAddFeedModal(data.Libraries) } templ PodcastsFilterBar(data PodcastsPageData) {
@Icon("search", "h-4 w-4")
if len(data.Facets["hosts"]) > 0 || len(data.Facets["tags"]) > 0 || len(data.Facets["language"]) > 0 {
Filter: for _, h := range data.Facets["hosts"] { @PodcastFacetLink("host", h) } for _, t := range data.Facets["tags"] { @PodcastFacetLink("tag", t) } for _, l := range data.Facets["language"] { @PodcastFacetLink("language", l) } if data.Query != "" { clear }
} } templ PodcastsGrid(feeds []PodcastFeedCard) {
for _, feed := range feeds { @PodcastFeedCardView(feed) }
} templ PodcastFeedCardView(feed PodcastFeedCard) {
if feed.ArtworkPath != "" { { } else { @Icon("podcast", "h-7 w-7") }

{ feed.DisplayTitle() }

{ feed.TypeLabel() } if feed.Host != "" { { " · " + feed.Host } }

if feed.Description != "" {

{ feed.Description }

}
{ podcastInt(feed.DownloadedN) + " / " + podcastInt(feed.EpisodeTotal) + " downloaded" } if feed.NewEpisodes { new episodes } if feed.IsComplete { complete } if feed.Explicit { explicit }
} templ PodcastAddFeedModal(libraries []LibraryData) { }