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.

116 lines
5.0 KiB

  1. import moment from "moment"
  2. <div class=["comment", "mode-" + input.mode.toLowerCase()]>
  3. <if (input.mode === "Message")>
  4. <div class="metadata">
  5. <div class="options color-menu">
  6. <if-permitted user=input.user author=input.comment.author permission="story.edit">
  7. <a on-click("emit", "open", "editComment", input.comment) >Edit</a>
  8. </if-permitted>
  9. <if-permitted user=input.user author=input.comment.author permission="story.edit">
  10. <a on-click("emit", "open", "removeComment", input.comment) >Remove</a>
  11. </if-permitted>
  12. </div>
  13. <chapter-meta weak kind="date" value=input.comment.createdDate />
  14. <chapter-meta weak kind="author" value=input.comment.author />
  15. </div>
  16. <div class="content color-blockquote">
  17. <table class="header">
  18. <tbody>
  19. <tr if(input.comment.subject != "")>
  20. <th>Subject:</th>
  21. <td>${input.comment.subject}</td>
  22. </tr>
  23. <tr>
  24. <th>From:</th>
  25. <td>
  26. <div if(input.comment.character != null) class="tooltip" style="display: inline-block">
  27. <span>${input.comment.characterName}</span>
  28. <div class="tooltip-content color-highlight-dark">
  29. <h1>${input.comment.character.name}</h1>
  30. <h2>${input.comment.character.author}</h2>
  31. <markdown source=input.comment.character.description />
  32. </div>
  33. </div>
  34. <div else>
  35. <span class="tooltip color-primary">
  36. <span>${input.comment.characterName}</span>
  37. <div class="tooltip-content color-highlight-dark color-primary">
  38. <h1>(Unknown Character)</h1>
  39. <h2>${input.comment.author}</h2>
  40. </div>
  41. </span>
  42. </div>
  43. </td>
  44. </tr>
  45. <tr if(input.comment.fictionalDate != null)>
  46. <th>Date:</th>
  47. <td>${moment(input.comment.fictionalDate).format("MMM D, YYYY")}</td>
  48. </tr>
  49. </tbody>
  50. </table>
  51. <markdown class="body" source=input.comment.source />
  52. </div>
  53. </if>
  54. <if(input.mode === "Chat")>
  55. <div class="content">
  56. <div class="options color-menu">
  57. <if-permitted user=input.user author=input.comment.author permission="story.edit">
  58. <a on-click("emit", "open", "editComment", input.comment) >Edit</a>
  59. </if-permitted>
  60. <if-permitted user=input.user author=input.comment.author permission="story.edit">
  61. <a on-click("emit", "open", "removeComment", input.comment) >Remove</a>
  62. </if-permitted>
  63. </div>
  64. <for (paragraph in state.paragraphs)>
  65. <div class="message-text color-text">
  66. <markdown class="body" source=paragraph>
  67. <span class="decoration color-menu">[</span>
  68. <date class="color-menu" value=input.comment.fictionalDate></date>
  69. <span class="decoration color-menu">]&nbsp;</span>
  70. <span class="decoration color-menu">&lt;</span>
  71. <span if(input.comment.character != null) class="tooltip color-primary">
  72. <span>${input.comment.characterName}</span>
  73. <div class="tooltip-content color-highlight-dark color-primary">
  74. <h1>${input.comment.character.name}</h1>
  75. <h2>${input.comment.character.author}</h2>
  76. <markdown source=input.comment.character.description />
  77. </div>
  78. </span>
  79. <span class="tooltip color-primary" else>
  80. <span>${input.comment.characterName}</span>
  81. <div class="tooltip-content color-highlight-dark color-primary">
  82. <h1>(Unknown Character)</h1>
  83. <h2>${input.comment.author}</h2>
  84. </div>
  85. </span>
  86. <span class="decoration color-menu">&gt;&nbsp;</span>
  87. </markdown>
  88. </div>
  89. </for>
  90. </div>
  91. </if>
  92. <if(input.mode === "Article")>
  93. <div class="metadata">
  94. <div class="options color-menu">
  95. <if-permitted user=input.user author=input.comment.author permission="story.edit">
  96. <a on-click("emit", "open", "editComment", input.comment) >Edit</a>
  97. </if-permitted>
  98. <if-permitted user=input.user author=input.comment.author permission="story.edit">
  99. <a on-click("emit", "open", "removeComment", input.comment) >Remove</a>
  100. </if-permitted>
  101. </div>
  102. <chapter-meta kind="title" value=input.comment.subject />
  103. <chapter-meta kind="name" value=input.comment.characterName character=(input.comment.character) ukAuthor=input.comment.author />
  104. <chapter-meta kind="date" value=input.comment.fictionalDate />
  105. <chapter-meta weak kind="date" value=input.comment.createdDate />
  106. <chapter-meta weak kind="author" value=input.comment.author />
  107. </div>
  108. <div class="content color-text">
  109. <markdown class="body" source=input.comment.source />
  110. </div>
  111. </if>
  112. </div>