2018-03-14 19:13:20 +00:00
|
|
|
component AnimeList(animeListItems []*arn.AnimeListItem, nextIndex int, viewUser *arn.User, user *arn.User)
|
|
|
|
#load-more-target.anime-list
|
|
|
|
AnimeListScrollable(animeListItems, viewUser, user)
|
|
|
|
|
|
|
|
if nextIndex != -1
|
|
|
|
.buttons
|
|
|
|
LoadMore(nextIndex)
|
|
|
|
|
|
|
|
component AnimeListScrollable(animeListItems []*arn.AnimeListItem, viewUser *arn.User, user *arn.User)
|
|
|
|
each item in animeListItems
|
2018-11-12 10:48:54 +00:00
|
|
|
.anime-list-item.mountable(title=item.Notes, data-api="/api/animelist/" + viewUser.ID + "/field/Items[AnimeID=\"" + item.AnimeID + "\"]", draggable="true")
|
2018-03-14 19:13:20 +00:00
|
|
|
.anime-list-item-image-container
|
2018-03-23 20:33:19 +00:00
|
|
|
a.anime-list-item-image-link(href=item.Anime().Link())
|
2018-03-20 21:39:21 +00:00
|
|
|
img.anime-list-item-image.lazy(data-src=item.Anime().ImageLink("small"), data-webp="true", data-color=item.Anime().AverageColor(), alt=item.Anime().Title.ByUser(user))
|
2018-03-14 19:13:20 +00:00
|
|
|
|
|
|
|
.anime-list-item-name
|
2018-03-23 20:33:19 +00:00
|
|
|
a(href=item.Link(viewUser.Nick))= item.Anime().Title.ByUser(user)
|
2018-03-14 19:13:20 +00:00
|
|
|
|
|
|
|
.anime-list-item-actions
|
2019-08-29 03:23:58 +00:00
|
|
|
if user != nil && item.Status != arn.AnimeListStatusCompleted
|
2018-03-14 19:13:20 +00:00
|
|
|
if item.Anime().EpisodeByNumber(item.Episodes + 1) != nil
|
|
|
|
for _, link := range item.Anime().EpisodeByNumber(item.Episodes + 1).Links
|
2018-04-25 20:15:42 +00:00
|
|
|
a.tip(href=link, aria-label="Watch episode " + fmt.Sprint(item.Episodes + 1), target="_blank", rel="noopener")
|
2018-03-14 19:13:20 +00:00
|
|
|
RawIcon("eye")
|
|
|
|
|
|
|
|
.anime-list-item-airing-date
|
2019-08-29 03:23:58 +00:00
|
|
|
if item.Status != arn.AnimeListStatusCompleted && item.Anime().UpcomingEpisode() != nil
|
2018-03-14 19:13:20 +00:00
|
|
|
span.utc-airing-date(data-start-date=item.Anime().UpcomingEpisode().Episode.AiringDate.Start, data-end-date=item.Anime().UpcomingEpisode().Episode.AiringDate.End, data-episode-number=item.Anime().UpcomingEpisode().Episode.Number)
|
|
|
|
|
|
|
|
if item.Status != arn.AnimeListStatusCompleted
|
|
|
|
.anime-list-item-episodes
|
|
|
|
.anime-list-item-episodes-watched
|
|
|
|
.action(contenteditable=utils.SameUser(user, viewUser), data-field="Episodes", data-type="number", data-trigger="focusout", data-action="save")= item.Episodes
|
|
|
|
|
2018-03-14 19:50:32 +00:00
|
|
|
if item.Status == arn.AnimeListStatusWatching && user != nil && user.ID == viewUser.ID
|
2018-03-14 19:13:20 +00:00
|
|
|
.plus-episode.action(data-action="increaseEpisode", data-trigger="click") +
|
|
|
|
else
|
|
|
|
.plus-episode-dummy +
|
|
|
|
|
|
|
|
.anime-list-item-episodes-separator /
|
|
|
|
.anime-list-item-episodes-max= item.Anime().EpisodeCountString()
|
|
|
|
|
2018-04-18 14:52:14 +00:00
|
|
|
.anime-list-item-rating.tip(aria-label="O: " + utils.FormatRating(item.Rating.Overall) + " | S: " + utils.FormatRating(item.Rating.Story) + " | V: " + utils.FormatRating(item.Rating.Visuals) + " | M: " + utils.FormatRating(item.Rating.Soundtrack))
|
2018-03-14 19:13:20 +00:00
|
|
|
.action(contenteditable=utils.SameUser(user, viewUser), data-field="Rating.Overall", data-type="number", data-trigger="focusout", data-action="save")= utils.FormatRating(item.Rating.Overall)
|