2017-06-29 21:27:21 +00:00
|
|
|
component AnimeLists(animeLists map[string]*arn.AnimeList, viewUser *arn.User, user *arn.User)
|
|
|
|
h2.anime-list-owner= viewUser.Nick + "'s collection"
|
|
|
|
|
|
|
|
if len(animeLists[arn.AnimeListStatusWatching].Items) > 0
|
|
|
|
.anime-list-container
|
|
|
|
h3.status-name Watching
|
2017-06-30 21:52:42 +00:00
|
|
|
AnimeList(animeLists[arn.AnimeListStatusWatching], viewUser, user)
|
2017-06-29 21:27:21 +00:00
|
|
|
|
|
|
|
if len(animeLists[arn.AnimeListStatusCompleted].Items) > 0
|
|
|
|
.anime-list-container
|
|
|
|
h3.status-name Completed
|
2017-06-30 21:52:42 +00:00
|
|
|
AnimeList(animeLists[arn.AnimeListStatusCompleted], viewUser, user)
|
2017-06-29 21:27:21 +00:00
|
|
|
|
|
|
|
if len(animeLists[arn.AnimeListStatusPlanned].Items) > 0
|
|
|
|
.anime-list-container
|
|
|
|
h3.status-name Planned
|
2017-06-30 21:52:42 +00:00
|
|
|
AnimeList(animeLists[arn.AnimeListStatusPlanned], viewUser, user)
|
2017-06-29 21:27:21 +00:00
|
|
|
|
|
|
|
if len(animeLists[arn.AnimeListStatusHold].Items) > 0
|
|
|
|
.anime-list-container
|
|
|
|
h3.status-name On hold
|
2017-06-30 21:52:42 +00:00
|
|
|
AnimeList(animeLists[arn.AnimeListStatusHold], viewUser, user)
|
2017-06-29 21:27:21 +00:00
|
|
|
|
|
|
|
if len(animeLists[arn.AnimeListStatusDropped].Items) > 0
|
|
|
|
.anime-list-container
|
|
|
|
h3.status-name Dropped
|
2017-06-30 21:52:42 +00:00
|
|
|
AnimeList(animeLists[arn.AnimeListStatusDropped], viewUser, user)
|
2017-06-29 21:27:21 +00:00
|
|
|
|
|
|
|
//- for status, animeList := range animeLists
|
|
|
|
//- h3= status
|
|
|
|
//- AnimeList(animeList, user)
|
|
|
|
|
2017-06-30 21:52:42 +00:00
|
|
|
component AnimeList(animeList *arn.AnimeList, viewUser *arn.User, user *arn.User)
|
2017-06-19 20:16:01 +00:00
|
|
|
table.anime-list
|
|
|
|
thead
|
|
|
|
tr
|
2017-06-20 18:13:04 +00:00
|
|
|
th.anime-list-item-name Anime
|
2017-06-29 06:32:46 +00:00
|
|
|
th.anime-list-item-airing-date Airing
|
2017-06-25 12:58:27 +00:00
|
|
|
th.anime-list-item-episodes Episodes
|
2017-06-30 21:52:42 +00:00
|
|
|
th.anime-list-item-rating Overall
|
|
|
|
//- th.anime-list-item-rating Story
|
|
|
|
//- th.anime-list-item-rating Visuals
|
|
|
|
//- th.anime-list-item-rating Soundtrack
|
2017-06-25 12:58:27 +00:00
|
|
|
if user != nil
|
|
|
|
th.anime-list-item-actions Actions
|
2017-06-19 20:16:01 +00:00
|
|
|
tbody
|
|
|
|
each item in animeList.Items
|
2017-06-30 21:52:42 +00:00
|
|
|
tr.anime-list-item.mountable(title=item.Notes, data-api="/api/animelist/" + animeList.UserID + "/update/" + item.AnimeID)
|
2017-06-20 18:13:04 +00:00
|
|
|
td.anime-list-item-name
|
2017-06-26 10:21:42 +00:00
|
|
|
a.ajax(href=item.Link(animeList.User().Nick))= item.Anime().Title.Canonical
|
2017-06-29 06:32:46 +00:00
|
|
|
td.anime-list-item-airing-date
|
|
|
|
if item.Anime().UpcomingEpisode() != nil
|
|
|
|
span.utc-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-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-06-25 12:58:27 +00:00
|
|
|
.anime-list-item-episodes-separator /
|
|
|
|
.anime-list-item-episodes-max= item.Anime().EpisodeCountString()
|
2017-06-26 10:21:42 +00:00
|
|
|
//- .anime-list-item-episodes-edit
|
|
|
|
//- a.ajax(href=, title="Edit anime")
|
|
|
|
//- RawIcon("pencil")
|
2017-06-30 21:52:42 +00:00
|
|
|
td.anime-list-item-rating(title="Overall rating")
|
2017-07-01 11:53:55 +00:00
|
|
|
.action(contenteditable=utils.SameUser(user, viewUser), data-field="Rating.Overall", data-type="number", data-trigger="focusout", data-action="save")= fmt.Sprintf("%.1f", 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)
|
2017-06-25 12:58:27 +00:00
|
|
|
if user != nil
|
|
|
|
td.anime-list-item-actions
|
|
|
|
a(href=arn.Nyaa.GetLink(item.Anime()), title="Search on Nyaa", target="_blank", rel="noopener")
|
|
|
|
RawIcon("download")
|