Forum activity shown in user profiles

This commit is contained in:
2017-06-08 14:46:38 +02:00
parent 4a6e4378ce
commit 4f7ef694c8
13 changed files with 100 additions and 44 deletions

View File

@ -0,0 +1,24 @@
package threads
import (
"net/http"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
)
// GetByUser ...
func GetByUser(ctx *aero.Context) string {
nick := ctx.Get("nick")
user, err := arn.GetUserByNick(nick)
if err != nil {
return ctx.Error(http.StatusNotFound, "User not found", err)
}
threads := user.Threads()
arn.SortThreadsByDate(threads)
return ctx.HTML(components.ThreadList(threads))
}