feat: initial implementation

This commit is contained in:
jfmcarreira committed 2026-10-05 22:36:27 +01:00
commit e29da874ee
39 files changed
+2309

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
{% extends "base.html" %}
{% block content %}
<div class="page-head"><div><h1>People</h1><p class="muted">Email and phone are optional. Username is used to sign in.</p></div></div>
<section class="panel">
<h2>Add person</h2>
<form method="post" action="/admin/users" class="form-grid">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
<label>Name<input name="name" required></label>
<label>Username<input name="username" required pattern="[A-Za-z0-9._-]+"></label>
<label>Email<input type="email" name="email"></label>
<label>Phone<input name="phone"></label>
<label>Password<input type="password" name="password" minlength="8" required></label>
<label class="check"><input type="checkbox" name="notify_email" checked> Email notifications</label>
<label class="check"><input type="checkbox" name="is_admin"> Administrator</label>
<div><button class="primary" type="submit">Add person</button></div>
</form>
</section>
<div class="stack gap-lg top-space">
{% for person in users %}
<details class="panel">
<summary><strong>{{ person.name }}</strong> <span class="muted">@{{ person.username }}{% if not person.is_active %} · inactive{% endif %}</span></summary>
<form method="post" action="/admin/users/{{ person.id }}/update" class="form-grid top-space">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
<label>Name<input name="name" value="{{ person.name }}" required></label>
<label>Email<input type="email" name="email" value="{{ person.email or '' }}"></label>
<label>Phone<input name="phone" value="{{ person.phone or '' }}"></label>
<label>New password<input type="password" name="new_password" minlength="8" placeholder="Leave blank to keep"></label>
<label class="check"><input type="checkbox" name="notify_email" {% if person.notify_email %}checked{% endif %}> Email notifications</label>
<label class="check"><input type="checkbox" name="is_active" {% if person.is_active %}checked{% endif %}> Active</label>
<label class="check"><input type="checkbox" name="is_admin" {% if person.is_admin %}checked{% endif %}> Administrator</label>
<div><button class="primary" type="submit">Save</button></div>
</form>
</details>
{% endfor %}
</div>
{% endblock %}