Advanced filters for editors
This commit is contained in:
parent
39e445bf71
commit
94adad1fd8
@ -33,8 +33,9 @@ component EditorTabs(url string, user *arn.User)
|
||||
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("Start date", "calendar", "/editor/anime/startdate" + 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("TBA", "question-circle", "/editor/anime/tba" + user.Settings().Editor.Filter.Suffix())
|
||||
|
||||
if strings.Contains(url, "/editor/anime/mapping/")
|
||||
.tabs
|
||||
|
@ -5,8 +5,6 @@ import (
|
||||
"github.com/animenotifier/arn"
|
||||
)
|
||||
|
||||
const maxGenreEntries = 70
|
||||
|
||||
// Genres ...
|
||||
func Genres(ctx *aero.Context) string {
|
||||
return editorList(
|
||||
|
@ -5,8 +5,6 @@ import (
|
||||
"github.com/animenotifier/arn"
|
||||
)
|
||||
|
||||
const maxImageEntries = 70
|
||||
|
||||
// LowResolutionAnimeImages filters anime with low resolution images.
|
||||
func LowResolutionAnimeImages(ctx *aero.Context) string {
|
||||
return filterAnimeImages(ctx, "Anime with low resolution images", arn.AnimeImageLargeWidth, arn.AnimeImageLargeHeight)
|
||||
|
@ -5,8 +5,6 @@ import (
|
||||
"github.com/animenotifier/arn"
|
||||
)
|
||||
|
||||
const maxShoboiEntries = 70
|
||||
|
||||
// Shoboi ...
|
||||
func Shoboi(ctx *aero.Context) string {
|
||||
return editorList(
|
||||
|
20
pages/editor/filteranime/tba.go
Normal file
20
pages/editor/filteranime/tba.go
Normal file
@ -0,0 +1,20 @@
|
||||
package filteranime
|
||||
|
||||
import (
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
)
|
||||
|
||||
// TBA ...
|
||||
func TBA(ctx *aero.Context) string {
|
||||
return editorList(
|
||||
ctx,
|
||||
"Anime to be announced",
|
||||
func(anime *arn.Anime) bool {
|
||||
return anime.Status == "tba"
|
||||
},
|
||||
func(anime *arn.Anime) string {
|
||||
return "https://www.google.com/search?q=" + anime.Title.Canonical
|
||||
},
|
||||
)
|
||||
}
|
@ -21,29 +21,35 @@ component ExploreAnime(animeList []*arn.Anime, year string, status string, typ s
|
||||
else
|
||||
AnimeGrid(animeList, user)
|
||||
|
||||
component ExploreFilters(year string, status string, typ string, allowAny bool)
|
||||
component ExploreFilters(year string, status string, typ string, advancedFilters bool)
|
||||
.explore-filters
|
||||
select#filter-year.action(value=year, data-action="filterAnime", data-trigger="change")
|
||||
if allowAny
|
||||
if advancedFilters
|
||||
option(value="")
|
||||
|
||||
for year := time.Now().Year()+1; year >= 1951; year--
|
||||
option(value=year)= year
|
||||
|
||||
select#filter-status.action(value=status, data-action="filterAnime", data-trigger="change")
|
||||
if allowAny
|
||||
if advancedFilters
|
||||
option(value="")
|
||||
|
||||
option(value="current") Current
|
||||
option(value="upcoming") Upcoming
|
||||
option(value="finished") Finished
|
||||
|
||||
if advancedFilters
|
||||
option(value="tba") TBA
|
||||
|
||||
select#filter-type.action(value=typ, data-action="filterAnime", data-trigger="change")
|
||||
if allowAny
|
||||
if advancedFilters
|
||||
option(value="")
|
||||
|
||||
option(value="tv") TV
|
||||
option(value="movie") Movie
|
||||
option(value="ova") OVA
|
||||
option(value="ona") ONA
|
||||
option(value="special") Special
|
||||
option(value="special") Special
|
||||
|
||||
if advancedFilters
|
||||
option(value="music") Music
|
@ -257,6 +257,7 @@ func Configure(app *aero.Application) {
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user