2017-10-20 14:52:07 +00:00
|
|
|
component Anime(anime *arn.Anime, friends []*arn.User, listItems map[*arn.User]*arn.AnimeListItem, user *arn.User)
|
|
|
|
AnimeTabs(anime)
|
|
|
|
|
2016-11-28 16:06:00 +00:00
|
|
|
.anime-header(data-id=anime.ID)
|
2017-06-04 20:06:14 +00:00
|
|
|
if anime.Image.Small != ""
|
2016-11-28 16:06:00 +00:00
|
|
|
.anime-image-container
|
2017-10-20 16:20:45 +00:00
|
|
|
img.anime-cover-image(src=anime.Image.Small, alt=anime.Title.ByUser(user))
|
2017-10-17 14:58:28 +00:00
|
|
|
|
|
|
|
if anime.StartDate != ""
|
2017-10-17 15:18:06 +00:00
|
|
|
.anime-start-date
|
|
|
|
span(title="Start date: " + anime.StartDate)= anime.StartDate[:4]
|
|
|
|
if anime.EndDate != "" && anime.StartDate[:4] != anime.EndDate[:4]
|
|
|
|
span -
|
|
|
|
span(title="End date: " + anime.EndDate)= anime.EndDate[:4]
|
2016-11-02 13:47:22 +00:00
|
|
|
|
2016-11-30 15:29:36 +00:00
|
|
|
.space
|
|
|
|
|
2016-11-28 16:06:00 +00:00
|
|
|
.anime-info
|
2017-10-20 16:04:30 +00:00
|
|
|
h1.anime-title(title=anime.Type)= anime.Title.ByUser(user)
|
2016-11-02 13:47:22 +00:00
|
|
|
|
2016-11-28 16:06:00 +00:00
|
|
|
//- if user && user.titleLanguage === "japanese"
|
|
|
|
//- span.second-title(title=anime.Title.English !== anime.Title.Romaji ? anime.Title.English : null)= anime.Title.Romaji
|
|
|
|
//- else
|
2017-06-02 14:17:58 +00:00
|
|
|
if anime.Title.Japanese != anime.Title.Canonical
|
2017-07-06 19:38:19 +00:00
|
|
|
h2.anime-alternative-title
|
2017-07-11 14:54:17 +00:00
|
|
|
Japanese(anime.Title.Japanese)
|
2016-11-02 13:47:22 +00:00
|
|
|
|
2016-11-28 16:06:00 +00:00
|
|
|
//- h3.anime-section-name.anime-summary-header Summary
|
2017-06-02 14:17:58 +00:00
|
|
|
p.anime-summary= anime.Summary
|
2016-11-28 16:06:00 +00:00
|
|
|
|
2017-06-19 18:59:02 +00:00
|
|
|
if user != nil
|
2017-06-20 13:46:49 +00:00
|
|
|
.buttons.anime-actions
|
2017-06-28 15:55:08 +00:00
|
|
|
if user.Role == "editor" || user.Role == "admin"
|
|
|
|
a.button.ajax(href=anime.Link() + "/edit")
|
2017-06-28 16:39:52 +00:00
|
|
|
Icon("pencil-square-o")
|
2017-06-28 15:55:08 +00:00
|
|
|
span Edit anime
|
|
|
|
|
2017-06-19 18:59:02 +00:00
|
|
|
if user.AnimeList().Contains(anime.ID)
|
2017-07-05 14:52:24 +00:00
|
|
|
a.button.ajax(href="/+" + user.Nick + "/animelist/anime/" + anime.ID)
|
2017-06-20 10:41:26 +00:00
|
|
|
Icon("pencil")
|
|
|
|
span Edit in collection
|
2017-06-19 18:59:02 +00:00
|
|
|
else
|
2017-10-14 10:45:22 +00:00
|
|
|
button.action(data-api="/api/animelist/" + user.ID, data-action="addAnimeToCollection", data-trigger="click", data-anime-id=anime.ID)
|
2017-06-20 13:46:49 +00:00
|
|
|
Icon("plus")
|
|
|
|
span Add to collection
|
2017-06-08 19:54:39 +00:00
|
|
|
|
2017-06-08 09:51:34 +00:00
|
|
|
h3.anime-section-name Ratings
|
|
|
|
.anime-rating-categories
|
2017-06-30 18:00:56 +00:00
|
|
|
.anime-rating-category(title=toString(anime.Rating.Overall))
|
2017-07-01 00:14:14 +00:00
|
|
|
if anime.Status == "upcoming"
|
|
|
|
.anime-rating-category-name Hype
|
|
|
|
else
|
|
|
|
.anime-rating-category-name Overall
|
2017-10-20 15:24:16 +00:00
|
|
|
Rating(anime.Rating.Overall, user)
|
2017-06-30 18:00:56 +00:00
|
|
|
.anime-rating-category(title=toString(anime.Rating.Story))
|
2017-06-08 09:51:34 +00:00
|
|
|
.anime-rating-category-name Story
|
2017-10-20 15:24:16 +00:00
|
|
|
Rating(anime.Rating.Story, user)
|
2017-06-30 18:00:56 +00:00
|
|
|
.anime-rating-category(title=toString(anime.Rating.Visuals))
|
2017-06-08 09:51:34 +00:00
|
|
|
.anime-rating-category-name Visuals
|
2017-10-20 15:24:16 +00:00
|
|
|
Rating(anime.Rating.Visuals, user)
|
2017-06-30 18:00:56 +00:00
|
|
|
.anime-rating-category(title=toString(anime.Rating.Soundtrack))
|
2017-06-26 02:09:31 +00:00
|
|
|
.anime-rating-category-name Soundtrack
|
2017-10-20 15:24:16 +00:00
|
|
|
Rating(anime.Rating.Soundtrack, user)
|
2017-06-08 09:51:34 +00:00
|
|
|
|
2017-10-17 14:58:28 +00:00
|
|
|
if len(friends) > 0
|
|
|
|
h3.anime-section-name Friends
|
|
|
|
|
|
|
|
.anime-friends
|
|
|
|
.user-avatars
|
|
|
|
each friend in friends
|
|
|
|
if friend.Nick != ""
|
|
|
|
if friend.IsActive()
|
|
|
|
.mountable
|
|
|
|
FriendEntry(friend, listItems)
|
|
|
|
else
|
|
|
|
.mountable
|
|
|
|
.inactive-user
|
|
|
|
FriendEntry(friend, listItems)
|
|
|
|
|
|
|
|
if anime.Relations() != nil && len(anime.Relations().Items) > 0
|
|
|
|
h3.anime-section-name Relations
|
|
|
|
.anime-relations
|
|
|
|
each relation in anime.Relations().Items
|
2017-10-20 16:46:50 +00:00
|
|
|
a.anime-relation.ajax(href=relation.Anime().Link(), title=relation.Anime().Title.ByUser(user))
|
|
|
|
img.anime-relation-image.lazy(data-src=relation.Anime().Image.Tiny, alt=relation.Anime().Title.ByUser(user))
|
2017-10-17 14:58:28 +00:00
|
|
|
.anime-relation-type= relation.HumanReadableType()
|
|
|
|
.anime-relation-year
|
|
|
|
if relation.Anime().StartDate != ""
|
|
|
|
span= relation.Anime().StartDate[:4]
|
|
|
|
|
2017-06-27 11:46:29 +00:00
|
|
|
if len(anime.Trailers) > 0 && anime.Trailers[0].Service == "Youtube" && anime.Trailers[0].ServiceID != ""
|
2016-11-28 16:06:00 +00:00
|
|
|
h3.anime-section-name Video
|
|
|
|
.anime-trailer.video-container
|
2017-06-27 11:46:29 +00:00
|
|
|
iframe.video(src="https://www.youtube.com/embed/" + anime.Trailers[0].ServiceID + "?showinfo=0", allowfullscreen="allowfullscreen")
|
2016-11-02 13:47:22 +00:00
|
|
|
|
2017-06-02 14:17:58 +00:00
|
|
|
//- if anime.Tracks != nil && anime.Tracks.Opening != nil
|
|
|
|
//- h3.anime-section-name Tracks
|
|
|
|
//- iframe.anime-track(src="https://w.soundcloud.com/player/?url=" + anime.Tracks.Opening.URI + "?auto_play=false&hide_related=true&show_comments=true&show_user=true&show_reposts=false&visual=true")
|
2016-11-23 09:07:02 +00:00
|
|
|
|
2016-11-28 16:06:00 +00:00
|
|
|
//- if user && friendsWatching && friendsWatching.length > 0
|
|
|
|
//- include ../messages/avatar.pug
|
2016-11-02 13:47:22 +00:00
|
|
|
|
2016-11-28 16:06:00 +00:00
|
|
|
//- h3.anime-section-name Watching
|
|
|
|
//- .user-list
|
|
|
|
//- each watcher in friendsWatching
|
|
|
|
//- +avatar(watcher)
|
|
|
|
|
2017-06-02 14:17:58 +00:00
|
|
|
//- if len(anime.Relations) > 0
|
|
|
|
//- h3.anime-section-name Relations
|
|
|
|
//- .relations
|
|
|
|
//- each relation in anime.Relations
|
|
|
|
//- a.relation.ajax(href="/anime/" + toString(relation.ID), title=relation.Anime().Title.Romaji)
|
|
|
|
//- img.anime-image.relation-image(src=relation.Anime().Image, alt=relation.Anime().Title.Romaji)
|
|
|
|
//- .relation-type= arn.Capitalize(relation.Type)
|
2016-11-28 16:06:00 +00:00
|
|
|
|
2017-06-02 14:17:58 +00:00
|
|
|
//- if len(anime.Genres) > 0
|
|
|
|
//- h3.anime-section-name Genres
|
|
|
|
//- .light-button-group
|
|
|
|
//- each genre in anime.Genres
|
|
|
|
//- if genre != ""
|
|
|
|
//- a.light-button.ajax(href="/genres/" + arn.GetGenreIDByName(genre))
|
|
|
|
//- Icon(arn.GetGenreIcon(genre))
|
|
|
|
//- span= genre
|
2016-11-28 16:06:00 +00:00
|
|
|
|
2017-06-02 14:17:58 +00:00
|
|
|
//- if len(anime.Studios) > 0
|
|
|
|
//- h3.anime-section-name Studios
|
|
|
|
//- .light-button-group
|
|
|
|
//- each studio in anime.Studios
|
|
|
|
//- a.light-button(href="https://anilist.co/studio/" + toString(studio.ID), target="_blank")
|
|
|
|
//- Icon("building")
|
|
|
|
//- span= studio.Name
|
2016-11-02 13:47:22 +00:00
|
|
|
|
2016-11-28 16:06:00 +00:00
|
|
|
//- //-if crunchy
|
|
|
|
//- //- h3.anime-section-name Episodes
|
2016-11-02 13:47:22 +00:00
|
|
|
|
2016-11-28 16:06:00 +00:00
|
|
|
//- if canEdit
|
|
|
|
//- #staff-info
|
|
|
|
//- h3.anime-section-name Links
|
|
|
|
//- table
|
|
|
|
//- tbody
|
|
|
|
//- tr
|
|
|
|
//- td MyAnimeList
|
|
|
|
//- td
|
|
|
|
//- input.save-on-change(id="MyAnimeList", type="text", value=providers.MyAnimeList ? providers.MyAnimeList.providerId : ", disabled=(providers.MyAnimeList && providers.MyAnimeList.similarity === 1) ? true : false)
|
|
|
|
//- td
|
|
|
|
//- a(href="https://www.google.co.jp/search?q=site:myanimelist.net/anime+" + anime.title.romaji.replace(/ /g, "+"), target="_blank")
|
|
|
|
//- .fa.fa-search
|
|
|
|
//- td
|
|
|
|
//- tr
|
|
|
|
//- td HummingBird
|
|
|
|
//- td
|
|
|
|
//- input.save-on-change(id="HummingBird", type="text", value=providers.HummingBird ? providers.HummingBird.providerId : ", disabled=(providers.HummingBird && providers.HummingBird.similarity === 1) ? true : false)
|
|
|
|
//- td
|
|
|
|
//- a(href="https://www.google.co.jp/search?q=site:hummingbird.me/anime+" + anime.title.romaji.replace(/ /g, "+"), target="_blank")
|
|
|
|
//- .fa.fa-search
|
|
|
|
//- td
|
|
|
|
//- tr
|
|
|
|
//- td AnimePlanet
|
|
|
|
//- td
|
|
|
|
//- input.save-on-change(id="AnimePlanet", type="text", value=providers.AnimePlanet ? providers.AnimePlanet.providerId : ", disabled=(providers.AnimePlanet && providers.AnimePlanet.similarity === 1) ? true : false)
|
|
|
|
//- td
|
|
|
|
//- a(href="https://www.google.co.jp/search?q=site:anime-planet.com/anime+" + anime.title.english.replace(/ /g, "+"), target="_blank")
|
|
|
|
//- .fa.fa-search
|
|
|
|
//- td
|
2016-11-02 13:47:22 +00:00
|
|
|
|
2016-11-28 16:06:00 +00:00
|
|
|
//- - var title = providers.Nyaa ? providers.Nyaa.title : "
|
|
|
|
//- - var proposedTitle = nyaa.buildNyaaTitle(anime.title.romaji)
|
|
|
|
//- tr
|
|
|
|
//- td Nyaa
|
|
|
|
//- td
|
|
|
|
//- input.save-on-change(id="Nyaa", type="text", value=title, placeholder=proposedTitle)
|
|
|
|
//- td
|
|
|
|
//- a(href="https://www.nyaa.se/?page=search&cats=1_37&filter=0&sort=2&term=" + (title ? title.replace(/ /g, "+") : proposedTitle), target="_blank")
|
|
|
|
//- .fa.fa-search
|
|
|
|
//- td
|
|
|
|
//- if providers.Nyaa && providers.Nyaa.episodes !== undefined
|
|
|
|
//- span(class=providers.Nyaa.episodes === 0 ? "entry-error" : "entry-ok")= providers.Nyaa.episodes + " eps"
|
2016-11-02 13:47:22 +00:00
|
|
|
|
2017-09-30 14:04:13 +00:00
|
|
|
h3.anime-section-name Popularity
|
|
|
|
.anime-rating-categories
|
|
|
|
.anime-rating-category
|
|
|
|
.anime-rating-category-name Watching
|
|
|
|
.anime-rating= anime.Popularity.Watching
|
|
|
|
.anime-rating-category
|
|
|
|
.anime-rating-category-name Completed
|
|
|
|
.anime-rating= anime.Popularity.Completed
|
|
|
|
.anime-rating-category
|
|
|
|
.anime-rating-category-name Planned
|
|
|
|
.anime-rating= anime.Popularity.Planned
|
|
|
|
.anime-rating-category
|
|
|
|
.anime-rating-category-name Hold
|
|
|
|
.anime-rating= anime.Popularity.Hold
|
|
|
|
.anime-rating-category
|
|
|
|
.anime-rating-category-name Dropped
|
|
|
|
.anime-rating= anime.Popularity.Dropped
|
2017-10-20 14:52:07 +00:00
|
|
|
|
2017-06-27 23:05:39 +00:00
|
|
|
//- h3.anime-section-name Reviews
|
|
|
|
//- p Coming soon.
|
2017-06-08 12:46:38 +00:00
|
|
|
|
2017-06-08 09:51:34 +00:00
|
|
|
h3.anime-section-name Links
|
|
|
|
.light-button-group
|
|
|
|
//- if anime.Links != nil
|
|
|
|
//- each link in anime.Links
|
|
|
|
//- a.light-button(href=link.URL, target="_blank")
|
|
|
|
//- Icon("external-link")
|
|
|
|
//- span= link.Title
|
|
|
|
a.light-button(href="https://kitsu.io/anime/" + anime.ID, target="_blank", rel="noopener")
|
|
|
|
Icon("external-link")
|
|
|
|
span Kitsu
|
2017-06-28 15:55:08 +00:00
|
|
|
|
|
|
|
each mapping in anime.Mappings
|
|
|
|
a.light-button(href=mapping.Link(), target="_blank", rel="noopener")
|
|
|
|
Icon("external-link")
|
|
|
|
span= mapping.Name()
|
2016-11-02 13:47:22 +00:00
|
|
|
|
2017-06-20 18:13:04 +00:00
|
|
|
//- if providers.HummingBird
|
|
|
|
//- a.light-button(href="https://hummingbird.me/anime/" + providers.HummingBird.providerId, target="_blank") HummingBird
|
2016-11-02 13:47:22 +00:00
|
|
|
|
2017-06-20 18:13:04 +00:00
|
|
|
//- if providers.MyAnimeList
|
|
|
|
//- a.light-button(href="http://myanimelist.net/anime/" + providers.MyAnimeList.providerId, target="_blank") MyAnimeList
|
2016-11-02 13:47:22 +00:00
|
|
|
|
2017-06-20 18:13:04 +00:00
|
|
|
//- if providers.AnimePlanet
|
|
|
|
//- a.light-button(href="http://www.anime-planet.com/anime/" + providers.AnimePlanet.providerId, target="_blank") AnimePlanet
|
2016-11-02 13:47:22 +00:00
|
|
|
|
2017-06-24 14:17:38 +00:00
|
|
|
.footer
|
2017-06-24 16:15:39 +00:00
|
|
|
//- if user != nil && user.Role == "admin"
|
|
|
|
//- a(href="/api/anime/" + anime.ID) Anime API
|
|
|
|
//- span |
|
2017-06-24 14:17:38 +00:00
|
|
|
span Powered by Kitsu.
|
2016-11-28 16:06:00 +00:00
|
|
|
//- if descriptionSource
|
|
|
|
//- span= " Summary by " + summarySource + "."
|
|
|
|
//- //-
|
|
|
|
//- h3.anime-section-name Synonyms
|
|
|
|
//- if anime.title.synonyms
|
|
|
|
//- ul.anime-synonyms
|
|
|
|
//- li.anime-japanese-title= anime.title.japanese
|
|
|
|
//- each synonym in anime.title.synonyms
|
2017-07-21 09:49:28 +00:00
|
|
|
//- li= synonym
|
|
|
|
|
|
|
|
component FriendEntry(friend *arn.User, listItems map[*arn.User]*arn.AnimeListItem)
|
|
|
|
CustomAvatar(friend, listItems[friend].Link(friend.Nick), friend.Nick + " => " + listItems[friend].Status + " | " + toString(listItems[friend].Episodes) + " eps | " + fmt.Sprintf("%.1f", listItems[friend].Rating.Overall) + " rating")
|