49 lines
2.0 KiB
HTML
49 lines
2.0 KiB
HTML
|
|
|
|
<h2>Administration</h2>
|
|
|
|
<p>Users:
|
|
<table>
|
|
<tr><th>Username</th><th>Domains</th><th>Password</th><th>Admin</th><th>Email</th><th>Delete</th></tr>
|
|
|
|
<form method="POST" action="/create-user"><tr>
|
|
<td><input type="text" name="username" placeholder="*user name" required /></td>
|
|
<td><input type="text" name="domains" placeholder="space separated domains" /></td>
|
|
<td><input type="password" name="password" placeholder="*password" required /></td>
|
|
<td><input type="checkbox" name="is_admin" /></td>
|
|
<td><input type="email" name="email" placeholder="email" /></td>
|
|
<td><button type="submit">Add</button></td>
|
|
</tr></form>
|
|
|
|
{% for user in users %}
|
|
<tr>
|
|
<td>{{ user["username"] }}</td>
|
|
<td><form method="POST" action="/update-user">
|
|
<input type="hidden" name="userid" value="{{ user["userid"] }}" />
|
|
<input type="text" name="domains" placeholder="space separated domains" value="{{ user["domains"] | join(' ') }}" />
|
|
<button type="submit">update domains</button>
|
|
</form></td>
|
|
<td><form method="POST" action="/update-user">
|
|
<input type="hidden" name="userid" value="{{ user["userid"] }}" />
|
|
<input type="password" name="password" placeholder="*password" required />
|
|
<button type="submit">update password</button>
|
|
</form></td>
|
|
<td><form method="POST" action="/update-user">
|
|
<input type="hidden" name="userid" value="{{ user["userid"] }}" />
|
|
<input type="checkbox" name="is_admin" value="true" {% if user["is_admin"] %}checked{% endif %} />
|
|
<button type="submit">update admin</button>
|
|
</form></td>
|
|
<td><form method="POST" action="/update-user">
|
|
<input type="hidden" name="userid" value="{{ user["userid"] }}" />
|
|
<input type="email" name="email" placeholder="email" />
|
|
<button type="submit">update email</button>
|
|
</form></td>
|
|
<td><form method="POST" action="/delete-user">
|
|
<input type="hidden" name="userid" value="{{ user["userid"] }}" />
|
|
<button type="submit">Delete</button>
|
|
</form></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
</p>
|