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.

36 lines
1.8 KiB

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