Threaded comments (Reply UI)
This commit is contained in:
23
pages/post/reply-ui.go
Normal file
23
pages/post/reply-ui.go
Normal file
@ -0,0 +1,23 @@
|
||||
package post
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
)
|
||||
|
||||
// ReplyUI renders a new post area.
|
||||
func ReplyUI(ctx *aero.Context) string {
|
||||
id := ctx.Get("id")
|
||||
user := utils.GetUser(ctx)
|
||||
post, err := arn.GetPost(id)
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusNotFound, "Post not found", err)
|
||||
}
|
||||
|
||||
return ctx.HTML(components.NewPostArea(user, "Reply") + components.NewPostActions(post.Type(), post.ID))
|
||||
}
|
Reference in New Issue
Block a user