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.

23 lines
1.1 KiB

6 years ago
6 years ago
  1. <div class=["menu", state.enabled ? "enabled" : "disabled"]>
  2. <div class="menu-body">
  3. <menu-link icon=(state.enabled ? "<" : ">") on-click("toggleEnabled") class="showhide">${state.enabled ? "Hide Menu" : "Show Menu"}</menu-link>
  4. <menu-gap class="showhide" />
  5. <include(input.renderBody) />
  6. </div>
  7. <if(input.user != null)>
  8. <menu-gap />
  9. <menu-header key="user">User</menu-header>
  10. <menu-link if(!input.user.loggedIn) icon="L" href="/auth/login" on-click("loginClicked")>Login</menu-link>
  11. <menu-link if(input.user.loggedIn) icon="L" href="/auth/logout" on-click("logoutClicked")>Logout <span class="weak">(${input.user.name})</span></menu-link>
  12. </if>
  13. <else-if(!input.allowNoUser)>
  14. <menu-blurb class="error">input.user is missing!</menu-blurb>
  15. </else-if>
  16. </div>
  17. <modal class="modal" enabled=state.loggingIn notification>
  18. <h1>Logging you in...</h1>
  19. <p>You may be redirected to Auth0 if it's been a while.</p>
  20. </modal>
  21. <modal class="modal" enabled=state.loggingOut notification>
  22. <h1>Logging you out...</h1>
  23. <p>You can probably log back in without entering your info if you're quick.</p>
  24. </modal>