/
users.html
84 lines (75 loc) · 3.65 KB
/
users.html
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{% extends 'staff/staffbase.html' %}
{% load static %}
<link rel="stylesheet" href="{% static "css/staff.css" %}">
{% block title %}
Search Users
{% endblock %}
{% block body %}
<form id="searchform" action="{% url 'staff:searchusers' %}" method="get" accept-charset="utf-8">
<button class="searchbutton" type="submit">
<i class="fa fa-search"></i>
</button>
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search">
</form>
<div style="overflow-x:auto;">
Total users: {{ numusers }}
<table class="table table-dark">
<th>Username</th>
<th>Email address</th>
<th>Last IP</th>
<th>User Type</th>
<th></th>
<th></th>
<th></th>
{% for up in userprofiles %}
<tr>
<td><strong><a href="/staff/users/{{ up.user }}">{{ up.user }}</a></strong></td>
<td> {{ up.user.email }} </td>
<td> {{ up.ip }} </td>
{% if up.user_type == 'superadmin' %}
<td>Super Admin</td>
{% elif up.user_type == 'admin' %}
<td>Admin</td>
{% elif up.user_type == 'user' %}
<td>Standard User</td>
{% endif %}
<td><a href="{% url 'staff:modify_user' urlusername=up.user %}" class="btn btn-primary">Modify
User</a></td>
{% if up.user.id in bannedusernames %}
<td><a href="{% url 'staff:unban_user' urlusername=up.user %}" class="btn btn-warning">UNBAN
USERNAME</a></td>
{% else %}
<td><a href="{% url 'staff:ban_user' urlusername=up.user %}" class="btn btn-danger">BAN
USERNAME</a></td>
{% endif %}
{% if up.ip in bannedips %}
<td><a href="{% url 'staff:unban_ip' urlusername=up.user %}" class="btn btn-warning">UNBAN
IP</a></td>
{% else %}
<td><a href="{% url 'staff:ban_ip' urlusername=up.user %}" class="btn btn-danger">BAN IP</a>
</td>
{% endif %}
{% if verification %}
{% if not up.user_verified %}
<td><a href="{% url 'staff:verify_user' urlusername=up.user %}" class="btn btn-primary">
Force Verify
User</a>
</td>
<td><a href="{% url 'staff:resend_verify_email' urlusername=up.user %}"
class="btn btn-primary"> Resend verification email</a></td>
{% else %}
<td><a href="{% url 'staff:verify_user' urlusername=up.user %}" class="btn btn-primary">
Unverify User</a>
</td>
{% endif %}
{% endif %}
</tr>
{% endfor %}
</table>
{% include "pagination.html" with page=userprofiles %}
<td><a href="{% url 'staff:get_rank' %}" class="btn btn-primary">Calculate rank for all users</a></td>
<td><a href="{% url 'staff:reset_xp' %}"
onclick="return confirm('Are you sure you want to reset XP for all users?\nThis cannot be undone!')"
class="btn btn-danger">Reset XP for all users</a></td>
</div>
{% endblock %}