Archived
1
0
Fork 0

Nav bar rework

This commit is contained in:
Ethanell 2020-09-27 17:52:35 +02:00
parent 23c9481c7d
commit 77514867ed
2 changed files with 28 additions and 17 deletions

View file

@ -22,6 +22,10 @@ dark.addEventListener("click", () => {
contact.classList.add("hide"); contact.classList.add("hide");
}); });
document.addEventListener("DOMContentLoaded", function() {
M.Sidenav.init(document.querySelectorAll(".sidenav"));
});
function cb(token) { function cb(token) {
document.querySelectorAll("div.recaptcha.recaptcha-cb").forEach(el => { document.querySelectorAll("div.recaptcha.recaptcha-cb").forEach(el => {
el.classList.remove("recaptcha-cb"); el.classList.remove("recaptcha-cb");

View file

@ -4,29 +4,35 @@ doctype html
html html
head head
title= title title= title
link(rel="stylesheet", href="/stylesheets/style.css") link(rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons")
link(rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css")
link(rel="stylesheet" href="/stylesheets/style.css")
meta(name="viewport" content="width=device-width, initial-scale=1.0")
body body
block content mixin nav
div#user
a(href="/")=__("layout.home")
if user if user
if user.permissions >= 1 if user.permissions >= 1
p - li: a(href="/sandwiches")=__("sandwiches")
a(href="/sandwiches")=__("sandwiches")
if user.permissions >= 2 if user.permissions >= 2
p - li: a(href="/orders")=__("orders")
a(href="/orders")=__("orders")
if user.permissions >= 3 if user.permissions >= 3
p - li: a(href="/admin")=__("admin.title")
a(href="/admin")=__("admin.title") li: a(href="/profile")=user.username
p | li: a(href="/logout")=__("layout.logout")
if user
a(href="/profile")=user.username
a(href="/logout")=__("layout.logout")
else else
a(href="/login")=__("layout.login") li: a(href="/login")=__("layout.login")
a(href="/register")=__("layout.register") li: a(href="/register")=__("layout.register")
nav.orange(role="navigation")
div.nav-wrapper.container
a.brand-logo(href="/") SOD
a.sidenav-trigger(href="#" data-target="mobile-nav"): i.material-icons menu
ul.right.hide-on-med-and-down
+nav
ul#mobile-nav.sidenav
+nav
div.hide
block content
div#more div#more
a=__("layout.about") a=__("layout.about")
@ -92,6 +98,7 @@ html
div.field div.field
+submit(value=__("send")) +submit(value=__("send"))
script(src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js")
script(src="/javascripts/layout.js") script(src="/javascripts/layout.js")
if !test if !test
p !{captcha} p !{captcha}