2018-04-10 19:25:45 +00:00
|
|
|
component CharacterTabs(character *arn.Character, user *arn.User)
|
|
|
|
.tabs
|
|
|
|
Tab("Character", "user", character.Link())
|
|
|
|
Tab("Edit", "pencil", character.Link() + "/edit")
|
2018-04-22 13:24:17 +00:00
|
|
|
Tab("Images", "image", character.Link() + "/edit/images")
|
2018-04-10 19:25:45 +00:00
|
|
|
Tab("History", "history", character.Link() + "/history")
|
|
|
|
|
2018-04-22 20:50:33 +00:00
|
|
|
component CharacterDetails(character *arn.Character, characterAnime []*arn.Anime, quotes []*arn.Quote, friends []*arn.User, relevantCharacters []*arn.Character, mainQuote *arn.Quote, user *arn.User)
|
2017-11-12 12:41:19 +00:00
|
|
|
.character-page
|
2017-11-19 14:15:44 +00:00
|
|
|
.character-left-column
|
|
|
|
.character-header
|
2018-06-30 03:22:17 +00:00
|
|
|
.character-image-container.mountable(data-mountable-type="header")
|
2018-04-11 13:06:08 +00:00
|
|
|
img.character-image-large.lazy(data-src=character.ImageLink("large"), data-webp="true", data-color=character.AverageColor(), alt=character.Name.Canonical)
|
2018-04-19 14:23:14 +00:00
|
|
|
|
|
|
|
.buttons
|
|
|
|
LikeButton(strconv.Itoa(len(character.Likes)), "heart", "character", character, user)
|
2018-04-19 22:44:58 +00:00
|
|
|
|
|
|
|
if user != nil && (user.Role == "editor" || user.Role == "admin")
|
2018-06-30 03:22:17 +00:00
|
|
|
a.button.tip.mountable(href=character.Link() + "/edit", aria-label="Edit character", data-mountable-type="header")
|
2018-04-19 22:44:58 +00:00
|
|
|
RawIcon("pencil")
|
2018-04-04 19:23:59 +00:00
|
|
|
|
2017-11-19 14:15:44 +00:00
|
|
|
.character-description-container
|
2018-04-23 12:30:05 +00:00
|
|
|
if character.Name.Canonical == ""
|
2018-06-30 03:22:17 +00:00
|
|
|
h1.character-name.mountable(data-mountable-type="header") untitled
|
2018-04-23 12:30:05 +00:00
|
|
|
else
|
2018-06-30 03:22:17 +00:00
|
|
|
h1.character-name.mountable(data-mountable-type="header")= character.Name.Canonical
|
2018-03-27 03:25:25 +00:00
|
|
|
|
2018-06-30 03:22:17 +00:00
|
|
|
.anime-alternative-title.mountable(data-mountable-type="header")
|
2018-03-27 03:25:25 +00:00
|
|
|
if character.Name.Japanese != ""
|
|
|
|
Japanese(character.Name.Japanese)
|
2018-04-23 12:30:05 +00:00
|
|
|
else
|
|
|
|
Japanese("日本語の名前無し")
|
2018-04-10 18:56:56 +00:00
|
|
|
|
2018-11-01 06:34:17 +00:00
|
|
|
//- if mainQuote != nil
|
|
|
|
//- .character-quotes
|
|
|
|
//- Quote(mainQuote, user)
|
2018-04-10 18:56:56 +00:00
|
|
|
|
2018-06-30 03:22:17 +00:00
|
|
|
.character-description.mountable(data-mountable-type="header")!= markdown.Render(character.Description)
|
2018-11-01 00:11:11 +00:00
|
|
|
|
|
|
|
.character-spoilers
|
|
|
|
each spoiler in character.Spoilers
|
|
|
|
.spoiler.character-spoiler.mountable(data-mountable-type="header")!= markdown.Render(spoiler.Text)
|
2017-11-19 14:15:44 +00:00
|
|
|
|
2018-04-24 02:16:11 +00:00
|
|
|
.character-main-column
|
|
|
|
if len(characterAnime) > 0
|
|
|
|
.character-section
|
|
|
|
h3.character-section-name.mountable Anime
|
2018-04-04 19:23:59 +00:00
|
|
|
|
2018-04-24 02:16:11 +00:00
|
|
|
.character-anime.mountable
|
|
|
|
each anime in characterAnime
|
|
|
|
a.character-anime-item.tip.mountable(href=anime.Link(), aria-label=anime.Title.ByUser(user), data-mountable-type="anime")
|
|
|
|
img.character-anime-item-image.lazy(data-src=anime.ImageLink("small"), data-webp="true", data-color=anime.AverageColor(), alt=anime.Title.ByUser(user))
|
|
|
|
|
2018-11-01 06:34:17 +00:00
|
|
|
if len(quotes) > 0
|
2018-04-24 02:16:11 +00:00
|
|
|
.character-section
|
|
|
|
h3.character-section-name.mountable Quotes
|
2018-04-04 19:23:59 +00:00
|
|
|
|
2018-04-24 02:16:11 +00:00
|
|
|
.quotes.character-quotes.mountable
|
2018-01-26 10:30:26 +00:00
|
|
|
each quote in quotes
|
2018-11-01 06:34:17 +00:00
|
|
|
Quote(quote, user)
|
2018-04-26 18:19:27 +00:00
|
|
|
|
2018-11-01 06:06:04 +00:00
|
|
|
.character-section
|
|
|
|
h3.character-section-name.mountable Comments
|
|
|
|
|
|
|
|
.character-comments
|
|
|
|
Comments(character, user)
|
|
|
|
|
2018-04-26 18:19:27 +00:00
|
|
|
CharacterSidebar(character, friends, relevantCharacters, user)
|
2017-11-12 12:41:19 +00:00
|
|
|
|
2018-04-26 18:19:27 +00:00
|
|
|
component CharacterSidebar(character *arn.Character, friends []*arn.User, relevantCharacters []*arn.Character, user *arn.User)
|
|
|
|
.character-sidebar
|
2018-10-27 02:01:21 +00:00
|
|
|
h3.mountable(data-mountable-type="sidebar") Information
|
2018-04-04 19:23:59 +00:00
|
|
|
|
2018-10-27 02:01:21 +00:00
|
|
|
table.character-attributes.mountable(data-mountable-type="sidebar")
|
|
|
|
//- Ranking
|
|
|
|
tr.mountable(data-mountable-type="info")
|
|
|
|
td.character-attributes-name Ranking:
|
|
|
|
td.character-attributes-value
|
|
|
|
a.character-ranking(href="/characters/best", data-character-id=character.ID) View
|
|
|
|
|
|
|
|
//- Attributes
|
|
|
|
each attribute in character.Attributes
|
|
|
|
tr.mountable(data-mountable-type="info")
|
|
|
|
td.character-attributes-name= attribute.Name + ":"
|
2017-11-12 12:48:21 +00:00
|
|
|
|
2018-10-27 02:01:21 +00:00
|
|
|
if strings.Contains(attribute.Value, "<")
|
|
|
|
td.character-attributes-value!= markdown.Render(attribute.Value)
|
|
|
|
else
|
|
|
|
td.character-attributes-value= attribute.Value
|
2018-10-30 20:24:12 +00:00
|
|
|
//- td.character-attributes-value
|
|
|
|
//- if strings.Contains(attribute.Value, ",")
|
|
|
|
//- ul
|
|
|
|
//- each part in strings.Split(attribute.Value, ",")
|
|
|
|
//- li= strings.TrimSpace(part)
|
|
|
|
//- else
|
|
|
|
//- span= attribute.Value
|
2018-04-26 18:19:27 +00:00
|
|
|
|
|
|
|
if len(relevantCharacters) > 0
|
2018-06-30 03:22:17 +00:00
|
|
|
h3.mountable(data-mountable-type="sidebar") Relevant
|
2018-04-22 20:50:33 +00:00
|
|
|
|
2018-06-30 03:22:17 +00:00
|
|
|
.relevant-characters.mountable(data-mountable-type="sidebar")
|
2018-04-26 18:19:27 +00:00
|
|
|
each relevantCharacter in relevantCharacters
|
|
|
|
.mountable(data-mountable-type="relevant-character")
|
|
|
|
CharacterSmall(relevantCharacter, user)
|
|
|
|
|
|
|
|
if len(friends) > 0
|
|
|
|
.character-friends
|
2018-06-30 03:22:17 +00:00
|
|
|
h3.mountable(data-mountable-type="sidebar") Friends
|
2018-04-19 15:48:15 +00:00
|
|
|
|
2018-06-30 03:22:17 +00:00
|
|
|
.user-avatars.mountable(data-mountable-type="sidebar")
|
2018-04-26 18:19:27 +00:00
|
|
|
each friend in friends
|
|
|
|
.mountable(data-mountable-type="friend")
|
|
|
|
if friend.IsActive()
|
|
|
|
Avatar(friend)
|
|
|
|
else
|
|
|
|
.inactive-user
|
2018-04-19 15:48:15 +00:00
|
|
|
Avatar(friend)
|
|
|
|
|
2018-06-30 03:22:17 +00:00
|
|
|
h3.mountable(data-mountable-type="sidebar") Links
|
2018-04-04 19:23:59 +00:00
|
|
|
|
2018-06-30 03:22:17 +00:00
|
|
|
.light-button-group.mountable(data-mountable-type="sidebar")
|
2018-04-26 18:19:27 +00:00
|
|
|
if character.GetMapping("myanimelist/character") != ""
|
|
|
|
a.light-button(href="https://myanimelist.net/character/" + character.GetMapping("myanimelist/character"), target="_blank", rel="noopener")
|
|
|
|
Icon("external-link")
|
|
|
|
span MAL
|
|
|
|
else if user != nil && (user.Role == "editor" || user.Role == "admin")
|
|
|
|
a.light-button(href="https://myanimelist.net/character.php?q=" + character.Name.Canonical, target="_blank", rel="noopener")
|
|
|
|
Icon("exclamation-triangle")
|
|
|
|
span Error: No MAL ID
|
|
|
|
|
|
|
|
a.light-button(href="/api" + character.Link(), target="_blank")
|
|
|
|
Icon("code")
|
|
|
|
span API
|