Disable old profile pages
This commit is contained in:
@ -1,32 +1,32 @@
|
||||
package profile
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
// import (
|
||||
// "net/http"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
)
|
||||
// "github.com/aerogo/aero"
|
||||
// "github.com/animenotifier/arn"
|
||||
// "github.com/animenotifier/notify.moe/components"
|
||||
// "github.com/animenotifier/notify.moe/utils"
|
||||
// )
|
||||
|
||||
const postLimit = 10
|
||||
// const postLimit = 10
|
||||
|
||||
// GetPostsByUser shows all forum posts of a particular user.
|
||||
func GetPostsByUser(ctx *aero.Context) string {
|
||||
nick := ctx.Get("nick")
|
||||
viewUser, err := arn.GetUserByNick(nick)
|
||||
// // GetPostsByUser shows all forum posts of a particular user.
|
||||
// func GetPostsByUser(ctx *aero.Context) string {
|
||||
// nick := ctx.Get("nick")
|
||||
// viewUser, err := arn.GetUserByNick(nick)
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusNotFound, "User not found", err)
|
||||
}
|
||||
// if err != nil {
|
||||
// return ctx.Error(http.StatusNotFound, "User not found", err)
|
||||
// }
|
||||
|
||||
posts := viewUser.Posts()
|
||||
arn.SortPostsLatestFirst(posts)
|
||||
// posts := viewUser.Posts()
|
||||
// arn.SortPostsLatestFirst(posts)
|
||||
|
||||
if len(posts) >= postLimit {
|
||||
posts = posts[:postLimit]
|
||||
}
|
||||
// if len(posts) >= postLimit {
|
||||
// posts = posts[:postLimit]
|
||||
// }
|
||||
|
||||
return ctx.HTML(components.LatestPosts(arn.ToPostables(posts), viewUser, utils.GetUser(ctx), ctx.URI()))
|
||||
// return ctx.HTML(components.LatestPosts(arn.ToPostables(posts), viewUser, utils.GetUser(ctx), ctx.URI()))
|
||||
|
||||
}
|
||||
// }
|
||||
|
Reference in New Issue
Block a user