Threaded comments (Reply UI)
This commit is contained in:
23
pages/thread/reply-ui.go
Normal file
23
pages/thread/reply-ui.go
Normal file
@ -0,0 +1,23 @@
|
||||
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)
|
||||
}
|
||||
|
||||
return ctx.HTML(components.NewPostArea(user, "Reply") + components.NewPostActions(thread.Type(), thread.ID))
|
||||
}
|
@ -15,9 +15,7 @@ component Thread(thread *arn.Thread, user *arn.User)
|
||||
|
||||
.buttons
|
||||
if !thread.Locked
|
||||
button.mountable.action(data-action="createPost", data-trigger="click", data-parent-type="Thread", data-parent-id=thread.ID)
|
||||
Icon("mail-reply")
|
||||
span Reply
|
||||
NewPostActions("Thread", thread.ID)
|
||||
|
||||
if user.Role == "admin" || user.Role == "editor"
|
||||
if thread.Locked
|
||||
|
@ -11,6 +11,9 @@
|
||||
vertical
|
||||
margin-bottom 1.75rem
|
||||
|
||||
:last-child
|
||||
margin-bottom 0
|
||||
|
||||
.post-author
|
||||
margin-bottom 0.25rem
|
||||
|
||||
@ -25,9 +28,12 @@
|
||||
margin-top 0.75rem
|
||||
margin-left content-padding
|
||||
|
||||
:empty
|
||||
margin-top 0
|
||||
|
||||
> 600px
|
||||
.post
|
||||
margin-bottom 0
|
||||
margin-bottom 0.75rem
|
||||
|
||||
.post-author
|
||||
margin-bottom 0
|
||||
|
Reference in New Issue
Block a user