AutoCallManu/utils/navbar.js

18 lines
567 B
JavaScript

function navbar(session) {
let logField;
if(session.user) {
logField = `<li style="float:right"><a class="active" href="/dashboard">${session.user.username}</a></li>`
} else {
logField = `<li style="float:right"><a class="active" href="/login">Login</a></li>`;
}
return `
<link rel="stylesheet" type="text/css" href="/assets/css/navbar.css" />
<ul>
<li><a href="/">Accueil</a></li>
<li><a href="/calls">Phoning</a></li>
<li><a href="#nope">Nope</a></li>
${logField}
</ul>`;
}
export { navbar };