Airing page
This commit is contained in:
29
pages/airing/airing.go
Normal file
29
pages/airing/airing.go
Normal file
@ -0,0 +1,29 @@
|
||||
package airing
|
||||
|
||||
import (
|
||||
"sort"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
)
|
||||
|
||||
// Get ...
|
||||
func Get(ctx *aero.Context) string {
|
||||
var animeList []*arn.Anime
|
||||
|
||||
scan := make(chan *arn.Anime)
|
||||
arn.Scan("Anime", scan)
|
||||
|
||||
for anime := range scan {
|
||||
if anime.AiringStatus != "currently airing" || anime.Adult {
|
||||
continue
|
||||
}
|
||||
|
||||
animeList = append(animeList, anime)
|
||||
}
|
||||
|
||||
sort.Sort(arn.AnimeByPopularity(animeList))
|
||||
|
||||
return ctx.HTML(components.Airing(animeList))
|
||||
}
|
3
pages/airing/airing.pixy
Normal file
3
pages/airing/airing.pixy
Normal file
@ -0,0 +1,3 @@
|
||||
component Airing(animeList []*arn.Anime)
|
||||
h2 Airing
|
||||
AnimeGrid(animeList)
|
@ -1,6 +1,3 @@
|
||||
component Genre(genre *arn.Genre)
|
||||
h2= arn.Capitalize(genre.ID)
|
||||
.grid
|
||||
each anime in genre.AnimeList
|
||||
a.grid-cell.grid-anime.ajax(href="/anime/" + toString(anime.ID))
|
||||
img.anime-image.grid-image(src=anime.Image, alt=anime.Title.Romaji, title=anime.Title.Romaji + " (" + toString(anime.Watching) + ")")
|
||||
AnimeGrid(genre.AnimeList)
|
Reference in New Issue
Block a user