Improved user profiles

This commit is contained in:
2017-07-03 17:33:57 +02:00
parent dd974ed99a
commit 4f6ffd969d
9 changed files with 25 additions and 14 deletions

View File

@ -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)))
}