Implemented new frontpage

This commit is contained in:
2017-09-22 17:23:22 +02:00
parent 9c900ec01b
commit 4ce0bed52c
7 changed files with 70 additions and 30 deletions

@ -1,10 +1,9 @@
package home
import (
"net/http"
"github.com/animenotifier/arn"
"github.com/aerogo/aero"
"github.com/animenotifier/notify.moe/components"
"github.com/animenotifier/notify.moe/pages/frontpage"
"github.com/animenotifier/notify.moe/utils"
)
@ -17,15 +16,5 @@ func Get(ctx *aero.Context) string {
return frontpage.Get(ctx)
}
viewUser := user
animeList := viewUser.AnimeList()
if animeList == nil {
return ctx.Error(http.StatusNotFound, "Anime list not found", nil)
}
animeList.PrefetchAnime()
animeList.Sort()
return ctx.HTML(components.Home(animeList.Watching(), animeList.User(), user, "watching"))
return AnimeList(ctx, user, arn.AnimeListStatusWatching)
}