2017-11-12 10:18:16 +00:00
|
|
|
component AnimeGrid(animeList []*arn.Anime, user *arn.User)
|
2016-11-29 15:50:50 +00:00
|
|
|
.anime-grid
|
2016-11-23 03:44:28 +00:00
|
|
|
each anime in animeList
|
2017-12-02 20:06:15 +00:00
|
|
|
.anime-grid-cell(data-added=(user != nil && user.AnimeList().Contains(anime.ID)))
|
2017-11-28 22:40:53 +00:00
|
|
|
a.ajax(href="/anime/" + toString(anime.ID))
|
2018-03-20 21:39:21 +00:00
|
|
|
img.anime-grid-image.lazy(data-src=anime.ImageLink("medium"), data-webp="true", data-color=anime.AverageColor(), alt=anime.Title.Romaji)
|
2017-11-28 22:40:53 +00:00
|
|
|
.anime-grid-title
|
|
|
|
.anime-grid-title-text= anime.Title.ByUser(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")
|