Sequels page is now linked on profiles
This commit is contained in:
@ -19,10 +19,6 @@ component ExploreAnime(animes []*arn.Anime, year string, season string, status s
|
||||
a.button(href="/genres", title="View genres")
|
||||
RawIcon("clone")
|
||||
|
||||
if user != nil
|
||||
a.button(href="/explore/sequels", title="View sequels of my completed anime")
|
||||
RawIcon("forward")
|
||||
|
||||
a.button(href="/explore/color/any/anime", title="View colors")
|
||||
RawIcon("paint-brush")
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
component ExploreAnimeSequels(entries []*utils.AnimeWithRelatedAnime, user *arn.User)
|
||||
component ExploreAnimeSequels(entries []*utils.AnimeWithRelatedAnime, viewUser *arn.User, user *arn.User)
|
||||
h1 Sequels of my completed anime
|
||||
|
||||
.explore-anime
|
||||
|
@ -13,13 +13,20 @@ import (
|
||||
|
||||
// Sequels ...
|
||||
func Sequels(ctx *aero.Context) string {
|
||||
nick := ctx.Get("nick")
|
||||
user := utils.GetUser(ctx)
|
||||
|
||||
if user == nil {
|
||||
return ctx.Error(http.StatusUnauthorized, "Not logged in")
|
||||
}
|
||||
|
||||
animeList := user.AnimeList()
|
||||
viewUser, err := arn.GetUserByNick(nick)
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusNotFound, "User not found", err)
|
||||
}
|
||||
|
||||
animeList := viewUser.AnimeList()
|
||||
sequels := []*utils.AnimeWithRelatedAnime{}
|
||||
|
||||
for anime := range arn.StreamAnime() {
|
||||
@ -56,5 +63,5 @@ func Sequels(ctx *aero.Context) string {
|
||||
return aScore > bScore
|
||||
})
|
||||
|
||||
return ctx.HTML(components.ExploreAnimeSequels(sequels, user))
|
||||
return ctx.HTML(components.ExploreAnimeSequels(sequels, viewUser, user))
|
||||
}
|
||||
|
Reference in New Issue
Block a user