training/views/index.ejs

44 lines
1.3 KiB
Plaintext

<%- include('partials/header') %>
<h1>Turnstunden Organisation</h1>
<% if (session && ( session.role =='admin' || session.role =='user' )) { %>
<ul>
<li >
<a href="/training">Trainings</a>
</li>
<li >
<a href="/riege">Riegen</a>
</li>
<% if (session && session.role === 'admin') { %>
<li >
<a href="/teilnehmer">Teilnehmende</a>
</li>
<li><a href="/admin">Admin</a></li>
<% } %>
<li >
<a href="/profile">Profil</a>
</li>
</ul>
<% } else {%>
<form action="/login" method="post">
<div class="mb-3">
<label for="username" class="form-label">Username</label>
<input type="text" class="form-control" id="username" name="username" required>
</div>
<div class="mb-3">
<label for="password" class="form-label">Password</label>
<input type="password" class="form-control" id="password" name="password" required>
</div>
<button type="submit" class="btn btn-primary">Login</button>
</form>
<a href="/register">Register</a>
<a href="/forgot-password">Forgot Password?</a>
<% } %>
</body>
</html>
<%- include('partials/footer') %>