2017-07-22 13:04:54 +00:00
|
|
|
component ProfileAnimeLists(animeLists map[string]*arn.AnimeList, viewUser *arn.User, user *arn.User, uri string)
|
2017-07-06 01:24:56 +00:00
|
|
|
ProfileHeader(viewUser, user, uri)
|
2017-06-29 21:27:21 +00:00
|
|
|
|
2017-07-06 20:23:32 +00:00
|
|
|
h1.page-title.anime-list-owner= viewUser.Nick + "'s collection"
|
2017-06-29 21:27:21 +00:00
|
|
|
|
2017-07-22 13:04:54 +00:00
|
|
|
AnimeLists(animeLists, viewUser, user)
|
|
|
|
|
|
|
|
//- for status, animeList := range animeLists
|
|
|
|
//- h3= status
|
|
|
|
//- AnimeList(animeList, user)
|
|
|
|
|
|
|
|
component AnimeLists(animeLists map[string]*arn.AnimeList, viewUser *arn.User, user *arn.User)
|
2017-07-03 15:21:00 +00:00
|
|
|
if len(animeLists[arn.AnimeListStatusWatching].Items) == 0 && len(animeLists[arn.AnimeListStatusCompleted].Items) == 0 && len(animeLists[arn.AnimeListStatusPlanned].Items) == 0 && len(animeLists[arn.AnimeListStatusHold].Items) == 0 && len(animeLists[arn.AnimeListStatusDropped].Items) == 0
|
2017-07-03 15:33:57 +00:00
|
|
|
p.no-data.mountable= viewUser.Nick + " hasn't added any anime yet."
|
2017-07-03 15:21:00 +00:00
|
|
|
else
|
|
|
|
if len(animeLists[arn.AnimeListStatusWatching].Items) > 0
|
|
|
|
.anime-list-container
|
|
|
|
h3.status-name Watching
|
|
|
|
AnimeList(animeLists[arn.AnimeListStatusWatching], viewUser, user)
|
2017-06-29 21:27:21 +00:00
|
|
|
|
2017-07-03 15:21:00 +00:00
|
|
|
if len(animeLists[arn.AnimeListStatusCompleted].Items) > 0
|
|
|
|
.anime-list-container
|
|
|
|
h3.status-name Completed
|
|
|
|
AnimeList(animeLists[arn.AnimeListStatusCompleted], viewUser, user)
|
2017-06-29 21:27:21 +00:00
|
|
|
|
2017-07-03 15:21:00 +00:00
|
|
|
if len(animeLists[arn.AnimeListStatusPlanned].Items) > 0
|
|
|
|
.anime-list-container
|
|
|
|
h3.status-name Planned
|
|
|
|
AnimeList(animeLists[arn.AnimeListStatusPlanned], viewUser, user)
|
2017-06-29 21:27:21 +00:00
|
|
|
|
2017-07-03 15:21:00 +00:00
|
|
|
if len(animeLists[arn.AnimeListStatusHold].Items) > 0
|
|
|
|
.anime-list-container
|
|
|
|
h3.status-name On hold
|
|
|
|
AnimeList(animeLists[arn.AnimeListStatusHold], viewUser, user)
|
|
|
|
|
|
|
|
if len(animeLists[arn.AnimeListStatusDropped].Items) > 0
|
|
|
|
.anime-list-container
|
|
|
|
h3.status-name Dropped
|
|
|
|
AnimeList(animeLists[arn.AnimeListStatusDropped], viewUser, user)
|
2017-06-29 21:27:21 +00:00
|
|
|
|
2017-06-30 21:52:42 +00:00
|
|
|
component AnimeList(animeList *arn.AnimeList, viewUser *arn.User, user *arn.User)
|
2017-07-12 22:34:33 +00:00
|
|
|
table.anime-list
|
|
|
|
tbody
|
2017-07-06 01:24:56 +00:00
|
|
|
each item in animeList.Items
|
2017-10-11 20:54:26 +00:00
|
|
|
tr.anime-list-item.mountable(title=item.Notes, data-api="/api/animelist/" + animeList.UserID + "/field/Items[AnimeID=\"" + item.AnimeID + "\"]")
|
2017-07-21 03:09:47 +00:00
|
|
|
td.anime-list-item-image-container
|
|
|
|
a.ajax(href=item.Anime().Link())
|
2017-10-20 16:20:45 +00:00
|
|
|
img.anime-list-item-image.lazy(data-src=item.Anime().Image.Tiny, alt=item.Anime().Title.ByUser(user))
|
2017-07-21 03:09:47 +00:00
|
|
|
|
2017-06-20 18:13:04 +00:00
|
|
|
td.anime-list-item-name
|
2017-10-20 16:20:45 +00:00
|
|
|
a.ajax(href=item.Link(animeList.User().Nick))= item.Anime().Title.ByUser(user)
|
2017-07-10 14:58:34 +00:00
|
|
|
|
2017-07-19 02:47:32 +00:00
|
|
|
td.anime-list-item-actions
|
|
|
|
if user != nil && item.Status == arn.AnimeListStatusWatching && item.Anime().EpisodeByNumber(item.Episodes + 1) != nil
|
2017-07-10 14:58:34 +00:00
|
|
|
for _, link := range item.Anime().EpisodeByNumber(item.Episodes + 1).Links
|
|
|
|
a(href=link, title="Watch episode " + toString(item.Episodes + 1) + " on twist.moe", target="_blank", rel="noopener")
|
|
|
|
RawIcon("eye")
|
|
|
|
//- a(href=arn.Nyaa.GetLink(item.Anime()), title="Search on Nyaa", target="_blank", rel="noopener")
|
|
|
|
//- RawIcon("download")
|
|
|
|
|
2017-06-29 06:32:46 +00:00
|
|
|
td.anime-list-item-airing-date
|
2017-10-02 17:17:23 +00:00
|
|
|
if (item.Status == arn.AnimeListStatusWatching || item.Status == arn.AnimeListStatusPlanned) && item.Anime().UpcomingEpisode() != nil
|
2017-07-07 15:16:40 +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)
|
2017-07-10 14:58:34 +00:00
|
|
|
|
2017-06-24 21:24:15 +00:00
|
|
|
td.anime-list-item-episodes
|
2017-06-30 21:52:42 +00:00
|
|
|
.anime-list-item-episodes-watched
|
2017-07-01 11:53:55 +00:00
|
|
|
.action(contenteditable=utils.SameUser(user, viewUser), data-field="Episodes", data-type="number", data-trigger="focusout", data-action="save")= item.Episodes
|
2017-07-12 22:34:33 +00:00
|
|
|
if item.Status == arn.AnimeListStatusWatching
|
|
|
|
.plus-episode.action(data-action="increaseEpisode", data-trigger="click") +
|
2017-07-21 03:51:11 +00:00
|
|
|
|
2017-06-25 12:58:27 +00:00
|
|
|
.anime-list-item-episodes-separator /
|
|
|
|
.anime-list-item-episodes-max= item.Anime().EpisodeCountString()
|
2017-07-10 14:58:34 +00:00
|
|
|
|
2017-06-30 21:52:42 +00:00
|
|
|
td.anime-list-item-rating(title="Overall rating")
|
2017-07-12 22:34:33 +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)
|
2017-06-30 21:52:42 +00:00
|
|
|
//- td.anime-list-item-rating(title="Story rating")
|
|
|
|
//- .action(contenteditable=utils.SameUser(user, viewUser), data-field="Rating.Story", data-type="number", data-trigger="focusout", data-action="save")= fmt.Sprintf("%.1f", item.Rating.Story)
|
|
|
|
//- td.anime-list-item-rating(title="Visuals rating")
|
|
|
|
//- .action(contenteditable=utils.SameUser(user, viewUser), data-field="Rating.Visuals", data-type="number", data-trigger="focusout", data-action="save")= fmt.Sprintf("%.1f", item.Rating.Visuals)
|
|
|
|
//- td.anime-list-item-rating(title="Soundtrack rating")
|
|
|
|
//- .action(contenteditable=utils.SameUser(user, viewUser), data-field="Rating.Soundtrack", data-type="number", data-trigger="focusout", data-action="save")= fmt.Sprintf("%.1f", item.Rating.Soundtrack)
|