From 84bb8fc2b84c51e34347944157a030a068793274 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Fri, 6 Apr 2018 00:37:10 +0200 Subject: [PATCH] Added editor list for trailers --- pages/editor/editor.pixy | 1 + pages/editor/filteranime/trailers.go | 18 ++++++++++++++++++ pages/index.go | 1 + 3 files changed, 20 insertions(+) create mode 100644 pages/editor/filteranime/trailers.go diff --git a/pages/editor/editor.pixy b/pages/editor/editor.pixy index 3372cf10..93c9f856 100644 --- a/pages/editor/editor.pixy +++ b/pages/editor/editor.pixy @@ -40,6 +40,7 @@ component EditorTabs(url string, user *arn.User) .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("Trailers", "youtube", "/editor/anime/details/trailers" + 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()) diff --git a/pages/editor/filteranime/trailers.go b/pages/editor/filteranime/trailers.go new file mode 100644 index 00000000..bd55063c --- /dev/null +++ b/pages/editor/filteranime/trailers.go @@ -0,0 +1,18 @@ +package filteranime + +import ( + "github.com/aerogo/aero" + "github.com/animenotifier/arn" +) + +// Trailers ... +func Trailers(ctx *aero.Context) string { + return editorList( + ctx, + "Anime without trailers", + func(anime *arn.Anime) bool { + return len(anime.Trailers) == 0 + }, + nil, + ) +} diff --git a/pages/index.go b/pages/index.go index af9a0ea5..55b82358 100644 --- a/pages/index.go +++ b/pages/index.go @@ -286,6 +286,7 @@ func Configure(app *aero.Application) { editorFilterable("/editor/anime/details/synopsis", filteranime.Synopsis) editorFilterable("/editor/anime/details/genres", filteranime.Genres) + editorFilterable("/editor/anime/details/trailers", filteranime.Trailers) editorFilterable("/editor/anime/details/startdate", filteranime.StartDate) editorFilterable("/editor/anime/details/episodelength", filteranime.EpisodeLength) editorFilterable("/editor/anime/details/source", filteranime.Source)