Improved user profiles
This commit is contained in:
parent
dd974ed99a
commit
4f6ffd969d
@ -4,7 +4,7 @@ component AnimeLists(animeLists map[string]*arn.AnimeList, viewUser *arn.User, u
|
||||
h2.page-title.anime-list-owner= viewUser.Nick + "'s collection"
|
||||
|
||||
if len(animeLists[arn.AnimeListStatusWatching].Items) == 0 && len(animeLists[arn.AnimeListStatusCompleted].Items) == 0 && len(animeLists[arn.AnimeListStatusPlanned].Items) == 0 && len(animeLists[arn.AnimeListStatusHold].Items) == 0 && len(animeLists[arn.AnimeListStatusDropped].Items) == 0
|
||||
p.no-data No anime in the collection.
|
||||
p.no-data.mountable= viewUser.Nick + " hasn't added any anime yet."
|
||||
else
|
||||
if len(animeLists[arn.AnimeListStatusWatching].Items) > 0
|
||||
.anime-list-container
|
||||
|
@ -4,7 +4,6 @@ component Forum(tag string, threads []*arn.Thread, threadsPerPage int)
|
||||
.forum
|
||||
ThreadList(threads)
|
||||
|
||||
|
||||
.buttons
|
||||
button#new-thread.action(data-action="load", data-trigger="click", data-url="/new/thread")
|
||||
Icon("plus")
|
||||
@ -16,7 +15,7 @@ component Forum(tag string, threads []*arn.Thread, threadsPerPage int)
|
||||
|
||||
component ThreadList(threads []*arn.Thread)
|
||||
if len(threads) == 0
|
||||
p.no-data No threads found.
|
||||
p.no-data.mountable No threads found.
|
||||
else
|
||||
each thread in threads
|
||||
ThreadLink(thread)
|
@ -5,4 +5,4 @@ component LatestPosts(postables []arn.Postable, viewUser *arn.User, user *arn.Us
|
||||
h2.page-title= len(postables), " latest posts by ", postables[0].Author().Nick
|
||||
PostableList(postables)
|
||||
else
|
||||
p= viewUser.Nick + " hasn't written any posts yet."
|
||||
p.no-data.mountable= viewUser.Nick + " hasn't written any posts yet."
|
@ -54,7 +54,7 @@ component ProfileNavigation(viewUser *arn.User)
|
||||
|
||||
a.button.tab.action(href="/+" + viewUser.Nick + "/animelist", data-action="diff", data-trigger="click")
|
||||
Icon("list")
|
||||
span.tab-text List
|
||||
span.tab-text Collection
|
||||
|
||||
a.button.tab.action(href="/+" + viewUser.Nick + "/threads", data-action="diff", data-trigger="click")
|
||||
Icon("comment")
|
||||
@ -71,10 +71,10 @@ component ProfileNavigation(viewUser *arn.User)
|
||||
component Profile(viewUser *arn.User, user *arn.User, animeList *arn.AnimeList, threads []*arn.Thread, posts []*arn.Post, tracks []*arn.SoundTrack)
|
||||
ProfileHeader(viewUser, user)
|
||||
|
||||
.profile-watching-list.mountable
|
||||
if len(animeList.Items) == 0
|
||||
p.no-data No anime in the collection.
|
||||
p.no-data.mountable= viewUser.Nick + " hasn't added any anime yet."
|
||||
else
|
||||
.profile-watching-list.mountable
|
||||
each item in animeList.Items
|
||||
a.profile-watching-list-item.ajax(href=item.Anime().Link(), title=item.Anime().Title.Canonical + " (" + toString(item.Episodes) + " / " + arn.EpisodesToString(item.Anime().EpisodeCount) + ")")
|
||||
img.anime-cover-image.profile-watching-list-item-image.lazy(data-src=item.Anime().Image.Tiny, alt=item.Anime().Title.Canonical)
|
||||
|
@ -86,6 +86,9 @@ profile-boot-duration = 2s
|
||||
#nick
|
||||
margin-bottom 1rem
|
||||
|
||||
.no-data
|
||||
text-align center
|
||||
|
||||
// Categories
|
||||
|
||||
// .profile-category
|
||||
|
@ -9,6 +9,8 @@ import (
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
)
|
||||
|
||||
const maxThreads = 20
|
||||
|
||||
// GetThreadsByUser shows all forum threads of a particular user.
|
||||
func GetThreadsByUser(ctx *aero.Context) string {
|
||||
nick := ctx.Get("nick")
|
||||
@ -21,5 +23,9 @@ func GetThreadsByUser(ctx *aero.Context) string {
|
||||
threads := viewUser.Threads()
|
||||
arn.SortThreadsLatestFirst(threads)
|
||||
|
||||
if len(threads) > maxThreads {
|
||||
threads = threads[:maxThreads]
|
||||
}
|
||||
|
||||
return ctx.HTML(components.ProfileThreads(threads, viewUser, utils.GetUser(ctx)))
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
component ProfileThreads(threads []*arn.Thread, viewUser *arn.User, user *arn.User)
|
||||
ProfileHeader(viewUser, user)
|
||||
|
||||
if len(threads) == 0
|
||||
p.no-data.mountable= viewUser.Nick + " hasn't written any threads yet."
|
||||
else
|
||||
.forum
|
||||
ThreadList(threads)
|
||||
|
@ -4,7 +4,7 @@ component TrackList(tracks []*arn.SoundTrack, viewUser *arn.User, user *arn.User
|
||||
h2.page-title= "Tracks added by " + viewUser.Nick
|
||||
|
||||
if len(tracks) == 0
|
||||
p.no-data No tracks added.
|
||||
p.no-data.mountable= viewUser.Nick + " hasn't added any tracks yet."
|
||||
else
|
||||
.sound-tracks
|
||||
each track in tracks
|
||||
|
@ -4,7 +4,7 @@ component SearchResults(users []*arn.User, animeResults []*arn.Anime)
|
||||
h3 Users
|
||||
.user-avatars.user-search
|
||||
if len(users) == 0
|
||||
p.no-data No users found.
|
||||
p.no-data.mountable No users found.
|
||||
else
|
||||
each user in users
|
||||
.mountable(data-mountable-type="user")
|
||||
@ -15,7 +15,7 @@ component SearchResults(users []*arn.User, animeResults []*arn.Anime)
|
||||
h3 Anime
|
||||
.profile-watching-list.anime-search
|
||||
if len(animeResults) == 0
|
||||
p.no-data No anime found.
|
||||
p.no-data.mountable No anime found.
|
||||
else
|
||||
each anime in animeResults
|
||||
a.profile-watching-list-item.mountable.ajax(href=anime.Link(), title=anime.Title.Canonical, data-mountable-type="anime")
|
||||
|
Loading…
Reference in New Issue
Block a user