diff --git a/internal/anime/handler.go b/internal/anime/handler.go index e56b479..d6c93cd 100644 --- a/internal/anime/handler.go +++ b/internal/anime/handler.go @@ -256,7 +256,7 @@ func (h *AnimeHandler) HandleDiscoverForYou(c *gin.Context) { watchlistMap := h.watchlistMapForAnimes(c.Request.Context(), userID, data.Animes) data.Section = "ForYou" - data.Fragment = "discover_row" + data.Fragment = "discover_for_you_section" data.WatchlistMap = watchlistMap c.HTML(http.StatusOK, "discover.gohtml", data) } diff --git a/templates/discover.gohtml b/templates/discover.gohtml index 2a67fe1..11f6231 100644 --- a/templates/discover.gohtml +++ b/templates/discover.gohtml @@ -35,12 +35,12 @@ {{/* For You Section */}} -
+

For You

Based on your watchlist
-
+
{{template "discover_skeleton"}}
@@ -93,6 +93,22 @@ {{end}} +{{define "discover_for_you_section"}} +{{if gt (len .Animes) 0}} +
+
+

For You

+ Based on your watchlist +
+
+ {{range .Animes}} + {{template "anime_card" dict "Anime" . "WithActions" true "IsWatchlist" (index $.WatchlistMap .MalID)}} + {{end}} +
+
+{{end}} +{{end}} + {{define "discover_skeleton"}}
{{range (seq 8)}}