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.

15 lines
820 B

6 years ago
6 years ago
  1. <menu user=input.user>
  2. <menu-header>${input.story.name}</menu-header>
  3. <for(chapter in input.story.chapters | status-var=loop)>
  4. <menu-link key=chapter.id on-click("select", "chapter", chapter.id) href=("#" + chapter.id) selected=(state.selectedChapter === chapter.id) icon=(loop.getIndex()+1)>${component.chapterTitle(chapter)}</menu-link>
  5. </for>
  6. <if(input.story.open)>
  7. <if-permitted user=input.user permission=["member", "story.edit"]>
  8. <menu-link dark key="_create" on-click("select", "add", null) icon="+">Add Chapter (Open)</menu-link>
  9. </if-permitted>
  10. </if>
  11. <else>
  12. <if-permitted user=input.user author=input.story.author permission="story.edit">
  13. <menu-link dark key="_create" on-click("select", "add", null) icon="+">Add Chapter</menu-link>
  14. </if-permitted>
  15. </else>
  16. </menu>