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.

33 lines
1.9 KiB

  1. import moment from "moment"
  2. <div class="log-suggestions">
  3. <if (input.log.nextLogs.length > 0 || input.log.prevLogs.length > 0)>
  4. <if (input.log.nextLogs.length > 0)>
  5. <h2 class="color-primary">Next Logs</h2>
  6. <div for(s in input.log.nextLogs) class="suggestion color-primary">
  7. <div class="suggestion-header color-primary"><a href=`/logs/${s.log.id}`>${s.log.title || `${s.log.channelName} - ${moment(s.log.date).format("MMMM D, YYYY")}`}</a></div>
  8. <div for(paragraph in (s.log.description||"").split("\n").filter(p => p)) class="suggestion-description color-text">${paragraph}</div>
  9. <div class="suggestion-tags">
  10. <div if(s.hasEvent) class="suggestion-tag color-tag-event">${input.log.eventName}</div>
  11. <div if(s.hasChannel) class="suggestion-tag color-tag-location">${s.log.channelName}</div>
  12. <div for(c in s.characters) class="suggestion-tag color-tag-character">${c.name}</div>
  13. </div>
  14. </div>
  15. </if>
  16. <if (input.log.prevLogs.length > 0)>
  17. <h2 class="color-primary">Previous Logs</h2>
  18. <div for(s in input.log.prevLogs) class="suggestion color-primary">
  19. <div class="suggestion-header color-primary"><a href=`/logs/${s.log.id}`>${s.log.title || `${s.log.channelName} - ${moment(s.log.date).format("MMMM D, YYYY")}`}</a></div>
  20. <div for(paragraph in (s.log.description||"").split("\n").filter(p => p)) class="suggestion-description color-text">${paragraph}</div>
  21. <div class="suggestion-tags">
  22. <div if(s.hasEvent) class="suggestion-tag color-tag-event">${input.log.eventName}</div>
  23. <div if(s.hasChannel) class="suggestion-tag color-tag-location">${s.log.channelName}</div>
  24. <div for(c in s.characters) class="suggestion-tag color-tag-character">${c.name}</div>
  25. </div>
  26. </div>
  27. </if>
  28. </if>
  29. <else>
  30. <div class="empty color-menu">(No suggestions)</div>
  31. </else>
  32. </div>