152 lines
5.4 KiB
Plaintext

component ProfileHeader(viewUser *arn.User, user *arn.User, uri string)
.profile
img.profile-cover(src=viewUser.CoverImageURL(), alt="Cover image")
.profile-image-container.mountable.never-unmount
ProfileImage(viewUser)
.intro-container.mountable.never-unmount
h1#nick= viewUser.Nick
if viewUser.Tagline != ""
p.profile-field.tagline
Icon("comment")
span.tagline-text= viewUser.Tagline
else
p.profile-field.tagline
Icon("comment")
span.tagline-text No tagline yet.
if viewUser.Website != ""
p.profile-field.website
Icon("home")
a(href=viewUser.WebsiteURL(), target="_blank", rel="nofollow")= viewUser.WebsiteShortURL()
if viewUser.Accounts.Osu.Nick != "" && viewUser.Accounts.Osu.PP >= 100
p.profile-field.osu(title="osu! Level " + toString(int(viewUser.Accounts.Osu.Level)) + " | Accuracy: " + fmt.Sprintf("%.1f", viewUser.Accounts.Osu.Accuracy) + "%")
Icon("trophy")
a(href="https://osu.ppy.sh/u/" + viewUser.Accounts.Osu.Nick, target="_blank", rel="noopener")= toString(int(viewUser.Accounts.Osu.PP)) + " pp"
//- if viewUser.dataEditCount
//- p.profile-field.editor-contribution(title="Anime data modifications")
//- Icon("edit")
//- span= viewUser.dataEditCount
if viewUser.Registered != ""
p.profile-field.registration-date(title="Member since")
Icon("calendar")
//- span= time.Parse(time.RFC3339, viewUser.Registered)
span= viewUser.RegisteredTime().Format("Jan 2006")
//- span= monthNames[joined.getMonth()] + ' ' + joined.getFullYear()
if viewUser.Role != ""
p.profile-field.role
Icon("rocket")
span= arn.Capitalize(viewUser.Role)
if user != nil
.profile-actions
if 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", data-view-user-id=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", data-view-user-id=viewUser.ID)
Icon("user-times")
span Unfollow
ProfileNavigation(viewUser, uri)
component ProfileNavigation(viewUser *arn.User, uri string)
.tabs
a.tab.action(href="/+" + viewUser.Nick, data-action="diff", data-trigger="click")
Icon("th")
span.tab-text Anime
a.tab.action(href="/+" + viewUser.Nick + "/animelist/watching", data-action="diff", data-trigger="click")
Icon("list")
span.tab-text Collection
a.tab.action(href="/+" + viewUser.Nick + "/threads", data-action="diff", data-trigger="click")
Icon("comment")
span.tab-text Threads
a.tab.action(href="/+" + viewUser.Nick + "/posts", data-action="diff", data-trigger="click")
Icon("comments")
span.tab-text Posts
a.tab.action(href="/+" + viewUser.Nick + "/soundtracks", data-action="diff", data-trigger="click")
Icon("music")
span.tab-text Tracks
a.tab.action(href="/+" + viewUser.Nick + "/stats", data-action="diff", data-trigger="click")
Icon("area-chart")
span.tab-text Stats
a.tab.action(href="/+" + viewUser.Nick + "/followers", data-action="diff", data-trigger="click")
Icon("users")
span.tab-text Followers
if strings.Contains(uri, "/animelist")
StatusTabs("/+" + viewUser.Nick + "/animelist")
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)
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.Canonical + " (" + toString(item.Episodes) + " / " + arn.EpisodesToString(item.Anime().EpisodeCount) + ")")
img.profile-watching-list-item-image.lazy(data-src=item.Anime().Image.Tiny, alt=item.Anime().Title.Canonical)
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
//- .profile-category.mountable
//- h3
//- a.ajax(href="/+" + viewUser.Nick + "/threads", title="View all threads") Threads
//- if len(threads) == 0
//- p No threads on the forum.
//- else
//- each thread in threads
//- ThreadLink(thread)
//- .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)
//- .profile-category.mountable
//- h3
//- a.ajax(href="/+" + viewUser.Nick + "/tracks", title="View all tracks") Tracks
//- if len(tracks) == 0
//- p No soundtracks posted yet.
//- else
//- .sound-tracks
//- each track in tracks
//- SoundTrack(track)
//- if user != nil && user.Role == "admin"
//- .footer
//- a(href="/api/user/" + viewUser.ID) User API