Added filters to editor lists
This commit is contained in:
parent
0c3ab006e7
commit
af6bc391af
@ -1,10 +1,10 @@
|
|||||||
component AnimeEditorListFull(title string, missing []*arn.Anime, count int, generateSearchLink func(*arn.Anime) string)
|
component AnimeEditorListFull(title string, missing []*arn.Anime, count int, pageURI string, generateSearchLink func(*arn.Anime) string)
|
||||||
EditorTabs
|
EditorTabs
|
||||||
h1.editor-list-title.mountable= title
|
h1.editor-list-title.mountable= title
|
||||||
.footer.editor-list-entry-count.mountable= strconv.Itoa(count) + " anime"
|
.footer.editor-list-entry-count.mountable= strconv.Itoa(count) + " anime"
|
||||||
AnimeEditorList(missing, generateSearchLink)
|
AnimeEditorList(missing, pageURI, generateSearchLink)
|
||||||
|
|
||||||
component AnimeEditorList(animes []*arn.Anime, generateSearchLink func(*arn.Anime) string)
|
component AnimeEditorList(animes []*arn.Anime, pageURI string, generateSearchLink func(*arn.Anime) string)
|
||||||
table
|
table
|
||||||
thead
|
thead
|
||||||
tr.mountable
|
tr.mountable
|
||||||
@ -24,7 +24,7 @@ component AnimeEditorList(animes []*arn.Anime, generateSearchLink func(*arn.Anim
|
|||||||
td= anime.Type
|
td= anime.Type
|
||||||
td
|
td
|
||||||
if len(anime.StartDate) >= 4
|
if len(anime.StartDate) >= 4
|
||||||
span= anime.StartDate[:4]
|
a.ajax(href=pageURI + "/" + anime.StartDate[:4])= anime.StartDate[:4]
|
||||||
|
|
||||||
if generateSearchLink != nil
|
if generateSearchLink != nil
|
||||||
td
|
td
|
||||||
|
@ -12,7 +12,18 @@ const maxAniListEntries = 70
|
|||||||
|
|
||||||
// AniList ...
|
// AniList ...
|
||||||
func AniList(ctx *aero.Context) string {
|
func AniList(ctx *aero.Context) string {
|
||||||
|
year, _ := ctx.GetInt("year")
|
||||||
|
animeType := ctx.Get("type")
|
||||||
|
|
||||||
missing := arn.FilterAnime(func(anime *arn.Anime) bool {
|
missing := arn.FilterAnime(func(anime *arn.Anime) bool {
|
||||||
|
if year != 0 && year != anime.StartDateTime().Year() {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if animeType != "" && anime.Type != animeType {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
return anime.GetMapping("anilist/anime") == ""
|
return anime.GetMapping("anilist/anime") == ""
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -40,6 +51,7 @@ func AniList(ctx *aero.Context) string {
|
|||||||
"Anime without Anilist links",
|
"Anime without Anilist links",
|
||||||
missing,
|
missing,
|
||||||
count,
|
count,
|
||||||
|
"/editor/anilist",
|
||||||
func(anime *arn.Anime) string {
|
func(anime *arn.Anime) string {
|
||||||
return "https://anilist.co/search?type=anime&q=" + anime.Title.Canonical
|
return "https://anilist.co/search?type=anime&q=" + anime.Title.Canonical
|
||||||
},
|
},
|
||||||
|
@ -12,7 +12,18 @@ const maxGenreEntries = 70
|
|||||||
|
|
||||||
// Genres ...
|
// Genres ...
|
||||||
func Genres(ctx *aero.Context) string {
|
func Genres(ctx *aero.Context) string {
|
||||||
|
year, _ := ctx.GetInt("year")
|
||||||
|
animeType := ctx.Get("type")
|
||||||
|
|
||||||
missing := arn.FilterAnime(func(anime *arn.Anime) bool {
|
missing := arn.FilterAnime(func(anime *arn.Anime) bool {
|
||||||
|
if year != 0 && year != anime.StartDateTime().Year() {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if animeType != "" && anime.Type != animeType {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
return len(anime.Genres) == 0
|
return len(anime.Genres) == 0
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -40,6 +51,7 @@ func Genres(ctx *aero.Context) string {
|
|||||||
"Anime without genres",
|
"Anime without genres",
|
||||||
missing,
|
missing,
|
||||||
count,
|
count,
|
||||||
|
"/editor/genres",
|
||||||
nil,
|
nil,
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,18 @@ const maxShoboiEntries = 70
|
|||||||
|
|
||||||
// Shoboi ...
|
// Shoboi ...
|
||||||
func Shoboi(ctx *aero.Context) string {
|
func Shoboi(ctx *aero.Context) string {
|
||||||
|
year, _ := ctx.GetInt("year")
|
||||||
|
animeType := ctx.Get("type")
|
||||||
|
|
||||||
missing := arn.FilterAnime(func(anime *arn.Anime) bool {
|
missing := arn.FilterAnime(func(anime *arn.Anime) bool {
|
||||||
|
if year != 0 && year != anime.StartDateTime().Year() {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if animeType != "" && anime.Type != animeType {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
return anime.GetMapping("shoboi/anime") == ""
|
return anime.GetMapping("shoboi/anime") == ""
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -40,6 +51,7 @@ func Shoboi(ctx *aero.Context) string {
|
|||||||
"Anime without Shoboi links",
|
"Anime without Shoboi links",
|
||||||
missing,
|
missing,
|
||||||
count,
|
count,
|
||||||
|
"/editor/shoboi",
|
||||||
func(anime *arn.Anime) string {
|
func(anime *arn.Anime) string {
|
||||||
return "http://cal.syoboi.jp/find?type=quick&sd=1&kw=" + anime.Title.Japanese
|
return "http://cal.syoboi.jp/find?type=quick&sd=1&kw=" + anime.Title.Japanese
|
||||||
},
|
},
|
||||||
|
@ -200,8 +200,14 @@ func Configure(app *aero.Application) {
|
|||||||
// Editor
|
// Editor
|
||||||
l.Page("/editor", editor.Get)
|
l.Page("/editor", editor.Get)
|
||||||
l.Page("/editor/anilist", editor.AniList)
|
l.Page("/editor/anilist", editor.AniList)
|
||||||
|
l.Page("/editor/anilist/:year", editor.AniList)
|
||||||
|
l.Page("/editor/anilist/:year/:type", editor.AniList)
|
||||||
l.Page("/editor/shoboi", editor.Shoboi)
|
l.Page("/editor/shoboi", editor.Shoboi)
|
||||||
|
l.Page("/editor/shoboi/:year", editor.Shoboi)
|
||||||
|
l.Page("/editor/shoboi/:year/:type", editor.Shoboi)
|
||||||
l.Page("/editor/genres", editor.Genres)
|
l.Page("/editor/genres", editor.Genres)
|
||||||
|
l.Page("/editor/genres/:year", editor.Genres)
|
||||||
|
l.Page("/editor/genres/:year/:type", editor.Genres)
|
||||||
|
|
||||||
// Mixed
|
// Mixed
|
||||||
l.Page("/database", database.Get)
|
l.Page("/database", database.Get)
|
||||||
|
Loading…
Reference in New Issue
Block a user