The frontend/UI server, written in JS using the MarkoJS library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.7 KiB

  1. <div if(!state.removed) class=["post", component.kindClass("pk-"), state.multipart ? "multipart" : null]>
  2. <div class="post-meta-row">
  3. <div class="options color-menu">
  4. <if-permitted user=input.user permission="post.move">
  5. <a on-click("move", -1, true)>Up</a>
  6. <a on-click("move", +1, true)>Down</a>
  7. </if-permitted>
  8. <if-permitted user=input.user permission="post.edit">
  9. <a on-click("open", "edit") >Edit</a>
  10. </if-permitted>
  11. <if-permitted user=input.user permission="post.remove">
  12. <a on-click("open", "remove")>Remove</a>
  13. </if-permitted>
  14. </div>
  15. <post-meta kind="timestamp" value=input.post.time />
  16. <post-meta kind="nick" class=("pk-"+input.post.kind) value=input.post.nick />
  17. </div>
  18. <div if(input.post.kind.startsWith("annotation.")) class="post-body" >
  19. <annotation level=(input.post.kind.substring(11))>
  20. <markdown class="post-content" source=state.text />
  21. </annotation>
  22. </div>
  23. <div if(input.post.kind === "scene") class="post-body color-text">
  24. <markdown class="post-content post-scene" source=state.text />
  25. </div>
  26. <div if(input.post.kind === "action") class="post-body color-text">
  27. $ const prefix = (!state.multipart ? state.shortName + state.nameSuffix + " " : "");
  28. <markdown class="post-content post-action" source=(prefix + state.text) />
  29. </div>
  30. <div if(input.post.kind === "text") class="post-body color-text">
  31. <markdown class="post-content post-text" source=state.text />
  32. </div>
  33. <remove-post-modal enabled=(state.modal === "remove") post=input.post on-close("close") on-remove("remove") />
  34. <edit-post-modal enabled=(state.modal === "edit") post=input.post on-close("close") on-edited("edited") />
  35. </div>