FossilRepo

fossilrepo / templates / organization / user_detail.html
1
{% extends "base.html" %}
2
{% block title %}{{ target_user.username }} — Fossilrepo{% endblock %}
3
4
{% block content %}
5
<div class="mb-6">
6
<a href="{% url 'organization:members' %}" class="text-sm text-brand-light hover:text-brand">&larr; Back to Members</a>
7
</div>
8
9
<div class="overflow-hidden rounded-lg bg-gray-800 shadow border border-gray-700">
10
<div class="px-6 py-5 sm:flex sm:items-center sm:justify-between">
11
<div>
12
<h1 class="text-2xl font-bold text-gray-100">{{ target_user.username }}</h1>
13
<p class="mt-1 text-sm text-gray-400">{{ target_user.get_full_name|default:"No name set" }}</p>
14
</div>
15
<div class="mt-4 flex gap-3 sm:mt-0">
16
{% if can_manage %}
17
<a href="{% url 'organization:user_edit' username=target_user.username %}"
18
class="rounded-md bg-gray-700 px-3 py-2 text-sm font-semibold text-gray-100 shadow-sm ring-1 ring-inset ring-gray-600 hover:bg-gray-600">
19
Edit
20
</a>
21
<a href="{% url 'organization:user_password' username=target_user.username %}"
22
class="rounded-md bg-gray-700 px-3 py-2 text-sm font-semibold text-gray-100 shadow-sm ring-1 ring-inset ring-gray-600 hover:bg-gray-600">
23
Change Password
24
</a>
25
{% elif request.user.pk == target_user.pk %}
26
<a href="{% url 'organization:user_password' username=target_user.username %}"
27
class="rounded-md bg-gray-700 px-3 py-2 text-sm font-semibold text-gray-100 shadow-sm ring-1 ring-inset ring-gray-600 hover:bg-gray-600">
28
Change Password
29
</a>
30
{% endif %}
31
</div>
32
</div>
33
34
<div class="border-t border-gray-700 px-6 py-5">
35
<dl class="grid grid-cols-1 gap-x-4 gap-y-6 sm:grid-cols-2">
36
<div>
37
<dt class="text-sm font-medium text-gray-400">Email</dt>
38
<dd class="mt-1 text-sm text-gray-100">{{ target_user.email|default:"--" }}</dd>
39
</div>
40
<div>
41
<dt class="text-sm font-medium text-gray-400">Full Name</dt>
42
<dd class="mt-1 text-sm text-gray-100">{{ target_user.get_full_name|default:"--" }}</dd>
43
</div>
44
<div>
45
<dt class="text-sm font-medium text-gray-400">Status</dt>
46
<dd class="mt-1">
47
{% if target_user.is_active %}
48
<span class="inline-flex rounded-full bg-green-900/50 px-2 text-xs font-semibold leading-5 text-green-300">Active</span>
49
{% else %}
50
<span class="inline-flex rounded-full bg-gray-700 px-2 text-xs font-semibold leading-5 text-gray-300">Inactive</span>
51
{% endif %}
52
{% if target_user.is_staff %}
53
<span class="ml-1 inline-flex rounded-full bg-purple-900/50 px-2 text-xs font-semibold leading-5 text-purple-300">Staff</span>
54
{% endif %}
55
{% if target_user.is_superuser %}
56
<span class="ml-1 inline-flex rounded-full bg-yellow-900/50 px-2 text-xs font-semibold leading-5 text-yellow-300">Superuser</span>
57
{% endif %}
58
</dd>
59
</div>
60
<div>
61
<dt class="text-sm font-medium text-gray-400">Date Joined</dt>
62
<dd class="mt-1 text-sm text-gray-400">{{ target_user.date_joined|date:"N j, Y g:i a" }}</dd>
63
</div>
64
<div>
65
<dt class="text-sm font-medium text-gray-400">Last Login</dt>
66
<dd class="mt-1 text-sm text-gray-400">{{ target_user.last_login|date:"N j, Y g:i a"|default:"Never" }}</dd>
67
</div>
68
{% if membership %}
69
<div>
70
<dt class="text-sm font-medium text-gray-400">Member Since</dt>
71
<dd class="mt-1 text-sm text-gray-400">{{ membership.created_at|date:"N j, Y g:i a" }}</dd>
72
</div>
73
<div>
74
<dt class="text-sm font-medium text-gray-400">Role</dt>
75
<dd class="mt-1">
76
{% if membership.role %}
77
<a href="{% url 'organization:role_detail' slug=membership.role.slug %}" class="inline-flex rounded-full bg-purple-900/50 px-2 text-xs font-semibold leading-5 text-purple-300 hover:text-purple-200">{{ membership.role.name }}</a>
78
<p class="mt-1 text-xs text-gray-500">{{ membership.role.description }}</p>
79
{% else %}
80
<span class="text-sm text-gray-500">No role assigned</span>
81
{% endif %}
82
</dd>
83
</div>
84
{% endif %}
85
</dl>
86
</div>
87
</div>
88
89
<div class="mt-8">
90
<h2 class="text-lg font-semibold text-gray-100 mb-4">Team Memberships</h2>
91
<div class="overflow-x-auto rounded-lg border border-gray-700 bg-gray-800 shadow-sm">
92
<table class="min-w-full divide-y divide-gray-700">
93
<thead class="bg-gray-900">
94
<tr>
95
<th class="px-6 py-3 text-left text-xs font-medium uppercase text-gray-400">Team</th>
96
<th class="px-6 py-3 text-left text-xs font-medium uppercase text-gray-400">Description</th>
97
</tr>
98
</thead>
99
<tbody class="divide-y divide-gray-700 bg-gray-800">
100
{% for team in user_teams %}
101
<tr class="hover:bg-gray-700/50">
102
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
103
<a href="{% url 'organization:team_detail' slug=team.slug %}" class="text-brand-light hover:text-brand">{{ team.name }}</a>
104
</td>
105
<td class="px-6 py-4 text-sm text-gray-400">{{ team.description|default:"--"|truncatewords:15 }}</td>
106
</tr>
107
{% empty %}
108
<tr>
109
<td colspan="2" class="px-6 py-8 text-center text-sm text-gray-400">Not a member of any teams.</td>
110
</tr>
111
{% endfor %}
112
</tbody>
113
</table>
114
</div>
115
</div>
116
117
<div class="mt-8">
118
<h2 class="text-lg font-semibold text-gray-100 mb-4">SSH Keys</h2>
119
<div class="overflow-x-auto rounded-lg border border-gray-700 bg-gray-800 shadow-sm">
120
<table class="min-w-full divide-y divide-gray-700">
121
<thead class="bg-gray-900">
122
<tr>
123
<th class="px-6 py-3 text-left text-xs font-medium uppercase text-gray-400">Title</th>
124
<th class="px-6 py-3 text-left text-xs font-medium uppercase text-gray-400">Type</th>
125
<th class="px-6 py-3 text-left text-xs font-medium uppercase text-gray-400">Fingerprint</th>
126
<th class="px-6 py-3 text-left text-xs font-medium uppercase text-gray-400">Added</th>
127
</tr>
128
</thead>
129
<tbody class="divide-y divide-gray-700 bg-gray-800">
130
{% for key in ssh_keys %}
131
<tr class="hover:bg-gray-700/50">
132
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-100">{{ key.title }}</td>
133
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-400">{{ key.key_type|default:"--" }}</td>
134
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-400 font-mono">{{ key.fingerprint|default:"--"|truncatechars:30 }}</td>
135
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-400">{{ key.created_at|date:"N j, Y" }}</td>
136
</tr>
137
{% empty %}
138
<tr>
139
<td colspan="4" class="px-6 py-8 text-center text-sm text-gray-400">No SSH keys.</td>
140
</tr>
141
{% endfor %}
142
</tbody>
143
</table>
144
</div>
145
</div>
146
{% endblock %}
147

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button