2018-03-21 22:18:08 +00:00
|
|
|
component AnimeGrid(animes []*arn.Anime, user *arn.User)
|
|
|
|
#load-more-target.anime-grid
|
|
|
|
AnimeGridScrollable(animes, user)
|
|
|
|
|
2018-03-26 21:38:15 +00:00
|
|
|
component AnimeGridWithRelation(entries []*utils.AnimeWithRelatedAnime, user *arn.User)
|
|
|
|
#load-more-target.anime-grid
|
|
|
|
AnimeGridWithRelationScrollable(entries, user)
|
|
|
|
|
2018-03-21 22:18:08 +00:00
|
|
|
component AnimeGridScrollable(animes []*arn.Anime, user *arn.User)
|
|
|
|
each anime in animes
|
|
|
|
.anime-grid-cell(data-added=(user != nil && user.AnimeList().Contains(anime.ID)))
|
2018-03-27 19:08:26 +00:00
|
|
|
AnimeImageLink(anime, "medium", user)
|
2018-03-26 21:38:15 +00:00
|
|
|
AnimeGridButton(anime, user)
|
|
|
|
|
2018-03-27 19:08:26 +00:00
|
|
|
component AnimeImageLink(anime *arn.Anime, size string, user *arn.User)
|
|
|
|
a(href="/anime/" + anime.ID)
|
|
|
|
img.anime-grid-image.lazy(data-src=anime.ImageLink(size), data-webp="true", data-color=anime.AverageColor(), alt=anime.Title.Romaji)
|
2018-04-11 21:32:59 +00:00
|
|
|
.image-title
|
|
|
|
.image-title-text= anime.Title.ByUser(user)
|
2018-03-27 19:08:26 +00:00
|
|
|
|
2018-03-26 21:38:15 +00:00
|
|
|
component AnimeGridWithRelationScrollable(entries []*utils.AnimeWithRelatedAnime, user *arn.User)
|
|
|
|
each entry in entries
|
|
|
|
.anime-grid-cell(data-added=(user != nil && user.AnimeList().Contains(entry.Anime.ID)))
|
|
|
|
a(href="/anime/" + entry.Anime.ID)
|
|
|
|
img.anime-grid-image.lazy(data-src=entry.Anime.ImageLink("medium"), data-webp="true", data-color=entry.Anime.AverageColor(), alt=entry.Anime.Title.Romaji)
|
2018-04-11 21:32:59 +00:00
|
|
|
.image-title
|
|
|
|
.image-title-text= entry.Anime.Title.ByUser(user)
|
2018-03-26 21:38:15 +00:00
|
|
|
|
|
|
|
AnimeGridButton(entry.Anime, user)
|
|
|
|
|
|
|
|
component AnimeGridButton(anime *arn.Anime, user *arn.User)
|
|
|
|
if user != nil && !user.AnimeList().Contains(anime.ID)
|
|
|
|
button.anime-grid-add-button.action(data-action="addAnimeToCollection", data-trigger="click", data-api="/api/animelist/" + user.ID, data-anime-id=anime.ID)
|
|
|
|
RawIcon("plus")
|