Initial commit: Frühstückskonten Verwaltung Web-App
This commit is contained in:
39
views/users.ejs
Normal file
39
views/users.ejs
Normal file
@ -0,0 +1,39 @@
|
||||
<%- include('layout', { title: 'Benutzerverwaltung' }) %>
|
||||
|
||||
<% override body %>
|
||||
<h2>Benutzerverwaltung</h2>
|
||||
|
||||
<div class="actions">
|
||||
<a href="/users/new" class="btn">Neuen Benutzer anlegen</a>
|
||||
</div>
|
||||
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Benutzername</th>
|
||||
<th>Rolle</th>
|
||||
<th>Aktionen</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% users.forEach(user => { %>
|
||||
<tr>
|
||||
<td><%= user.username %></td>
|
||||
<td><%= user.role %></td>
|
||||
<td>
|
||||
<% if (user.id !== currentUser.id) { %>
|
||||
<form action="/users/<%= user.id %>/delete" method="POST" style="display: inline;">
|
||||
<button type="submit" class="btn-danger"
|
||||
onclick="return confirm('Benutzer wirklich löschen?')">Löschen</button>
|
||||
</form>
|
||||
<% else %>
|
||||
<span class="disabled">(Eigener Account)</span>
|
||||
<% } %>
|
||||
</td>
|
||||
</tr>
|
||||
<% }); %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p>Gesamt: <%= users.length %> Benutzer</p>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user