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
2018-04-25 20:15:42 +00:00
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) + ")")
2018-10-10 10:56:40 +00:00
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)
2018-11-01 08:25:01 +00:00
.tabs.mountable.never-unmount
2017-11-11 14:47:03 +00:00
Tab("Anime", "th", "/+" + viewUser.Nick)
2018-04-19 14:23:14 +00:00
Tab("Characters", "child", "/+" + viewUser.Nick + "/characters/liked")
2017-11-17 10:00:49 +00:00
Tab("Forum", "comment", "/+" + viewUser.Nick + "/forum/threads")
2018-03-14 14:56:57 +00:00
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 19:13:20 +00:00
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
2018-10-31 00:33:56 +00:00
.profile-info.mountable.never-unmount
2017-07-06 20:12:59 +00:00
h1#nick= viewUser.Nick
2018-10-31 00:33:56 +00:00
.profile-introduction!= markdown.Render(viewUser.Introduction)
2018-10-31 01:41:05 +00:00
2018-10-31 00:33:56 +00:00
.profile-tags-container
.profile-tags
a.profile-tag.mountable.never-unmount(href="/+" + viewUser.Nick + "/animelist/watching", data-mountable-type="header")
Icon("list")
span= fmt.Sprintf("%d anime", len(viewUser.AnimeList().Items))
if viewUser.Website != ""
a.profile-tag.mountable.never-unmount(href=viewUser.WebsiteURL(), target="_blank", rel="nofollow", aria-label="Website", data-mountable-type="header")
Icon("home")
span= viewUser.WebsiteShortURL()
//- if viewUser.Accounts.Osu.Nick != "" && viewUser.Accounts.Osu.PP >= 100
//- a.profile-tag.tip.mountable.never-unmount(href="https://osu.ppy.sh/u/" + viewUser.Accounts.Osu.Nick, aria-label="osu! | Level " + fmt.Sprint(int(viewUser.Accounts.Osu.Level)) + " | Accuracy: " + fmt.Sprintf("%.1f", viewUser.Accounts.Osu.Accuracy) + "%", target="_blank", rel="noopener", data-mountable-type="header")
//- Icon("trophy")
//- span= fmt.Sprint(int(viewUser.Accounts.Osu.PP)) + " pp"
//- if viewUser.Accounts.Overwatch.BattleTag != "" && viewUser.Accounts.Overwatch.SkillRating >= 1000
//- a.profile-tag.tip.mountable.never-unmount(href="https://playoverwatch.com/en-us/career/pc/" + strings.Replace(viewUser.Accounts.Overwatch.BattleTag, "#", "-", 1), aria-label=fmt.Sprintf("Overwatch | %s", stringutils.Capitalize(viewUser.Accounts.Overwatch.Tier)), target="_blank", rel="noopener", data-mountable-type="header")
//- Icon("overwatch")
//- span= fmt.Sprint(viewUser.Accounts.Overwatch.SkillRating) + " SR"
//- if viewUser.Accounts.FinalFantasyXIV.Nick != "" && viewUser.Accounts.FinalFantasyXIV.Class != ""
//- .profile-tag.tip.mountable.never-unmount(aria-label=fmt.Sprintf("Final Fantasy XIV | Level %d | IL %d", viewUser.Accounts.FinalFantasyXIV.Level, viewUser.Accounts.FinalFantasyXIV.ItemLevel), data-mountable-type="header")
//- Icon("gamepad")
//- span= viewUser.Accounts.FinalFantasyXIV.Class
if viewUser.Registered != ""
2018-10-31 05:27:48 +00:00
.profile-tag.mountable.never-unmount(title="Member since", data-mountable-type="header")
2018-10-31 00:33:56 +00:00
Icon("calendar")
span= viewUser.RegisteredTime().Format("Jan 2006")
if viewUser.IsPro()
a.profile-tag.mountable.never-unmount(href="/support", aria-label="Supporter", data-mountable-type="header")
Icon("star")
span.profile-pro-status-text PRO
if viewUser.Role != ""
a.profile-tag.mountable.never-unmount(href="/users/staff", aria-label="Staff member", data-mountable-type="header")
Icon("rocket")
span= stringutils.Capitalize(viewUser.Role)
2018-10-31 05:27:48 +00:00
if !viewUser.IsActive()
.profile-tag.mountable.never-unmount(title="Hasn't been online for the past 2 weeks", data-mountable-type="header")
Icon("bed")
span Inactive
2018-10-31 00:33:56 +00:00
//- if user != nil && user.ID != viewUser.ID
//- a.button.profile-action(href="/compare/animelist/" + user.Nick + "/" + viewUser.Nick)
//- Icon("exchange")
//- span Compare
//- a.button.profile-action(href="/+" + viewUser.Nick + "/recommended/anime")
//- Icon("archive")
//- span Recomms
//- if user != nil && (user.Role == "editor" || user.Role == "admin")
//- a.button.profile-action(href="/+" + viewUser.Nick + "/log")
//- Icon("edit")
//- span Log
2018-03-16 04:40:29 +00:00
.profile-actions
if user != nil && user.ID != viewUser.ID
if !user.Follows().Contains(viewUser.ID)
2018-10-31 00:33:56 +00:00
button.profile-action.action.mountable.never-unmount(data-action="followUser", data-trigger="click", data-api="/api/userfollows/" + user.ID + "/add/" + viewUser.ID)
2018-03-16 04:40:29 +00:00
Icon("user-plus")
span Follow
else
2018-10-31 00:33:56 +00:00
button.profile-action.action.mountable.never-unmount(data-action="unfollowUser", data-trigger="click", data-api="/api/userfollows/" + user.ID + "/remove/" + viewUser.ID)
2018-03-16 04:40:29 +00:00
Icon("user-times")
span Unfollow
2018-03-14 19:13:20 +00:00