bump project
This commit is contained in:
31
app/templates/admin/account_form.html
Normal file
31
app/templates/admin/account_form.html
Normal file
@@ -0,0 +1,31 @@
|
||||
{% extends "base.html" %}
|
||||
{% from "macros/forms.html" import render_field, render_select %}
|
||||
|
||||
{% block title %}Create account · Face Attendance{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<div>
|
||||
<p class="eyebrow">Administration</p>
|
||||
<h1>Create account</h1>
|
||||
</div>
|
||||
<a class="btn btn-outline-secondary" href="{{ url_for('admin.accounts') }}">Back</a>
|
||||
</div>
|
||||
|
||||
<section class="form-section">
|
||||
<form method="post" novalidate>
|
||||
{{ form.hidden_tag() }}
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">{{ render_field(form.full_name) }}</div>
|
||||
<div class="col-md-6">{{ render_field(form.username) }}</div>
|
||||
<div class="col-md-6">{{ render_field(form.email) }}</div>
|
||||
<div class="col-md-6">{{ render_select(form.role) }}</div>
|
||||
<div class="col-md-6">{{ render_field(form.password) }}</div>
|
||||
<div class="col-md-6">{{ render_field(form.confirm_password) }}</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
{{ form.submit(class="btn btn-primary") }}
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
{% endblock %}
|
||||
53
app/templates/admin/accounts.html
Normal file
53
app/templates/admin/accounts.html
Normal file
@@ -0,0 +1,53 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Accounts · Face Attendance{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<div>
|
||||
<p class="eyebrow">Administration</p>
|
||||
<h1>Accounts</h1>
|
||||
</div>
|
||||
<a class="btn btn-primary" href="{{ url_for('admin.new_account') }}">Create account</a>
|
||||
</div>
|
||||
|
||||
<section class="content-section">
|
||||
{% if accounts %}
|
||||
<div class="table-responsive">
|
||||
<table class="table align-middle">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Username</th>
|
||||
<th>Email</th>
|
||||
<th>Role</th>
|
||||
<th>Status</th>
|
||||
<th class="text-end">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for account in accounts %}
|
||||
<tr>
|
||||
<td>{{ account.full_name }}</td>
|
||||
<td>{{ account.username }}</td>
|
||||
<td>{{ account.email }}</td>
|
||||
<td>{{ account.role|title }}</td>
|
||||
<td><span class="badge text-bg-{{ 'success' if account.active else 'secondary' }}">{{ "Active" if account.active else "Inactive" }}</span></td>
|
||||
<td class="text-end">
|
||||
{% if account.id != current_user.id %}
|
||||
<form method="post" action="{{ url_for('admin.toggle_account', account_id=account.id) }}" class="d-inline">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<button class="btn btn-outline-secondary btn-sm" type="submit">{{ "Deactivate" if account.active else "Activate" }}</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty-state">No staff accounts exist yet.</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user