Disable old profile pages
This commit is contained in:
@ -1,31 +1,31 @@
|
||||
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 maxThreads = 20
|
||||
// const maxThreads = 20
|
||||
|
||||
// GetThreadsByUser shows all forum threads of a particular user.
|
||||
func GetThreadsByUser(ctx *aero.Context) string {
|
||||
nick := ctx.Get("nick")
|
||||
viewUser, err := arn.GetUserByNick(nick)
|
||||
// // GetThreadsByUser shows all forum threads of a particular user.
|
||||
// func GetThreadsByUser(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)
|
||||
// }
|
||||
|
||||
threads := viewUser.Threads()
|
||||
arn.SortThreadsLatestFirst(threads)
|
||||
// threads := viewUser.Threads()
|
||||
// arn.SortThreadsLatestFirst(threads)
|
||||
|
||||
if len(threads) > maxThreads {
|
||||
threads = threads[:maxThreads]
|
||||
}
|
||||
// if len(threads) > maxThreads {
|
||||
// threads = threads[:maxThreads]
|
||||
// }
|
||||
|
||||
return ctx.HTML(components.ProfileThreads(threads, viewUser, utils.GetUser(ctx), ctx.URI()))
|
||||
}
|
||||
// return ctx.HTML(components.ProfileThreads(threads, viewUser, utils.GetUser(ctx), ctx.URI()))
|
||||
// }
|
||||
|
Reference in New Issue
Block a user