Bri-Tunes/src/views/partials/header.ejs

25 lines
1.4 KiB
Plaintext

<header class="site-header">
<div class="container header-inner">
<a class="brand" href="/">🎵 <%= siteName %></a>
<nav class="nav">
<a href="/songs" class="<%= currentPath && currentPath.startsWith('/songs') ? 'active' : '' %>">Songs</a>
<a href="/playlists" class="<%= currentPath && currentPath.startsWith('/playlists') ? 'active' : '' %>">Playlists</a>
<a href="/profiles" class="<%= currentPath && currentPath.startsWith('/profiles') ? 'active' : '' %>">Profiles</a>
<% if (user) { %>
<a href="/mymusic/songs" class="<%= currentPath && currentPath.startsWith('/mymusic') && !currentPath.startsWith('/mymusic/users') ? 'active' : '' %>">My Music</a>
<% if (user.role === 'admin') { %>
<a href="/mymusic/users" class="<%= currentPath && currentPath.startsWith('/mymusic/users') ? 'active' : '' %>">Users</a>
<% } %>
<a href="/account" class="<%= currentPath && currentPath.startsWith('/account') ? 'active' : '' %>">Account<% if (unreadNotifCount > 0) { %><span class="notif-badge"><%= unreadNotifCount %></span><% } %></a>
<form method="post" action="/logout" class="inline-form">
<input type="hidden" name="_csrf" value="<%= csrfToken %>">
<button type="submit" class="linklike">Log out</button>
</form>
<% } else { %>
<a href="/login">Log in</a>
<a href="/register" class="btn-small">Register</a>
<% } %>
</nav>
</div>
</header>