navbar.ftl 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. <#include "security.ftl">
  2. <#import "login.ftl" as login>
  3. <nav class="navbar navbar-expand-lg bg-body-tertiary">
  4. <div class="container-fluid">
  5. <a class="navbar-brand" href="/">Sweater</a>
  6. <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
  7. <span class="navbar-toggler-icon"></span>
  8. </button>
  9. <div class="collapse navbar-collapse" id="navbarNav">
  10. <ul class="navbar-nav me-auto">
  11. <li class="nav-item">
  12. <a class="nav-link" aria-current="page" href="/">Home</a>
  13. </li>
  14. <li class="nav-item">
  15. <a class="nav-link" aria-current="page" href="/feed">Messages</a>
  16. </li>
  17. <#if isAdmin>
  18. <li class="nav-item">
  19. <a class="nav-link" aria-current="page" href="/user">Users</a>
  20. </li>
  21. </#if>
  22. </ul>
  23. <#if user??>
  24. <div class="navbar-text">${name}</div>
  25. <@login.logout />
  26. </#if>
  27. </div>
  28. </div>
  29. </nav>