New filters for editors

This commit is contained in:
Eduard Urbach 2018-03-26 19:44:35 +02:00
parent 2e1604f0b2
commit 1066c72fea
7 changed files with 119 additions and 7 deletions

View File

@ -31,12 +31,25 @@ component EditorTabs(url string, user *arn.User)
if strings.Contains(url, "/editor/anime/")
.tabs
Tab("Mappings", "arrows-h", "/editor/anime/mapping/mal" + user.Settings().Editor.Filter.Suffix())
Tab("Synopsis", "align-left", "/editor/anime/synopsis" + user.Settings().Editor.Filter.Suffix())
Tab("Genres", "clone", "/editor/anime/genres" + user.Settings().Editor.Filter.Suffix())
Tab("Images", "image", "/editor/anime/image/lowres" + user.Settings().Editor.Filter.Suffix())
Tab("Start date", "calendar", "/editor/anime/startdate" + user.Settings().Editor.Filter.Suffix())
Tab("Companies", "building", "/editor/anime/companies/studios" + user.Settings().Editor.Filter.Suffix())
Tab("Details", "search-plus", "/editor/anime/details/genres" + user.Settings().Editor.Filter.Suffix())
Tab("TBA", "question-circle", "/editor/anime/tba" + 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())
Tab("Synopsis", "align-left", "/editor/anime/details/synopsis" + user.Settings().Editor.Filter.Suffix())
Tab("Start date", "calendar", "/editor/anime/details/startdate" + user.Settings().Editor.Filter.Suffix())
Tab("Ep. Length", "clock-o", "/editor/anime/details/episodelength" + user.Settings().Editor.Filter.Suffix())
Tab("Source", "book", "/editor/anime/details/source" + user.Settings().Editor.Filter.Suffix())
if strings.Contains(url, "/editor/anime/companies")
.tabs
Tab("Studios", "building", "/editor/anime/companies/studios" + user.Settings().Editor.Filter.Suffix())
Tab("Producers", "building", "/editor/anime/companies/producers" + user.Settings().Editor.Filter.Suffix())
Tab("Licensors", "building", "/editor/anime/companies/licensors" + user.Settings().Editor.Filter.Suffix())
if strings.Contains(url, "/editor/anime/mapping/")
.tabs
Tab("MAL", "arrows-h", "/editor/anime/mapping/mal" + user.Settings().Editor.Filter.Suffix())

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -254,17 +254,26 @@ func Configure(app *aero.Application) {
}
// Editor - Anime
editorFilterable("/editor/anime/synopsis", filteranime.Synopsis)
editorFilterable("/editor/anime/genres", filteranime.Genres)
editorFilterable("/editor/anime/startdate", filteranime.StartDate)
editorFilterable("/editor/anime/tba", filteranime.TBA)
editorFilterable("/editor/anime/mapping/shoboi", filteranime.Shoboi)
editorFilterable("/editor/anime/mapping/anilist", filteranime.AniList)
editorFilterable("/editor/anime/mapping/mal", filteranime.MAL)
editorFilterable("/editor/anime/mapping/duplicate", filteranime.DuplicateMappings)
editorFilterable("/editor/anime/image/lowres", filteranime.LowResolutionAnimeImages)
editorFilterable("/editor/anime/image/ultralowres", filteranime.UltraLowResolutionAnimeImages)
editorFilterable("/editor/anime/companies/studios", filteranime.Studios)
editorFilterable("/editor/anime/companies/producers", filteranime.Producers)
editorFilterable("/editor/anime/companies/licensors", filteranime.Licensors)
editorFilterable("/editor/anime/details/synopsis", filteranime.Synopsis)
editorFilterable("/editor/anime/details/genres", filteranime.Genres)
editorFilterable("/editor/anime/details/startdate", filteranime.StartDate)
editorFilterable("/editor/anime/details/episodelength", filteranime.EpisodeLength)
editorFilterable("/editor/anime/details/source", filteranime.Source)
editorFilterable("/editor/anime/tba", filteranime.TBA)
// Editor - MALdiff
editorFilterable("/editor/mal/diff/anime", editor.CompareMAL)