2024-05-23 20:49:34 +02:00
|
|
|
<%- include('partials/header') %>
|
|
|
|
|
|
|
|
<h1>Admin Panel</h1>
|
2024-05-27 22:45:57 +02:00
|
|
|
|
|
|
|
<!-- Nav tabs -->
|
|
|
|
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
|
|
|
<li class="nav-item" role="presentation">
|
|
|
|
<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>
|
|
|
|
</li>
|
|
|
|
<li class="nav-item" role="presentation">
|
|
|
|
<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>
|
2024-05-23 20:49:34 +02:00
|
|
|
</ul>
|
|
|
|
|
2024-05-27 22:45:57 +02:00
|
|
|
<!-- Tab panes -->
|
|
|
|
<div class="tab-content" id="myTabContent">
|
|
|
|
<div class="tab-pane fade show active" id="cont-1" role="tabpanel" aria-labelledby="tab-1">
|
|
|
|
<form method="POST" action="/new-member">
|
2024-05-30 17:43:11 +02:00
|
|
|
Name: <input type="text" id="vorname" placeholder="Vorname" name="vorname">
|
2024-07-04 22:45:31 +02:00
|
|
|
<input type="text" id="nachname" placeholder="Nachname" name="nachname"></br>
|
2024-05-30 17:43:11 +02:00
|
|
|
Geburtsdatum: <input type="date" id="geburt" name="geburt"></br>
|
2024-05-27 22:45:57 +02:00
|
|
|
<select name="riege">
|
|
|
|
<option value=1> Riege 1</option>
|
|
|
|
<option value=2> Riege 2</option>
|
|
|
|
<option value=3> Riege 3</option>
|
|
|
|
<option value=4> Riege 4</option>
|
|
|
|
<option value=5> Riege 5</option>
|
|
|
|
</select></br>
|
|
|
|
Adresse: <input type="text" id="adresse" placeholder="Adresse" name="adresse"></br>
|
2024-07-04 22:45:31 +02:00
|
|
|
Probe: <input type="checkbox" name="probe" value="true"></br>
|
2024-09-28 13:56:45 +02:00
|
|
|
<input type="hidden" name="from" value="admin">
|
|
|
|
<input type="hidden" name="training" value="0">
|
2024-05-27 22:45:57 +02:00
|
|
|
<button type="submit">Speichern</button>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="tab-pane fade" id="cont-2" role="tabpanel" aria-labelledby="tab-2">
|
|
|
|
<ul>
|
|
|
|
<% users.forEach(user => { %>
|
|
|
|
<li>
|
2024-06-17 19:27:23 +02:00
|
|
|
<%= user.username %>
|
2024-05-29 21:06:42 +02:00
|
|
|
<% if (!user.is_active) { %>
|
2024-05-29 19:57:45 +02:00
|
|
|
<form action="/userrights" method="post" style="display: inline;">
|
|
|
|
<input type="hidden" name="type" value="activate">
|
2024-05-27 22:45:57 +02:00
|
|
|
<input type="hidden" name="userId" value="<%= user.id %>">
|
|
|
|
<button type="submit" class="btn btn-success">Activate</button>
|
|
|
|
</form>
|
2024-05-29 21:06:42 +02:00
|
|
|
<form action="/userrights" method="post" style="display: inline;">
|
|
|
|
<input type="hidden" name="type" value="delete">
|
|
|
|
<input type="hidden" name="userId" value="<%= user.id %>">
|
|
|
|
<button type="submit" class="btn btn-danger">Delete</button>
|
|
|
|
</form>
|
2024-05-29 19:57:45 +02:00
|
|
|
<% } else if (user.role === 'user') { %>
|
|
|
|
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#adminModal">
|
|
|
|
Admin
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<div class="modal fade" id="adminModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
|
|
|
|
<div class="modal-dialog">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<h1 class="modal-title fs-5" id="staticBackdropLabel">Zum Admin machen?</h1>
|
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<form action="/userrights" method="post" style="display: inline;">
|
|
|
|
<input type="hidden" name="type" value="admin">
|
|
|
|
<input type="hidden" name="userId" value="<%= user.id %>">
|
|
|
|
<button type="submit" class="btn btn-success">Dauerhaft</button>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<form action="/userrights" method="post" style="display: inline;">
|
|
|
|
<input type="hidden" name="type" value="admint">
|
|
|
|
<input type="hidden" name="userId" value="<%= user.id %>">
|
|
|
|
<button type="submit" class="btn btn-success">Temporär (24h)</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<% } %>
|
2024-05-27 22:45:57 +02:00
|
|
|
</li>
|
2024-05-29 19:57:45 +02:00
|
|
|
<% }); %>
|
2024-05-27 22:45:57 +02:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-05-27 20:37:35 +02:00
|
|
|
|
2024-05-23 20:49:34 +02:00
|
|
|
<%- include('partials/footer') %>
|