crowsite/crow_test/webcontent/menu_bar.part

29 lines
1.0 KiB
Plaintext

<ul class="menu_bar">
<li class="left"><a id="home" href="/">Home</a></li>
<li class="left"><a id="projects" href="/projects/">Projects</a></li>
<li class="left"><a id="research" href="/research/">Research</a></li>
<li class="left"><a id="git" href="/git.html">Git</a></li>
<li class="left"><a id='about' href="/about.html">About</a></li>
{{%_logged_in}}
<li class="right"><a href="/logout.html">Logout</a></li>
{{*_logged_in}}
<li class="right"><a id='login' href="/login.html">Login</a></li>
{{/_logged_in}}
{{%_admin}}
<li class="right"><a href="/admin/">Admin</a></li>
{{/_admin}}
</ul>
<script>
const path = window.location.pathname;
const ids = {
"/": "home",
"/index.html": "home",
"/projects.html": "projects",
"/research.html": "research",
"/git.html": "git",
"/about.html": "about",
"/login.html": "login"
};
var element = document.getElementById(ids[path]);
element.classList += "active";
</script>