Reimplemented /genres page

This commit is contained in:
Eduard Urbach 2017-11-30 02:59:19 +01:00
parent 91b6ae7efd
commit d290e2d505
3 changed files with 13 additions and 13 deletions

View File

@ -11,8 +11,7 @@ func Get(ctx *aero.Context) string {
var genres []string
for _, genre := range arn.Genres {
// Skip this genre because it doesn't get processed in the background jobs
if genreName == "Hentai" {
if genre == "Hentai" {
continue
}

View File

@ -1,13 +1,13 @@
component Genres(genres []string)
//- h1.page-title Genres
h1 Genres
//- .genres
//- each genre in genres
//- a.genre.ajax(href="/genres/" + genre.ID)
//- .genre-text.front
//- .genre-icon
//- RawIcon(arn.GetGenreIcon(genre.Name))
//- span= genre.Name
.genres
each genre in genres
a.genre.ajax(href="/genre/" + strings.ToLower(genre))
.genre-text.front
.genre-icon
RawIcon(arn.GetGenreIcon(genre))
span= genre
//- if len(genre.AnimeList) > 0
//- img.genre-image.back(src=genre.AnimeList[0].Image, alt=genre.AnimeList[0].Title.Romaji, title=genre.AnimeList[0].Title.Romaji + "\n" + genre.Name + " #1")
//- if len(genre.AnimeList) > 0
//- img.genre-image.back(src=genre.AnimeList[0].Image, alt=genre.AnimeList[0].Title.Romaji, title=genre.AnimeList[0].Title.Romaji + "\n" + genre.Name + " #1")

View File

@ -24,6 +24,7 @@ import (
"github.com/animenotifier/notify.moe/pages/explore"
"github.com/animenotifier/notify.moe/pages/forum"
"github.com/animenotifier/notify.moe/pages/genre"
"github.com/animenotifier/notify.moe/pages/genres"
"github.com/animenotifier/notify.moe/pages/group"
"github.com/animenotifier/notify.moe/pages/groups"
"github.com/animenotifier/notify.moe/pages/home"
@ -202,6 +203,6 @@ func Configure(app *aero.Application) {
app.Post("/api/paypal/payment/create", paypal.CreatePayment)
// Genres
// l.Page("/genres", genres.Get)
l.Page("/genres", genres.Get)
l.Page("/genre/:name", genre.Get)
}