24 lines
559 B
Go
Raw Normal View History

2018-11-05 11:57:37 +00:00
package thread
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)
thread, err := arn.GetThread(id)
if err != nil {
return ctx.Error(http.StatusNotFound, "Thread not found", err)
}
2018-11-05 12:04:47 +00:00
return ctx.HTML(components.NewPostArea(user, "Reply") + components.NewPostActions(thread.Type(), thread.ID, true))
2018-11-05 11:57:37 +00:00
}