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.

21 lines
1.6 KiB

6 years ago
6 years ago
  1. <menu user=input.user>
  2. <menu-header>Story</menu-header>
  3. <menu-link key="index" selected=input.selected.index icon="S" href="/story/">Stories</menu-link>
  4. <menu-link if(input.user.loggedIn) key="unlisted" selected=input.selected.unlisted icon="S" href="/story/unlisted/">Unlisted</menu-link>
  5. <menu-link selected=input.selected.tags icon="T" href="/story/tag-list/">Tags</menu-link>
  6. <menu-gap if(input.menuAuthor || input.menuMonth || input.menuTags) />
  7. <if(input.menuMonth != null)>
  8. <menu-link selected=(input.selected.special === "month") icon="M" href=("/story/by-month/"+input.menuMonth.url)>${input.menuMonth.text}</menu-link>
  9. </if>
  10. <if(input.menuAuthor != null)>
  11. <menu-link selected=(input.selected.special === "author") icon="A" href=("/story/by-author/"+input.menuAuthor)>${input.menuAuthor}</menu-link>
  12. </if>
  13. <menu-link for(tag in (input.menuTags||[])) key=(tag.kind+":"+tag.name) selected=(input.selected.tag === tag.kind+":"+tag.name) href=("/story/by-tag/"+tag.kind+"/"+tag.name) textClass=("color-tag-"+tag.kind.toLowerCase()) icon=tag.kind.charAt(0)>${tag.name}</menu-link>
  14. <menu-gap />
  15. <if-permitted user=input.user permission=["member", "story.add"]>
  16. <menu-link dark key="_create" on-click("open", "story.add") icon="+">Add Story</menu-link>
  17. </if-permitted>
  18. <menu-gap />
  19. <menu-header>Categories</menu-header>
  20. <menu-link for(category in (input.categories||[])) key=(category.name) selected=(input.selected.category == category.name) href=("/story/by-category/"+category.name) icon=category.name.charAt(0)>${category.name}</menu-link>
  21. <menu-gap />
  22. </menu>