Editor page
This commit is contained in:
27
pages/editor/editor.go
Normal file
27
pages/editor/editor.go
Normal 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))
|
||||
}
|
14
pages/editor/editor.pixy
Normal file
14
pages/editor/editor.pixy
Normal file
@ -0,0 +1,14 @@
|
||||
component AniListMissingMapping(missing []*arn.Anime)
|
||||
h1 Anime without Anilist links
|
||||
|
||||
table
|
||||
tbody
|
||||
each anime in missing
|
||||
tr
|
||||
td
|
||||
if len(anime.StartDate) >= 4
|
||||
span= anime.StartDate[:4]
|
||||
td
|
||||
a(href=anime.Link(), target="_blank", rel="noopener")= anime.Title.Canonical
|
||||
td
|
||||
a(href="https://anilist.co/search?type=anime&q=" + anime.Title.Canonical, target="_blank", rel="noopener") Search
|
Reference in New Issue
Block a user