68 lines
2.9 KiB
HTML
68 lines
2.9 KiB
HTML
{% extends "layouts/base.html" %}
|
|
{% block title %}Manage Users - TryoutPro{% endblock %}
|
|
{% block page_title %}Manage Users{% endblock %}
|
|
{% block breadcrumb %}<span class="breadcrumb">Home / Users</span>{% endblock %}
|
|
|
|
{% block header_actions %}
|
|
<a href="{{ url_for('users.create_user') }}" class="btn btn-primary">
|
|
<i class="fas fa-user-plus"></i> Add User
|
|
</a>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="table-container">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Username</th>
|
|
<th>Email</th>
|
|
<th>Role</th>
|
|
<th>Status</th>
|
|
<th>Joined</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for u in users %}
|
|
<tr>
|
|
<td>
|
|
<div class="user-mini">
|
|
<div class="avatar-sm">{{ u.full_name[:2] | upper }}</div>
|
|
<span>{{ u.full_name }}</span>
|
|
</div>
|
|
</td>
|
|
<td>{{ u.username }}</td>
|
|
<td>{{ u.email }}</td>
|
|
<td><span class="badge badge-{{ u.role }}">{{ u.role | capitalize }}</span></td>
|
|
<td>
|
|
{% if u.is_active_account %}
|
|
<span class="badge badge-success">Active</span>
|
|
{% else %}
|
|
<span class="badge badge-danger">Inactive</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ u.created_at.strftime('%m/%d/%Y') }}</td>
|
|
<td>
|
|
<a href="{{ url_for('users.edit_user', user_id=u.id) }}" class="btn btn-sm btn-outline">
|
|
<i class="fas fa-edit"></i> Edit
|
|
</a>
|
|
{% if u.id != current_user.id %}
|
|
<form method="POST" action="{{ url_for('users.delete_user', user_id=u.id) }}" class="inline-form" onsubmit="return confirm('Delete {{ u.full_name }}? This cannot be undone.');">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
|
<button type="submit" class="btn btn-sm btn-danger">
|
|
<i class="fas fa-trash"></i>
|
|
</button>
|
|
</form>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %} |