File size: 1,579 Bytes
f1a0148
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{% extends "admin/base.html" %}

{% block admin_content %}
<div class="admin-header">
    <div class="admin-title">Manage Users</div>
</div>

<div class="admin-card">
    <div class="admin-card-header">
        <div class="admin-card-title">All Users</div>
    </div>
    <div class="table-responsive">
        <table class="admin-table">
            <thead>
                <tr>
                    <th>ID</th>
                    <th>Username</th>
                    <th>HF ID</th>
                    <th>Join Date</th>
                    <th>Admin Status</th>
                    <th>Actions</th>
                </tr>
            </thead>
            <tbody>
                {% for user in users %}
                <tr>
                    <td>{{ user.id }}</td>
                    <td>{{ user.username }}</td>
                    <td>{{ user.hf_id }}</td>
                    <td>{{ user.join_date.strftime('%Y-%m-%d %H:%M') }}</td>
                    <td>
                        {% if g.is_admin and user.username in admin_users %}
                        <span class="badge badge-primary">Admin</span>
                        {% else %}
                        <span class="badge badge-secondary">User</span>
                        {% endif %}
                    </td>
                    <td>
                        <a href="{{ url_for('admin.user_detail', user_id=user.id) }}" class="action-btn">View Details</a>
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
</div>
{% endblock %}