2017-07-06 01:24:56 +00:00
|
|
|
component ProfileHeader(viewUser *arn.User, user *arn.User, uri string)
|
2016-11-20 10:26:11 +00:00
|
|
|
.profile
|
2017-06-15 13:50:39 +00:00
|
|
|
img.profile-cover(src=viewUser.CoverImageURL(), 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
|
|
|
|
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-07-21 06:09:22 +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-07-21 08:10:48 +00:00
|
|
|
if user != nil
|
|
|
|
.profile-actions
|
|
|
|
if user.ID != viewUser.ID
|
|
|
|
if !user.Follows().Contains(viewUser.ID)
|
2017-10-13 11:55:33 +00:00
|
|
|
button.profile-action.action(data-action="followUser", data-trigger="click", data-api="/api/userfollows/" + user.ID + "/add/" + viewUser.ID)
|
2017-07-21 08:10:48 +00:00
|
|
|
Icon("user-plus")
|
|
|
|
span Follow
|
|
|
|
else
|
2017-10-13 11:55:33 +00:00
|
|
|
button.profile-action.action(data-action="unfollowUser", data-trigger="click", data-api="/api/userfollows/" + user.ID + "/remove/" + viewUser.ID)
|
2017-07-21 08:10:48 +00:00
|
|
|
Icon("user-times")
|
|
|
|
span Unfollow
|
2017-07-03 15:21:00 +00:00
|
|
|
|
2017-07-06 01:24:56 +00:00
|
|
|
ProfileNavigation(viewUser, uri)
|
2017-07-03 15:21:00 +00:00
|
|
|
|
2017-07-06 01:24:56 +00:00
|
|
|
component ProfileNavigation(viewUser *arn.User, uri string)
|
2017-07-22 13:04:54 +00:00
|
|
|
.tabs
|
|
|
|
a.tab.action(href="/+" + viewUser.Nick, data-action="diff", data-trigger="click")
|
2017-07-03 15:21:00 +00:00
|
|
|
Icon("th")
|
|
|
|
span.tab-text Anime
|
|
|
|
|
2017-07-22 13:04:54 +00:00
|
|
|
a.tab.action(href="/+" + viewUser.Nick + "/animelist/watching", data-action="diff", data-trigger="click")
|
2017-07-03 15:21:00 +00:00
|
|
|
Icon("list")
|
2017-07-03 15:33:57 +00:00
|
|
|
span.tab-text Collection
|
2017-07-03 15:21:00 +00:00
|
|
|
|
2017-07-22 13:04:54 +00:00
|
|
|
a.tab.action(href="/+" + viewUser.Nick + "/threads", data-action="diff", data-trigger="click")
|
2017-07-03 15:21:00 +00:00
|
|
|
Icon("comment")
|
|
|
|
span.tab-text Threads
|
|
|
|
|
2017-07-22 13:04:54 +00:00
|
|
|
a.tab.action(href="/+" + viewUser.Nick + "/posts", data-action="diff", data-trigger="click")
|
2017-07-03 15:21:00 +00:00
|
|
|
Icon("comments")
|
|
|
|
span.tab-text Posts
|
|
|
|
|
2017-07-22 13:04:54 +00:00
|
|
|
a.tab.action(href="/+" + viewUser.Nick + "/soundtracks", data-action="diff", data-trigger="click")
|
2017-07-03 15:21:00 +00:00
|
|
|
Icon("music")
|
|
|
|
span.tab-text Tracks
|
2017-07-13 00:32:36 +00:00
|
|
|
|
2017-07-22 13:04:54 +00:00
|
|
|
a.tab.action(href="/+" + viewUser.Nick + "/stats", data-action="diff", data-trigger="click")
|
2017-07-13 00:32:36 +00:00
|
|
|
Icon("area-chart")
|
|
|
|
span.tab-text Stats
|
2017-07-21 09:01:34 +00:00
|
|
|
|
2017-07-22 13:04:54 +00:00
|
|
|
a.tab.action(href="/+" + viewUser.Nick + "/followers", data-action="diff", data-trigger="click")
|
2017-07-21 09:01:34 +00:00
|
|
|
Icon("users")
|
|
|
|
span.tab-text Followers
|
2017-07-05 14:52:24 +00:00
|
|
|
|
2017-07-12 22:34:33 +00:00
|
|
|
if strings.Contains(uri, "/animelist")
|
|
|
|
StatusTabs("/+" + viewUser.Nick + "/animelist")
|
2016-11-20 10:26:11 +00:00
|
|
|
|
2017-07-06 01:24:56 +00:00
|
|
|
component Profile(viewUser *arn.User, user *arn.User, animeList *arn.AnimeList, threads []*arn.Thread, posts []*arn.Post, tracks []*arn.SoundTrack, uri string)
|
|
|
|
ProfileHeader(viewUser, user, uri)
|
2017-06-22 14:21:26 +00:00
|
|
|
|
2017-07-03 15:33:57 +00:00
|
|
|
if len(animeList.Items) == 0
|
|
|
|
p.no-data.mountable= viewUser.Nick + " hasn't added any anime yet."
|
|
|
|
else
|
|
|
|
.profile-watching-list.mountable
|
2017-07-03 15:21:00 +00:00
|
|
|
each item in animeList.Items
|
2017-07-12 22:34:33 +00:00
|
|
|
if item.Status == arn.AnimeListStatusWatching || item.Status == arn.AnimeListStatusCompleted
|
|
|
|
a.profile-watching-list-item.ajax(href=item.Anime().Link(), title=item.Anime().Title.Canonical + " (" + toString(item.Episodes) + " / " + arn.EpisodesToString(item.Anime().EpisodeCount) + ")")
|
2017-07-17 22:04:43 +00:00
|
|
|
img.profile-watching-list-item-image.lazy(data-src=item.Anime().Image.Tiny, alt=item.Anime().Title.Canonical)
|
2017-06-27 15:51:15 +00:00
|
|
|
|
2017-07-21 10:55:36 +00:00
|
|
|
if user != nil && (user.Role == "admin" || user.Role == "editor")
|
|
|
|
.footer
|
|
|
|
.buttons
|
|
|
|
a.button.profile-action(href="/api/user/" + viewUser.ID, target="_blank", rel="noopener")
|
|
|
|
Icon("search-plus")
|
|
|
|
span JSON
|
|
|
|
|
2017-07-03 15:21:00 +00:00
|
|
|
//- .profile-category.mountable
|
|
|
|
//- h3
|
|
|
|
//- a.ajax(href="/+" + viewUser.Nick + "/threads", title="View all threads") Threads
|
2017-06-22 14:21:26 +00:00
|
|
|
|
2017-07-03 15:21:00 +00:00
|
|
|
//- if len(threads) == 0
|
|
|
|
//- p No threads on the forum.
|
|
|
|
//- else
|
|
|
|
//- each thread in threads
|
|
|
|
//- ThreadLink(thread)
|
2017-06-27 15:51:15 +00:00
|
|
|
|
2017-07-03 15:21:00 +00:00
|
|
|
//- .profile-category.mountable
|
|
|
|
//- h3
|
|
|
|
//- a.ajax(href="/+" + viewUser.Nick + "/posts", title="View all posts") Posts
|
|
|
|
//- if len(posts) == 0
|
|
|
|
//- p No posts on the forum.
|
|
|
|
//- else
|
|
|
|
//- each post in posts
|
|
|
|
//- .post
|
|
|
|
//- .post-author
|
|
|
|
//- Avatar(post.Author())
|
|
|
|
//- .post-content
|
|
|
|
//- div!= post.HTML()
|
|
|
|
//- .post-toolbar.active
|
|
|
|
//- .spacer
|
|
|
|
//- .post-likes= len(post.Likes)
|
2017-06-23 14:41:24 +00:00
|
|
|
|
2017-07-03 15:21:00 +00:00
|
|
|
//- .profile-category.mountable
|
|
|
|
//- h3
|
|
|
|
//- a.ajax(href="/+" + viewUser.Nick + "/tracks", title="View all tracks") Tracks
|
2017-06-27 15:51:15 +00:00
|
|
|
|
2017-07-03 15:21:00 +00:00
|
|
|
//- if len(tracks) == 0
|
|
|
|
//- p No soundtracks posted yet.
|
|
|
|
//- else
|
|
|
|
//- .sound-tracks
|
|
|
|
//- each track in tracks
|
|
|
|
//- SoundTrack(track)
|
2017-06-27 15:51:15 +00:00
|
|
|
|
2017-06-24 16:15:39 +00:00
|
|
|
//- if user != nil && user.Role == "admin"
|
|
|
|
//- .footer
|
|
|
|
//- a(href="/api/user/" + viewUser.ID) User API
|