diff --git a/mixins/NewPostArea.pixy b/mixins/NewPostArea.pixy index b267374c..4411df50 100644 --- a/mixins/NewPostArea.pixy +++ b/mixins/NewPostArea.pixy @@ -6,12 +6,13 @@ component NewPostArea(user *arn.User, placeholder string) textarea#new-post-text.post-content(placeholder=placeholder + "...", aria-label=placeholder) -component NewPostActions(parentType string, parentID string) +component NewPostActions(parentType string, parentID string, cancelButton bool) #new-post-actions.buttons button#reply-button.mountable.action(data-action="createPost", data-trigger="click", data-parent-type=parentType, data-parent-id=parentID) Icon("mail-reply") span Reply - button#reply-cancel-button.mountable.action(data-action="cancelReply", data-trigger="click") - Icon("close") - span Cancel \ No newline at end of file + if cancelButton + button#reply-cancel-button.mountable.action(data-action="cancelReply", data-trigger="click") + Icon("close") + span Cancel \ No newline at end of file diff --git a/pages/post/reply-ui.go b/pages/post/reply-ui.go index c96101be..5f62f859 100644 --- a/pages/post/reply-ui.go +++ b/pages/post/reply-ui.go @@ -19,5 +19,5 @@ func ReplyUI(ctx *aero.Context) string { return ctx.Error(http.StatusNotFound, "Post not found", err) } - return ctx.HTML(components.NewPostArea(user, "Reply") + components.NewPostActions(post.Type(), post.ID)) + return ctx.HTML(components.NewPostArea(user, "Reply") + components.NewPostActions(post.Type(), post.ID, true)) } diff --git a/pages/thread/reply-ui.go b/pages/thread/reply-ui.go index 43afe342..7d15a081 100644 --- a/pages/thread/reply-ui.go +++ b/pages/thread/reply-ui.go @@ -19,5 +19,5 @@ func ReplyUI(ctx *aero.Context) string { return ctx.Error(http.StatusNotFound, "Thread not found", err) } - return ctx.HTML(components.NewPostArea(user, "Reply") + components.NewPostActions(thread.Type(), thread.ID)) + return ctx.HTML(components.NewPostArea(user, "Reply") + components.NewPostActions(thread.Type(), thread.ID, true)) } diff --git a/pages/thread/thread.pixy b/pages/thread/thread.pixy index 1840460e..6b6ffeb1 100644 --- a/pages/thread/thread.pixy +++ b/pages/thread/thread.pixy @@ -15,7 +15,7 @@ component Thread(thread *arn.Thread, user *arn.User) .buttons if !thread.Locked - NewPostActions("Thread", thread.ID) + NewPostActions("Thread", thread.ID, false) if user.Role == "admin" || user.Role == "editor" if thread.Locked