128 lines
5.2 KiB
Plaintext
Raw Normal View History

2017-11-28 23:15:43 +00:00
component Profile(viewUser *arn.User, user *arn.User, animeList *arn.AnimeList, uri string)
2017-11-11 14:47:03 +00:00
ProfileHeader(viewUser, user, uri)
if len(animeList.Items) == 0
p.no-data.mountable= viewUser.Nick + " hasn't added any anime yet."
else
.profile-watching-list.mountable
each item in animeList.Items
if item.Status == arn.AnimeListStatusWatching || item.Status == arn.AnimeListStatusCompleted
a.profile-watching-list-item.ajax(href=item.Anime().Link(), title=item.Anime().Title.ByUser(user) + " (" + toString(item.Episodes) + " / " + arn.EpisodesToString(item.Anime().EpisodeCount) + ")")
2018-03-16 21:40:38 +00:00
img.profile-watching-list-item-image.lazy(data-src=item.Anime().ImageLink("small"), data-webp="true", alt=item.Anime().Title.ByUser(user))
2017-11-11 14:47:03 +00:00
2018-02-24 14:35:34 +00:00
.footer
2018-03-14 20:13:31 +00:00
.buttons
2018-02-24 14:35:34 +00:00
if user != nil && (user.Role == "admin" || user.Role == "editor")
2017-11-11 14:47:03 +00:00
a.button.profile-action(href="/api/user/" + viewUser.ID, target="_blank", rel="noopener")
Icon("search-plus")
span JSON
component ProfileTabs(viewUser *arn.User, uri string)
.tabs
Tab("Anime", "th", "/+" + viewUser.Nick)
//- Tab("Collection", "list", "/+" + viewUser.Nick + "/animelist/watching")
Tab("Forum", "comment", "/+" + viewUser.Nick + "/forum/threads")
Tab("Tracks", "music", "/+" + viewUser.Nick + "/soundtracks/liked")
2018-03-19 11:25:31 +00:00
Tab("Quotes", "quote-left", "/+" + viewUser.Nick + "/quotes/liked")
2017-11-11 14:47:03 +00:00
Tab("Stats", "area-chart", "/+" + viewUser.Nick + "/stats")
Tab("Followers", "users", "/+" + viewUser.Nick + "/followers")
//- if strings.Contains(uri, "/animelist")
//- StatusTabs("/+" + viewUser.Nick + "/animelist")
2018-03-14 10:57:40 +00:00
if strings.Contains(uri, "/soundtracks")
.tabs
Tab("Liked", "heart", "/+" + viewUser.Nick + "/soundtracks/liked")
Tab("Added", "music", "/+" + viewUser.Nick + "/soundtracks/added")
2017-11-11 14:47:03 +00:00
2018-03-19 11:25:31 +00:00
if strings.Contains(uri, "/quotes")
.tabs
Tab("Liked", "heart", "/+" + viewUser.Nick + "/quotes/liked")
Tab("Added", "music", "/+" + viewUser.Nick + "/quotes/added")
2017-07-06 01:24:56 +00:00
component ProfileHeader(viewUser *arn.User, user *arn.User, uri string)
2017-11-11 14:47:03 +00:00
ProfileHead(viewUser, user, uri)
ProfileTabs(viewUser, uri)
component ProfileHead(viewUser *arn.User, user *arn.User, uri string)
2016-11-20 10:26:11 +00:00
.profile
2018-03-07 13:00:14 +00:00
img.profile-cover.lazy(data-src=viewUser.CoverLink("large"), data-webp="true", alt="Cover image")
2016-11-20 10:26:11 +00:00
2017-07-17 17:49:52 +00:00
.profile-image-container.mountable.never-unmount
2016-11-20 10:26:11 +00:00
ProfileImage(viewUser)
2017-06-22 14:21:26 +00:00
2017-07-03 15:21:00 +00:00
.intro-container.mountable.never-unmount
2017-07-06 20:12:59 +00:00
h1#nick= viewUser.Nick
2016-11-20 10:26:11 +00:00
if viewUser.Tagline != ""
p.profile-field.tagline
Icon("comment")
2016-11-20 14:15:14 +00:00
span.tagline-text= viewUser.Tagline
2016-11-20 10:26:11 +00:00
else
p.profile-field.tagline
Icon("comment")
2016-11-20 14:15:14 +00:00
span.tagline-text No tagline yet.
2017-06-22 14:21:26 +00:00
2017-06-12 22:06:35 +00:00
if viewUser.Website != ""
p.profile-field.website
Icon("home")
2017-07-19 02:24:42 +00:00
a(href=viewUser.WebsiteURL(), target="_blank", rel="nofollow")= viewUser.WebsiteShortURL()
2017-06-22 14:21:26 +00:00
2017-07-19 11:08:12 +00:00
if viewUser.Accounts.Osu.Nick != "" && viewUser.Accounts.Osu.PP >= 100
2017-07-02 14:24:26 +00:00
p.profile-field.osu(title="osu! Level " + toString(int(viewUser.Accounts.Osu.Level)) + " | Accuracy: " + fmt.Sprintf("%.1f", viewUser.Accounts.Osu.Accuracy) + "%")
2017-06-08 12:46:38 +00:00
Icon("trophy")
2017-07-02 14:24:26 +00:00
a(href="https://osu.ppy.sh/u/" + viewUser.Accounts.Osu.Nick, target="_blank", rel="noopener")= toString(int(viewUser.Accounts.Osu.PP)) + " pp"
2017-06-22 14:21:26 +00:00
2017-11-21 17:05:43 +00:00
if viewUser.Accounts.Overwatch.BattleTag != "" && viewUser.Accounts.Overwatch.SkillRating >= 1000
p.profile-field.overwatch(title=arn.Capitalize(viewUser.Accounts.Overwatch.Tier) + " (Overwatch)")
Icon("overwatch")
2018-03-03 19:44:48 +00:00
a(href="https://playoverwatch.com/en-us/career/pc/" + strings.Replace(viewUser.Accounts.Overwatch.BattleTag, "#", "-", 1), target="_blank", rel="noopener")= toString(viewUser.Accounts.Overwatch.SkillRating) + " SR"
2017-11-21 17:05:43 +00:00
2016-11-20 10:26:11 +00:00
//- if viewUser.dataEditCount
//- p.profile-field.editor-contribution(title="Anime data modifications")
//- Icon("edit")
//- span= viewUser.dataEditCount
2017-06-22 14:21:26 +00:00
2016-11-20 10:26:11 +00:00
if viewUser.Registered != ""
p.profile-field.registration-date(title="Member since")
Icon("calendar")
//- span= time.Parse(time.RFC3339, viewUser.Registered)
2017-06-06 14:59:04 +00:00
span= viewUser.RegisteredTime().Format("Jan 2006")
2016-11-20 10:26:11 +00:00
//- span= monthNames[joined.getMonth()] + ' ' + joined.getFullYear()
2017-06-22 14:21:26 +00:00
2016-11-20 10:26:11 +00:00
if viewUser.Role != ""
p.profile-field.role
Icon("rocket")
span= arn.Capitalize(viewUser.Role)
2017-11-09 17:31:32 +00:00
2017-10-07 08:01:55 +00:00
if viewUser.IsPro()
p.profile-field.profile-pro-status
a.ajax(href="/shop", title="PRO user")
Icon("star")
span.profile-pro-status-text PRO
2017-11-09 17:31:32 +00:00
2018-03-16 04:40:29 +00:00
.profile-actions
if user != nil && user.ID != viewUser.ID
if !user.Follows().Contains(viewUser.ID)
button.profile-action.action(data-action="followUser", data-trigger="click", data-api="/api/userfollows/" + user.ID + "/add/" + viewUser.ID)
Icon("user-plus")
span Follow
else
button.profile-action.action(data-action="unfollowUser", data-trigger="click", data-api="/api/userfollows/" + user.ID + "/remove/" + viewUser.ID)
Icon("user-times")
span Unfollow
a.button.profile-action.ajax(href="/+" + viewUser.Nick + "/animelist/watching")
Icon("list")
span Anime list
if user != nil && user.ID != viewUser.ID
a.button.profile-action.ajax(href="/compare/animelist/" + user.Nick + "/" + viewUser.Nick)
Icon("exchange")
span Compare
a.button.profile-action.ajax(href="/+" + viewUser.Nick + "/recommended/anime")
Icon("archive")
span Recomms