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.

41 lines
2.1 KiB

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