Added new editor lists for anime

This commit is contained in:
Eduard Urbach 2018-04-08 10:55:17 +02:00
parent bb26e12f86
commit 5b77fa98cc
4 changed files with 47 additions and 8 deletions

View File

@ -28,14 +28,6 @@ component Editor(url string, score int, scoreTitle string, scoreTypes map[string
a.footer-element(href="/editor/kitsu/new/anime") Kitsu
component EditorTabs(url string, user *arn.User)
//- .tabs
//- Tab("Editor", "pencil", "/editor")
//- Tab("MAL", "exchange", "/editor/mal/diff/anime" + user.Settings().Editor.Filter.Suffix())
//- Tab("Anime", "tv", "/editor/anime/mapping/mal" + user.Settings().Editor.Filter.Suffix())
//- Tab("Tracks", "music", "/editor/soundtracks/links")
//- Tab("Companies", "building", "/editor/companies/description")
//- Tab("Kitsu", "download", "/editor/kitsu/new/anime")
.corner-buttons-left
a.button(href="/editor")
Icon("arrow-left")
@ -47,8 +39,14 @@ component EditorTabs(url string, user *arn.User)
Tab("Mappings", "arrows-h", "/editor/anime/mapping/mal" + user.Settings().Editor.Filter.Suffix())
Tab("Images", "image", "/editor/anime/image/lowres" + user.Settings().Editor.Filter.Suffix())
Tab("Companies", "building", "/editor/anime/companies/studios" + user.Settings().Editor.Filter.Suffix())
Tab("Connections", "exchange", "/editor/anime/connections/relations" + user.Settings().Editor.Filter.Suffix())
Tab("Details", "search-plus", "/editor/anime/details/genres" + user.Settings().Editor.Filter.Suffix())
if strings.Contains(url, "/editor/anime/connections")
.tabs
Tab("Relations", "exchange", "/editor/anime/connections/relations" + user.Settings().Editor.Filter.Suffix())
Tab("Characters", "users", "/editor/anime/connections/characters" + user.Settings().Editor.Filter.Suffix())
if strings.Contains(url, "/editor/anime/details")
.tabs
Tab("Genres", "clone", "/editor/anime/details/genres" + user.Settings().Editor.Filter.Suffix())

View File

@ -0,0 +1,18 @@
package filteranime
import (
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
)
// Characters ...
func Characters(ctx *aero.Context) string {
return editorList(
ctx,
"Anime without characters",
func(anime *arn.Anime) bool {
return len(anime.Characters().Items) == 0
},
nil,
)
}

View File

@ -0,0 +1,20 @@
package filteranime
import (
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
)
// Relations ...
func Relations(ctx *aero.Context) string {
return editorList(
ctx,
"Anime without relations",
func(anime *arn.Anime) bool {
return len(anime.Relations().Items) == 0
},
func(anime *arn.Anime) string {
return "http://notify.moe/search/" + anime.Title.Canonical
},
)
}

View File

@ -284,6 +284,9 @@ func Configure(app *aero.Application) {
editorFilterable("/editor/anime/companies/producers", filteranime.Producers)
editorFilterable("/editor/anime/companies/licensors", filteranime.Licensors)
editorFilterable("/editor/anime/connections/relations", filteranime.Relations)
editorFilterable("/editor/anime/connections/characters", filteranime.Characters)
editorFilterable("/editor/anime/details/synopsis", filteranime.Synopsis)
editorFilterable("/editor/anime/details/genres", filteranime.Genres)
editorFilterable("/editor/anime/details/trailers", filteranime.Trailers)