From 5b77fa98cc4747a949fcd74e810e59d680248a9a Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sun, 8 Apr 2018 10:55:17 +0200 Subject: [PATCH] Added new editor lists for anime --- pages/editor/editor.pixy | 14 ++++++-------- pages/editor/filteranime/characters.go | 18 ++++++++++++++++++ pages/editor/filteranime/relations.go | 20 ++++++++++++++++++++ pages/index.go | 3 +++ 4 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 pages/editor/filteranime/characters.go create mode 100644 pages/editor/filteranime/relations.go diff --git a/pages/editor/editor.pixy b/pages/editor/editor.pixy index c572ff0c..4a44095d 100644 --- a/pages/editor/editor.pixy +++ b/pages/editor/editor.pixy @@ -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()) diff --git a/pages/editor/filteranime/characters.go b/pages/editor/filteranime/characters.go new file mode 100644 index 00000000..a1a7e98a --- /dev/null +++ b/pages/editor/filteranime/characters.go @@ -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, + ) +} diff --git a/pages/editor/filteranime/relations.go b/pages/editor/filteranime/relations.go new file mode 100644 index 00000000..80f9d74c --- /dev/null +++ b/pages/editor/filteranime/relations.go @@ -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 + }, + ) +} diff --git a/pages/index.go b/pages/index.go index a00b810e..aabd558b 100644 --- a/pages/index.go +++ b/pages/index.go @@ -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)