Editor page

This commit is contained in:
2017-07-08 21:11:03 +02:00
parent 0be7eca8cd
commit 7579c52188
7 changed files with 74 additions and 21 deletions

27
pages/editor/editor.go Normal file
View File

@ -0,0 +1,27 @@
package editor
import (
"net/http"
"sort"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
)
// Get ...
func Get(ctx *aero.Context) string {
missing, err := arn.FilterAnime(func(anime *arn.Anime) bool {
return anime.GetMapping("anilist/anime") == ""
})
if err != nil {
ctx.Error(http.StatusInternalServerError, "Couldn't filter anime", err)
}
sort.Slice(missing, func(i, j int) bool {
return missing[i].StartDate > missing[j].StartDate
})
return ctx.HTML(components.AniListMissingMapping(missing))
}