Editors can now add anime from scratch

This commit is contained in:
2019-10-16 14:44:53 +09:00
parent 5ec435cf99
commit 75c03c7bdc
9 changed files with 180 additions and 62 deletions

View File

@ -60,6 +60,10 @@ func filterAnime(year, season, status, typ string) []*arn.Anime {
results := make([]*arn.Anime, 0, 1024)
for anime := range arn.StreamAnime() {
if anime.IsDraft {
continue
}
if year != "any" {
if len(anime.StartDate) < 4 {
continue

View File

@ -29,6 +29,17 @@ component ExploreAnime(animes []*arn.Anime, year string, season string, status s
p.no-data.mountable No anime found using the above filters.
else
AnimeGrid(animes, user)
if user != nil && (user.Role == "editor" || user.Role == "admin")
.buttons
if user.DraftIndex().AnimeID == ""
button.mountable.action(data-action="newObject", data-trigger="click", data-type="anime")
Icon("plus")
span Add anime
else
a.button.mountable(href="/anime/" + user.DraftIndex().AnimeID + "/edit")
Icon("pencil")
span Edit draft
component ExploreFilters(year string, season string, status string, typ string, advancedFilters bool)
.explore-filters