/
list.html
83 lines (72 loc) · 3.9 KB
/
list.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
{% extends "sentry/bases/admin.html" %}
{% load i18n %}
{% load sentry_helpers %}
{% block title %}{% trans "Manage Users" %} | {{ block.super }}{% endblock %}
{% block admin-nav-users %} class="active"{% endblock %}
{% block page_header %}
<a href="{% url 'sentry-admin-new-user' %}" class="btn pull-right btn-primary">{% trans "Create a new user" %}</a>
{{ block.super }}
{% endblock %}
{% block inner %}
{% paginator user_list from request as user_list per_page 50 %}
<form class="btn-toolbar" method="GET" action="">
<input type="text" name="uquery" value="{% if user_query %}{{ user_query }}{% endif %}" placeholder="search by email address">
<div class="btn-group pull-right">
<a class="btn prev{% if not user_list.paginator.has_previous %} disabled{% else %}" href="?{{ user_list.query_string|escape }}&p={{ user_list.paginator.previous_page }}{% endif %}"><span>{% trans "Previous" %}</span></a>
<a class="btn next{% if not user_list.paginator.has_next %} disabled{% else %}" href="?{{ user_list.query_string|escape }}&p={{ user_list.paginator.next_page }}{% endif %}"><span>{% trans "Next" %}</span></a>
</div>
</form>
{% if user_list.paginator.objects %}
{% querystring from request without sort as sort_querystring %}
<table class="table table-bordered table-striped">
<colgroup>
<col>
<col style="width:150px;">
<col style="width:150px;">
</colgroup>
<thead>
<tr>
<th><a href="?{{ sort_querystring }}&sort=name">{% trans "Name" %}</a></th>
<th style="text-align:center;"><a href="?{{ sort_querystring }}&sort=joined">{% trans "Joined" %}</a></th>
<th style="text-align:center;"><a href="?{{ sort_querystring }}&sort=login">{% trans "Last Login" %}</a></th>
</tr>
</thead>
<tbody>
{% for user in user_list.paginator.objects %}
<tr>
<td>
<a href="{% url 'sentry-admin-edit-user' user.pk %}">
{{ user.username }}
</a>
{% if not user.is_active %}
<em>inactive account</em>
{% endif %}
<br/>
<small>
{% if user.first_name %}
{{ user.first_name }} ({{ user.email }})
{% else %}
{{ user.email }}
{% endif %}
</small>
</td>
<td style="text-align:center; vertical-align:middle;">
{{ user.date_joined|date }}
</td>
<td style="text-align:center; vertical-align:middle;">
{{ user.last_login|date }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="alert alert-notice">{% trans "There are no users matching your query in Sentry." %}</p>
{% endif %}
<div class="btn-toolbar">
<div class="btn-group pull-right">
<a class="btn prev{% if not user_list.paginator.has_previous %} disabled{% else %}" href="?{{ user_list.query_string|escape }}&p={{ user_list.paginator.previous_page }}{% endif %}"><span>{% trans "Previous" %}</span></a>
<a class="btn next{% if not user_list.paginator.has_next %} disabled{% else %}" href="?{{ user_list.query_string|escape }}&p={{ user_list.paginator.next_page }}{% endif %}"><span>{% trans "Next" %}</span></a>
</div>
</div>
{% endblock %}