akf-forum/views/extra/navbar.ejs

49 lines
1.1 KiB
Text
Raw Normal View History

2022-03-26 23:28:10 +03:00
<!-- Navbar: -->
2022-04-03 21:01:55 +03:00
<% if (user?.admin){ %>
<div class="admin">
<a class="admin" href="/admin"><p>You are admin, and you can go your page!</p></a>
</div>
<hr>
<% } %>
2022-03-26 23:28:10 +03:00
<a href="/"><img class="logo" src="/images/logo.jpg" alt="AKF-FORUM"></a>
<div class="navbar" id="navbar">
<a href="/threads">THREADS</a>
<a href="/users">USERS</a>
<a href="/search">SEARCH</a>
<a href="/threads/create/">CREATE THREAD</a>
2022-03-26 23:28:10 +03:00
2022-04-03 21:01:55 +03:00
<% if (user){ %>
<div style="float: right;" class="user" id="user">
<a href=<%=user.getLink() %>>
<h1>
2022-08-11 15:36:28 +03:00
<%= user.name %><img class="circle" src=<%=user.avatar %> alt=<%= user.name %>>
2022-04-03 21:01:55 +03:00
</h1>
</a>
</div>
<% } else { %>
<a style="float: right; background-color: #5F875F;" href="/register">REGISTER</a>
2022-08-11 00:38:44 +03:00
<a id="login" style="float: right; background-color:#5F87AF; " href="/login">LOGIN</a>
<script>
document.getElementById("login").href += "?redirect="+window.location.pathname
</script>
2022-04-03 21:01:55 +03:00
<% } %>
2022-03-26 23:28:10 +03:00
</div>
<hr>
2022-04-06 22:49:16 +03:00
<!-- Navbar end -->