-
Notifications
You must be signed in to change notification settings - Fork 7
/
users.html
72 lines (63 loc) · 3.11 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
{% 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="/staff/users/modify/{{ up.user }}" class="btn btn-primary">Modify User</a></td>
{% if up.user.id in bannedusernames %}
<td><a href="/staff/users/unban/{{ up.user }}" class="btn btn-warning">UNBAN USERNAME</a></td>
{% else %}
<td><a href="/staff/users/ban/{{ up.user }}" class="btn btn-danger">BAN USERNAME</a></td>
{% endif %}
{% if up.ip in bannedips %}
<td><a href="/staff/users/unbanip/{{ up.user }}" class="btn btn-warning">UNBAN IP</a></td>
{% else %}
<td><a href="/staff/users/banip/{{ up.user }}" class="btn btn-danger">BAN IP</a></td>
{% endif %}
{% if request.tenant == 'binge' %}
{% if not up.user_verified %}
<td><a href="/staff/users/verify/{{ up.user }}" class="btn btn-primary"> Verify User</a>
</td>
{% else %}
<td><a href="/staff/users/verify/{{ up.user }}" class="btn btn-primary"> Unverify User</a>
</td>
{% endif %}
{% endif %}
</tr>
{% endfor %}
</table>
{% include "pagination.html" with page=userprofiles %}
<td><a href="/staff/users/getrank/" 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 %}