feat: add top pick for you section to homepage

This commit is contained in:
2026-06-05 16:15:13 +02:00
committed by Milas Holsting
parent 8e66581f6c
commit e235f36a45
5 changed files with 67 additions and 46 deletions

View File

@@ -34,17 +34,6 @@
</div>
</section>
{{/* For You Section */}}
<section id="discover-for-you-section" class="flex flex-col gap-4">
<div class="flex items-center justify-between">
<h2 class="text-base font-normal text-foreground">For You</h2>
<span class="text-sm text-foreground-muted">Based on your watchlist</span>
</div>
<div hx-get="/api/discover/for-you" hx-trigger="load" hx-target="#discover-for-you-section" hx-swap="outerHTML">
{{template "discover_skeleton"}}
</div>
</section>
{{/* Upcoming Section */}}
<section class="flex flex-col gap-4">
<div class="flex items-center justify-between">
@@ -85,30 +74,6 @@
</div>
{{end}}
{{define "discover_row"}}
<div class="grid gap-4 [grid-template-columns:repeat(auto-fit,minmax(160px,1fr))]">
{{range .Animes}}
{{template "anime_card" dict "Anime" . "WithActions" true "IsWatchlist" (index $.WatchlistMap .MalID)}}
{{end}}
</div>
{{end}}
{{define "discover_for_you_section"}}
{{if gt (len .Animes) 0}}
<section id="discover-for-you-section" class="flex flex-col gap-4">
<div class="flex items-center justify-between">
<h2 class="text-base font-normal text-foreground">For You</h2>
<span class="text-sm text-foreground-muted">Based on your watchlist</span>
</div>
<div class="grid gap-4 [grid-template-columns:repeat(auto-fit,minmax(160px,1fr))]">
{{range .Animes}}
{{template "anime_card" dict "Anime" . "WithActions" true "IsWatchlist" (index $.WatchlistMap .MalID)}}
{{end}}
</div>
</section>
{{end}}
{{end}}
{{define "discover_skeleton"}}
<div class="discover-grid">
{{range (seq 8)}}