fix: align template data keys with template expectations
This commit is contained in:
@@ -166,25 +166,6 @@ func (h *AnimeHandler) HandleBrowse(c *gin.Context) {
|
|||||||
log.Printf("browse error: %v", err)
|
log.Printf("browse error: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.GetHeader("HX-Request") == "true" {
|
|
||||||
c.HTML(http.StatusOK, "browse.gohtml", gin.H{
|
|
||||||
"_fragment": "anime_card_scroll",
|
|
||||||
"Animes": res.Animes,
|
|
||||||
"NextPage": page + 1,
|
|
||||||
"HasNextPage": res.HasNextPage,
|
|
||||||
"Query": q,
|
|
||||||
"Type": animeType,
|
|
||||||
"Status": status,
|
|
||||||
"OrderBy": orderBy,
|
|
||||||
"Sort": sort,
|
|
||||||
"Genres": genres,
|
|
||||||
"SFW": sfw,
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
genresList, _ := h.svc.GetGenres(c.Request.Context())
|
|
||||||
|
|
||||||
user, _ := c.Get("User")
|
user, _ := c.Get("User")
|
||||||
watchlistMap := make(map[int]bool)
|
watchlistMap := make(map[int]bool)
|
||||||
if u, ok := user.(*domain.User); ok {
|
if u, ok := user.(*domain.User); ok {
|
||||||
@@ -194,6 +175,26 @@ func (h *AnimeHandler) HandleBrowse(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c.GetHeader("HX-Request") == "true" {
|
||||||
|
c.HTML(http.StatusOK, "browse.gohtml", gin.H{
|
||||||
|
"_fragment": "anime_card_scroll",
|
||||||
|
"Animes": res.Animes,
|
||||||
|
"NextPage": page + 1,
|
||||||
|
"HasNextPage": res.HasNextPage,
|
||||||
|
"Query": q,
|
||||||
|
"Type": animeType,
|
||||||
|
"Status": status,
|
||||||
|
"OrderBy": orderBy,
|
||||||
|
"Sort": sort,
|
||||||
|
"Genres": genres,
|
||||||
|
"SFW": sfw,
|
||||||
|
"WatchlistMap": watchlistMap,
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
genresList, _ := h.svc.GetGenres(c.Request.Context())
|
||||||
|
|
||||||
c.HTML(http.StatusOK, "browse.gohtml", gin.H{
|
c.HTML(http.StatusOK, "browse.gohtml", gin.H{
|
||||||
"CurrentPath": "/browse",
|
"CurrentPath": "/browse",
|
||||||
"Query": q,
|
"Query": q,
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ func (h *WatchlistHandler) HandleGetWatchlist(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
c.HTML(http.StatusOK, "watchlist.gohtml", gin.H{
|
c.HTML(http.StatusOK, "watchlist.gohtml", gin.H{
|
||||||
"Entries": entries,
|
"AllEntries": entries,
|
||||||
"CurrentPath": "/watchlist",
|
"CurrentPath": "/watchlist",
|
||||||
"User": user,
|
"User": user,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user