diff options
| author | salmonik <salmonik@tuta.io> | 2026-07-12 19:38:03 +0200 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-07-12 19:38:03 +0200 |
| commit | ae7ef10b67737f08a86743f687bca30a12e9e17a (patch) | |
| tree | 056539ab76b801559dc8d07ee6599220e2bd8e07 /templates/accounts/manage.html | |
| parent | architecture (diff) | |
| download | minecraft-ui-ae7ef10b67737f08a86743f687bca30a12e9e17a.tar.gz minecraft-ui-ae7ef10b67737f08a86743f687bca30a12e9e17a.zip | |
first stable
Diffstat (limited to '')
| -rw-r--r-- | templates/accounts/manage.html | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/templates/accounts/manage.html b/templates/accounts/manage.html new file mode 100644 index 0000000..e7c9b2f --- /dev/null +++ b/templates/accounts/manage.html | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | {% extends "base.html" %} | ||
| 2 | {% block content %} | ||
| 3 | <h1>Account Management</h1> | ||
| 4 | |||
| 5 | {% if let Some(msg) = message %} | ||
| 6 | <div class="flash flash-ok">{{ msg }}</div> | ||
| 7 | {% endif %} | ||
| 8 | |||
| 9 | <div class="card"> | ||
| 10 | <h3>Change My Password</h3> | ||
| 11 | <form action="/accounts/change-own-password" method="post" class="form-row"> | ||
| 12 | <input type="password" name="current_password" placeholder="Current password" required> | ||
| 13 | <input type="password" name="new_password" placeholder="New password" required minlength="4"> | ||
| 14 | <button type="submit" class="btn-ok">Update</button> | ||
| 15 | </form> | ||
| 16 | </div> | ||
| 17 | |||
| 18 | <div class="card"> | ||
| 19 | <h3>Create Account</h3> | ||
| 20 | <form action="/accounts/create" method="post" class="form-row"> | ||
| 21 | <input type="text" name="username" placeholder="Username" required> | ||
| 22 | <input type="password" name="password" placeholder="Password" required> | ||
| 23 | <label> | ||
| 24 | <input type="checkbox" name="is_superuser"> Superuser | ||
| 25 | </label> | ||
| 26 | <button type="submit" class="btn-ok">Create</button> | ||
| 27 | </form> | ||
| 28 | </div> | ||
| 29 | |||
| 30 | <div class="card"> | ||
| 31 | <h3>Existing Accounts</h3> | ||
| 32 | <table class="table"> | ||
| 33 | <thead> | ||
| 34 | <tr> | ||
| 35 | <th>Username</th> | ||
| 36 | <th>Role</th> | ||
| 37 | <th>Actions</th> | ||
| 38 | </tr> | ||
| 39 | </thead> | ||
| 40 | <tbody> | ||
| 41 | {% for acct in accounts %} | ||
| 42 | <tr> | ||
| 43 | <td>{{ acct.username }}</td> | ||
| 44 | <td> | ||
| 45 | {% if acct.is_superuser %} | ||
| 46 | <span class="tag tag-admin">Superuser</span> | ||
| 47 | {% else %} | ||
| 48 | <span class="tag">User</span> | ||
| 49 | {% endif %} | ||
| 50 | </td> | ||
| 51 | <td> | ||
| 52 | <div class="actions" style="gap:0.25rem"> | ||
| 53 | <form action="/accounts/set-password" method="post" style="display:inline"> | ||
| 54 | <input type="hidden" name="id" value="{{ acct.id }}"> | ||
| 55 | <input type="password" name="new_password" placeholder="New password" required minlength="4" style="width:140px;padding:0.25rem 0.5rem;font-size:0.8rem"> | ||
| 56 | <button type="submit" class="btn-sm">Set</button> | ||
| 57 | </form> | ||
| 58 | <form action="/accounts/delete" method="post" style="display:inline" | ||
| 59 | onsubmit="return confirm('Delete account {{ acct.username }}?')"> | ||
| 60 | <input type="hidden" name="id" value="{{ acct.id }}"> | ||
| 61 | <button type="submit" class="btn-sm btn-danger">Delete</button> | ||
| 62 | </form> | ||
| 63 | </div> | ||
| 64 | </td> | ||
| 65 | </tr> | ||
| 66 | {% endfor %} | ||
| 67 | </tbody> | ||
| 68 | </table> | ||
| 69 | </div> | ||
| 70 | {% endblock %} | ||
