Added posts to profile

This commit is contained in:
FM1337
2017-06-22 11:21:26 -03:00
parent ba84bd5488
commit ad7bc381ac
5 changed files with 89 additions and 15 deletions

View File

@ -26,7 +26,7 @@ func Profile(ctx *aero.Context, viewUser *arn.User) string {
var user *arn.User
var threads []*arn.Thread
var animeList *arn.AnimeList
var posts []*arn.Post
aero.Parallel(func() {
user = utils.GetUser(ctx)
}, func() {
@ -39,7 +39,13 @@ func Profile(ctx *aero.Context, viewUser *arn.User) string {
if len(threads) > maxPosts {
threads = threads[:maxPosts]
}
})
},
func() {
posts = viewUser.Posts()
if len(posts) > maxPosts {
posts = posts[:maxPosts]
}
})
return ctx.HTML(components.Profile(viewUser, user, animeList, threads))
return ctx.HTML(components.Profile(viewUser, user, animeList, threads, posts))
}