2018-11-05 10:05:36 +00:00
|
|
|
component Thread(thread *arn.Thread, user *arn.User)
|
2018-04-25 16:59:23 +00:00
|
|
|
h1.thread-title= thread.Title
|
|
|
|
|
|
|
|
#thread.thread(data-id=thread.ID)
|
|
|
|
.posts
|
2018-11-05 10:05:36 +00:00
|
|
|
Postable(thread, user, true, "", thread.Creator().ID)
|
2018-04-25 16:59:23 +00:00
|
|
|
|
|
|
|
//- Reply
|
|
|
|
if user != nil
|
|
|
|
if thread.Locked
|
|
|
|
footer.footer.mountable
|
|
|
|
p.text-center This topic is locked.
|
|
|
|
else
|
|
|
|
NewPostArea(user, "Reply")
|
|
|
|
|
|
|
|
.buttons
|
|
|
|
if !thread.Locked
|
2018-11-05 12:04:47 +00:00
|
|
|
NewPostActions("Thread", thread.ID, false)
|
2018-04-25 16:59:23 +00:00
|
|
|
|
|
|
|
if user.Role == "admin" || user.Role == "editor"
|
|
|
|
if thread.Locked
|
|
|
|
button.mountable.action(data-action="unlockThread", data-trigger="click", data-api="/api/thread/" + thread.ID)
|
|
|
|
Icon("unlock")
|
|
|
|
span Unlock
|
|
|
|
else
|
|
|
|
button.mountable.action(data-action="lockThread", data-trigger="click", data-api="/api/thread/" + thread.ID)
|
|
|
|
Icon("lock")
|
|
|
|
span Lock
|
|
|
|
|
|
|
|
button.mountable.action(data-action="deleteObject", data-trigger="click", data-return-path="/forum", data-confirm-type="thread", data-api="/api/thread/" + thread.ID)
|
|
|
|
Icon("trash")
|
|
|
|
span Delete
|