newsbot-portal/internal/views/layout/navbar.templ

41 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

2024-05-18 22:37:30 -07:00
package layout
templ navBar() {
<nav class="navbar" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<a class="navbar-item" href="/">Newsbot</a>
2024-05-18 22:37:30 -07:00
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
<div id="navbarBasicExample" class="navbar-menu">
<div class="navbar-start">
2024-05-19 10:02:34 -07:00
<a class="navbar-item" href="/articles">Articles</a>
<a class="navbar-item" href="/sources">Sources</a>
<a class="navbar-item">{ getUsername(ctx) }</a>
2024-05-18 22:37:30 -07:00
</div>
<div class="navbar-end">
<div class="navbar-item">
<div class="buttons">
if getUsername(ctx) == "" {
<a class="button is-primary" href="/users/signup"><strong>Sign up</strong></a>
<a class="button is-light" href="/users/login">Log in</a>
} else {
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link">{ getUsername(ctx) }</a>
<div class="navbar-dropdown">
<a class="navbar-item" href="/users/profile">Profile</a>
<a class="navbar-item" href="/users/logout">Logout</a>
</div>
</div>
}
2024-05-18 22:37:30 -07:00
</div>
</div>
</div>
</div>
</nav>
}