43 lines
2.3 KiB
Plaintext
Raw Normal View History

component AnimeListItem(viewUser *arn.User, item *arn.AnimeListItem, anime *arn.Anime, user *arn.User)
2018-04-19 22:06:13 +00:00
.anime-list-item-view.mountable(data-api="/api/animelist/" + viewUser.ID + "/field/Items[AnimeID=\"" + anime.ID + "\"]")
h1.anime-list-item-title.mountable= anime.Title.ByUser(user)
2018-04-19 22:19:21 +00:00
2018-04-19 22:06:13 +00:00
.anime-list-item-progress-edit
2018-04-19 22:28:19 +00:00
.anime-list-item-episodes-edit.mountable
2018-04-19 22:06:13 +00:00
InputNumberWithButtons("Episodes", float64(item.Episodes), "Episodes", "Number of episodes you watched", "0", arn.EpisodeCountMax(anime.EpisodeCount), "1")
2017-06-26 09:43:47 +00:00
2018-04-19 22:28:19 +00:00
.widget-section.anime-list-item-status-edit.mountable
2018-04-19 22:06:13 +00:00
label(for="Status") Status:
select.widget-ui-element.action(id="Status", data-field="Status", value=item.Status, data-action="save", data-trigger="change")
option(value=arn.AnimeListStatusWatching) Watching
option(value=arn.AnimeListStatusCompleted) Completed
option(value=arn.AnimeListStatusPlanned) Plan to watch
option(value=arn.AnimeListStatusHold) On hold
option(value=arn.AnimeListStatusDropped) Dropped
2017-06-29 13:55:04 +00:00
2018-04-19 22:28:19 +00:00
.anime-list-item-rating-edit.mountable(data-status=item.Status)
2018-04-19 22:06:13 +00:00
InputNumber("Rating.Overall", item.Rating.Overall, arn.OverallRatingName(item.Episodes), "Overall rating on a scale of 0 to 10", "0", "10", "0.1")
InputNumber("Rating.Story", item.Rating.Story, "Story", "Story rating on a scale of 0 to 10", "0", "10", "0.1")
InputNumber("Rating.Visuals", item.Rating.Visuals, "Visuals", "Visuals rating on a scale of 0 to 10", "0", "10", "0.1")
InputNumber("Rating.Soundtrack", item.Rating.Soundtrack, "Soundtrack", "Soundtrack rating on a scale of 0 to 10", "0", "10", "0.1")
2018-04-19 22:28:19 +00:00
.anime-list-item-others.mountable
2017-06-26 09:43:47 +00:00
InputNumber("RewatchCount", float64(item.RewatchCount), "Rewatched", "How often you rewatched this anime", "0", "100", "1")
2018-04-19 22:06:13 +00:00
InputBool("Private", item.Private, "Private", "Hidden entry")
2018-04-19 22:28:19 +00:00
.mountable
2019-08-31 07:52:42 +00:00
InputTextArea("Notes", item.Notes, "Notes", "Your notes", 2000)
2017-06-20 10:41:26 +00:00
2018-04-19 22:06:13 +00:00
.buttons.mountable
2018-04-19 22:28:19 +00:00
a.button.mountable(href="/+" + viewUser.Nick + "/animelist/" + item.Status)
2018-04-19 22:06:13 +00:00
Icon("list")
span View collection
2018-04-19 22:28:19 +00:00
a.button.mountable(href=anime.Link())
2018-04-19 22:06:13 +00:00
Icon("search-plus")
span View anime
2018-04-19 22:28:19 +00:00
button.action.mountable(data-action="removeAnimeFromCollection", data-trigger="click", data-api="/api/animelist/" + viewUser.ID, data-anime-id=anime.ID, data-nick=viewUser.Nick)
2018-04-19 22:06:13 +00:00
Icon("trash")
span Remove from collection