mirror of
https://github.com/nfonteyne/octane-website.git
synced 2026-09-03 23:24:48 +02:00
first commit
This commit is contained in:
commit
244cdbedd7
44 changed files with 3386 additions and 0 deletions
17
public/js/nav.js
Normal file
17
public/js/nav.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
async function initNav(activePage) {
|
||||
const me = await api.get('/api/users/me');
|
||||
const nav = document.getElementById('main-nav');
|
||||
nav.innerHTML = `
|
||||
<div class="nav-links">
|
||||
<a href="/index.html" class="${activePage === 'repertoire' ? 'active' : ''}">Répertoire</a>
|
||||
<a href="/suggestions.html" class="${activePage === 'suggestions' ? 'active' : ''}">Suggestions</a>
|
||||
<a href="/setlist.html" class="${activePage === 'setlist' ? 'active' : ''}">Prochain concert</a>
|
||||
<a href="/history.html" class="${activePage === 'history' ? 'active' : ''}">Historique</a>
|
||||
</div>
|
||||
<div class="nav-user">
|
||||
<span>${escapeHtml(me.name)}${me.isAdmin ? ' <span class="badge">admin</span>' : ''}</span>
|
||||
<a href="/auth/logout">Se déconnecter</a>
|
||||
</div>
|
||||
`;
|
||||
return me;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue