Adminbereich in Tabs

This commit is contained in:
Klaas 2024-05-27 22:45:57 +02:00
parent 7eab4884c8
commit 3dabfc7fd2
1 changed files with 44 additions and 23 deletions

View File

@ -1,30 +1,51 @@
<%- include('partials/header') %> <%- include('partials/header') %>
<h1>Admin Panel</h1> <h1>Admin Panel</h1>
<ul>
<% users.forEach(user => { %> <!-- Nav tabs -->
<li> <ul class="nav nav-tabs" id="myTab" role="tablist">
<%= user.username %> - <%= user.email %> <li class="nav-item" role="presentation">
<form action="/activate" method="post" style="display: inline;"> <button class="nav-link active" id="tab-1" data-bs-toggle="tab" data-bs-target="#cont-1" type="button" role="tab" aria-controls="tab-1" aria-selected='true'> Mitglied anlegen </button>
<input type="hidden" name="userId" value="<%= user.id %>"> </li>
<button type="submit" class="btn btn-success">Activate</button> <li class="nav-item" role="presentation">
</form> <button class="nav-link" id="tab-2" data-bs-toggle="tab" data-bs-target="#cont-2" type="button" role="tab" aria-controls="tab-2" aria-selected='false'> User Freischalten </button>
</li> </li>
<% }) %>
</ul> </ul>
<form method="POST" action="/new-member"> <!-- Tab panes -->
Name: <input type="text" id="name" placeholder="Name" name="name"> </br> <div class="tab-content" id="myTabContent">
Geburtsdatum: <input type="date" id="riege" name="geburt"></br> <div class="tab-pane fade show active" id="cont-1" role="tabpanel" aria-labelledby="tab-1">
<select name="riege"> <form method="POST" action="/new-member">
<option value=1> Riege 1</option> Name: <input type="text" id="name" placeholder="Name" name="name"> </br>
<option value=2> Riege 2</option> Geburtsdatum: <input type="date" id="riege" name="geburt"></br>
<option value=3> Riege 3</option> <select name="riege">
<option value=4> Riege 4</option> <option value=1> Riege 1</option>
<option value=5> Riege 5</option> <option value=2> Riege 2</option>
</select></br> <option value=3> Riege 3</option>
Adresse: <input type="text" id="adresse" placeholder="Adresse" name="adresse"></br> <option value=4> Riege 4</option>
<button type="submit">Speichern</button> <option value=5> Riege 5</option>
</form> </select></br>
Adresse: <input type="text" id="adresse" placeholder="Adresse" name="adresse"></br>
<button type="submit">Speichern</button>
</form>
</div>
<div class="tab-pane fade" id="cont-2" role="tabpanel" aria-labelledby="tab-2">
<ul>
<% if (users.length > 0) {%>
<% users.forEach(user => { %>
<li>
<%= user.username %> - <%= user.email %>
<form action="/activate" method="post" style="display: inline;">
<input type="hidden" name="userId" value="<%= user.id %>">
<button type="submit" class="btn btn-success">Activate</button>
</form>
</li>
<% }) } else { %>
<p>Keine User zum freischalten</p>
<% } %>
</ul>
</div>
</div>
<%- include('partials/footer') %> <%- include('partials/footer') %>