Added record count info to editor lists
This commit is contained in:
parent
1690f0087c
commit
0c3ab006e7
@ -1,3 +1,9 @@
|
|||||||
|
component AnimeEditorListFull(title string, missing []*arn.Anime, count int, generateSearchLink func(*arn.Anime) string)
|
||||||
|
EditorTabs
|
||||||
|
h1.editor-list-title.mountable= title
|
||||||
|
.footer.editor-list-entry-count.mountable= strconv.Itoa(count) + " anime"
|
||||||
|
AnimeEditorList(missing, generateSearchLink)
|
||||||
|
|
||||||
component AnimeEditorList(animes []*arn.Anime, generateSearchLink func(*arn.Anime) string)
|
component AnimeEditorList(animes []*arn.Anime, generateSearchLink func(*arn.Anime) string)
|
||||||
table
|
table
|
||||||
thead
|
thead
|
||||||
|
@ -30,11 +30,18 @@ func AniList(ctx *aero.Context) string {
|
|||||||
return aPop > bPop
|
return aPop > bPop
|
||||||
})
|
})
|
||||||
|
|
||||||
if len(missing) > maxAniListEntries {
|
count := len(missing)
|
||||||
|
|
||||||
|
if count > maxAniListEntries {
|
||||||
missing = missing[:maxAniListEntries]
|
missing = missing[:maxAniListEntries]
|
||||||
}
|
}
|
||||||
|
|
||||||
return ctx.HTML(components.AniListMissingMapping(missing, func(anime *arn.Anime) string {
|
return ctx.HTML(components.AnimeEditorListFull(
|
||||||
return "https://anilist.co/search?type=anime&q=" + anime.Title.Canonical
|
"Anime without Anilist links",
|
||||||
}))
|
missing,
|
||||||
|
count,
|
||||||
|
func(anime *arn.Anime) string {
|
||||||
|
return "https://anilist.co/search?type=anime&q=" + anime.Title.Canonical
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
component AniListMissingMapping(missing []*arn.Anime, generateSearchLink func(*arn.Anime) string)
|
|
||||||
EditorTabs
|
|
||||||
h1.mountable Anime without Anilist links
|
|
||||||
AnimeEditorList(missing, generateSearchLink)
|
|
5
pages/editor/editor.scarlet
Normal file
5
pages/editor/editor.scarlet
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
.editor-list-title
|
||||||
|
margin-bottom 0
|
||||||
|
|
||||||
|
.editor-list-entry-count
|
||||||
|
margin-top 0
|
@ -30,9 +30,16 @@ func Genres(ctx *aero.Context) string {
|
|||||||
return aPop > bPop
|
return aPop > bPop
|
||||||
})
|
})
|
||||||
|
|
||||||
if len(missing) > maxGenreEntries {
|
count := len(missing)
|
||||||
|
|
||||||
|
if count > maxGenreEntries {
|
||||||
missing = missing[:maxGenreEntries]
|
missing = missing[:maxGenreEntries]
|
||||||
}
|
}
|
||||||
|
|
||||||
return ctx.HTML(components.AnimeWithoutGenres(missing, nil))
|
return ctx.HTML(components.AnimeEditorListFull(
|
||||||
|
"Anime without genres",
|
||||||
|
missing,
|
||||||
|
count,
|
||||||
|
nil,
|
||||||
|
))
|
||||||
}
|
}
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
component AnimeWithoutGenres(missing []*arn.Anime, generateSearchLink func(*arn.Anime) string)
|
|
||||||
EditorTabs
|
|
||||||
h1.mountable Anime without genres
|
|
||||||
AnimeEditorList(missing, generateSearchLink)
|
|
@ -30,11 +30,18 @@ func Shoboi(ctx *aero.Context) string {
|
|||||||
return aPop > bPop
|
return aPop > bPop
|
||||||
})
|
})
|
||||||
|
|
||||||
if len(missing) > maxShoboiEntries {
|
count := len(missing)
|
||||||
|
|
||||||
|
if count > maxShoboiEntries {
|
||||||
missing = missing[:maxShoboiEntries]
|
missing = missing[:maxShoboiEntries]
|
||||||
}
|
}
|
||||||
|
|
||||||
return ctx.HTML(components.ShoboiMissingMapping(missing, func(anime *arn.Anime) string {
|
return ctx.HTML(components.AnimeEditorListFull(
|
||||||
return "http://cal.syoboi.jp/find?type=quick&sd=1&kw=" + anime.Title.Japanese
|
"Anime without Shoboi links",
|
||||||
}))
|
missing,
|
||||||
|
count,
|
||||||
|
func(anime *arn.Anime) string {
|
||||||
|
return "http://cal.syoboi.jp/find?type=quick&sd=1&kw=" + anime.Title.Japanese
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
component ShoboiMissingMapping(missing []*arn.Anime, generateSearchLink func(*arn.Anime) string)
|
|
||||||
EditorTabs
|
|
||||||
h1.mountable Anime without Shoboi links
|
|
||||||
AnimeEditorList(missing, generateSearchLink)
|
|
Loading…
Reference in New Issue
Block a user