Initial Claude implementation

This commit is contained in:
Ian Roddis committed 2026-06-22 14:26:44 -03:00
commit e2d3ab9c2a
63 files changed
+3930

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
<div id="role-list" class="card">
<table class="table">
<thead>
<tr><th>ID</th><th>Name</th><th>Description</th><th>Permissions</th><th></th></tr>
</thead>
<tbody>
{% for r in roles %}
<tr id="role-{{ r.id }}">
<td>{{ r.id }}</td>
<td>{{ r.name }}</td>
<td>{{ r.description or "" }}</td>
<td>{% for perm in r.permissions %}<span class="tag">{{ perm.name }}</span>{% endfor %}</td>
<td class="row-actions">
<button class="btn btn-danger"
hx-delete="/admin/roles/{{ r.id }}"
hx-target="#role-{{ r.id }}"
hx-swap="outerHTML"
hx-confirm="Delete role {{ r.name }}?">Delete</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
+19
View File
@@ -0,0 +1,19 @@
<tr id="user-{{ u.id }}">
<td>{{ u.id }}</td>
<td>{{ u.email }}</td>
<td>{{ u.full_name or "" }}</td>
<td>{{ "✓" if u.is_active else "—" }}</td>
<td>{{ "✓" if u.is_superuser else "—" }}</td>
<td>{% for role in u.roles %}<span class="tag">{{ role.name }}</span>{% endfor %}</td>
<td class="row-actions">
<button class="btn btn-ghost"
hx-get="/admin/users/{{ u.id }}/edit"
hx-target="#user-{{ u.id }}"
hx-swap="outerHTML">Edit</button>
<button class="btn btn-danger"
hx-delete="/admin/users/{{ u.id }}"
hx-target="#user-{{ u.id }}"
hx-swap="outerHTML"
hx-confirm="Delete user {{ u.email }}?">Delete</button>
</td>
</tr>
+30
View File
@@ -0,0 +1,30 @@
<tr id="user-{{ u.id }}">
<td colspan="7">
<form hx-post="/admin/users/{{ u.id }}"
hx-target="#user-{{ u.id }}"
hx-swap="outerHTML"
class="inline-edit">
<span class="muted">#{{ u.id }} · {{ u.email }}</span>
<label>Name <input type="text" name="full_name" value="{{ u.full_name or '' }}"></label>
<label>New password <input type="password" name="password" placeholder="(unchanged)"></label>
<label class="check"><input type="checkbox" name="is_active" value="true" {{ "checked" if u.is_active }}> Active</label>
<label class="check"><input type="checkbox" name="is_superuser" value="true" {{ "checked" if u.is_superuser }}> Superuser</label>
<fieldset class="roles-field">
<legend>Roles</legend>
{% for role in roles %}
<label class="check">
<input type="checkbox" name="role_ids" value="{{ role.id }}"
{{ "checked" if role in u.roles }}> {{ role.name }}
</label>
{% endfor %}
</fieldset>
<div class="row-actions">
<button type="submit" class="btn btn-primary">Save</button>
<button type="button" class="btn btn-ghost"
hx-get="/admin/users/{{ u.id }}/row"
hx-target="#user-{{ u.id }}"
hx-swap="outerHTML">Cancel</button>
</div>
</form>
</td>
</tr>
+14
View File
@@ -0,0 +1,14 @@
<div id="user-list" class="card">
<table class="table">
<thead>
<tr>
<th>ID</th><th>Email</th><th>Name</th><th>Active</th><th>Superuser</th><th>Roles</th><th></th>
</tr>
</thead>
<tbody>
{% for u in users %}
{% include "admin/_user_row.html" %}
{% endfor %}
</tbody>
</table>
</div>
+27
View File
@@ -0,0 +1,27 @@
{% extends "base.html" %}
{% block title %}Roles · {{ app_name }}{% endblock %}
{% block body %}
{% include "_nav.html" %}
<main class="container">
<h1>Roles &amp; permissions</h1>
<div class="card">
<h2>Create role</h2>
<form hx-post="/admin/roles" hx-target="#role-list" hx-swap="outerHTML" class="form-grid">
<label>Name <input type="text" name="name" required></label>
<label>Description <input type="text" name="description"></label>
<fieldset class="roles-field">
<legend>Permissions</legend>
{% for perm in permissions %}
<label class="check"><input type="checkbox" name="permission_ids" value="{{ perm.id }}"> {{ perm.name }}</label>
{% else %}
<span class="muted">No permissions defined. Run the seed script.</span>
{% endfor %}
</fieldset>
<button type="submit" class="btn btn-primary">Add role</button>
</form>
</div>
{% include "admin/_roles_table.html" %}
</main>
{% endblock %}
+29
View File
@@ -0,0 +1,29 @@
{% extends "base.html" %}
{% block title %}Users · {{ app_name }}{% endblock %}
{% block body %}
{% include "_nav.html" %}
<main class="container">
<h1>Users</h1>
<div class="card">
<h2>Create user</h2>
<form hx-post="/admin/users" hx-target="#user-list" hx-swap="outerHTML" class="form-grid">
<label>Email <input type="email" name="email" required></label>
<label>Full name <input type="text" name="full_name"></label>
<label>Password <input type="password" name="password" required></label>
<label class="check">
<input type="checkbox" name="is_superuser" value="true"> Superuser
</label>
<fieldset class="roles-field">
<legend>Roles</legend>
{% for role in roles %}
<label class="check"><input type="checkbox" name="role_ids" value="{{ role.id }}"> {{ role.name }}</label>
{% endfor %}
</fieldset>
<button type="submit" class="btn btn-primary">Add user</button>
</form>
</div>
{% include "admin/_users_table.html" %}
</main>
{% endblock %}