32 lines
1.0 KiB
Plaintext
32 lines
1.0 KiB
Plaintext
component Thread(thread *arn.Thread, user *arn.User)
|
|
h1.thread-title= thread.Title
|
|
|
|
#thread.thread(data-id=thread.ID)
|
|
.posts
|
|
Postable(thread, user, true, false, thread.Creator().ID)
|
|
|
|
//- Reply
|
|
if user != nil
|
|
if thread.Locked
|
|
footer.footer.mountable
|
|
p.text-center This topic is locked.
|
|
else
|
|
NewPostArea(thread, user, "Reply")
|
|
|
|
.buttons
|
|
if !thread.Locked
|
|
NewPostActions(thread, false)
|
|
|
|
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 |