130 lines
5.3 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.tip(href=item.Anime().Link(), aria-label=item.Anime().Title.ByUser(user) + " (" + fmt.Sprint(item.Episodes) + " / " + arn.EpisodesToString(item.Anime().EpisodeCount) + ")")
img.profile-watching-list-item-image.lazy(data-src=item.Anime().ImageLink("small"), data-webp="true", data-color=item.Anime().AverageColor(), alt=item.Anime().Title.ByUser(user), importance="high")
2017-11-11 14:47:03 +00:00
2018-02-24 14:35:34 +00:00
.footer
2018-04-19 14:23:14 +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)
2018-04-19 14:23:14 +00:00
Tab("Characters", "child", "/+" + viewUser.Nick + "/characters/liked")
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")
2018-03-14 10:57:40 +00:00
if strings.Contains(uri, "/soundtracks")
.tabs
Tab("Liked", "heart", "/+" + viewUser.Nick + "/soundtracks/liked")
2018-04-13 20:45:58 +00:00
Tab("Added", "plus", "/+" + 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")
2018-04-13 20:45:58 +00:00
Tab("Added", "plus", "/+" + viewUser.Nick + "/quotes/added")
2018-03-19 11:25:31 +00:00
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
p.profile-field.osu(title="osu! Level " + fmt.Sprint(int(viewUser.Accounts.Osu.Level)) + " | Accuracy: " + fmt.Sprintf("%.1f", viewUser.Accounts.Osu.Accuracy) + "%")
2017-06-08 12:46:38 +00:00
Icon("trophy")
a(href="https://osu.ppy.sh/u/" + viewUser.Accounts.Osu.Nick, target="_blank", rel="noopener")= fmt.Sprint(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=stringutils.Capitalize(viewUser.Accounts.Overwatch.Tier) + " (Overwatch)")
2017-11-21 17:05:43 +00:00
Icon("overwatch")
a(href="https://playoverwatch.com/en-us/career/pc/" + strings.Replace(viewUser.Accounts.Overwatch.BattleTag, "#", "-", 1), target="_blank", rel="noopener")= fmt.Sprint(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= stringutils.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(href="/shop", title="PRO user")
2017-10-07 08:01:55 +00:00
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(href="/+" + viewUser.Nick + "/animelist/watching")
2018-03-16 04:40:29 +00:00
Icon("list")
span Anime list
if user != nil && user.ID != viewUser.ID
a.button.profile-action(href="/compare/animelist/" + user.Nick + "/" + viewUser.Nick)
2018-03-16 04:40:29 +00:00
Icon("exchange")
span Compare
a.button.profile-action(href="/+" + viewUser.Nick + "/recommended/anime")
2018-03-16 04:40:29 +00:00
Icon("archive")
span Recomms
2018-04-09 11:44:02 +00:00
if user != nil && (user.Role == "editor" || user.Role == "admin")
a.button.profile-action(href="/+" + viewUser.Nick + "/log")
Icon("edit")
span Log