|
c588255…
|
ragelink
|
1 |
{% extends "base.html" %} |
|
c588255…
|
ragelink
|
2 |
{% block title %}{{ role.name }} Role — Fossilrepo{% endblock %} |
|
c588255…
|
ragelink
|
3 |
|
|
c588255…
|
ragelink
|
4 |
{% block content %} |
|
c588255…
|
ragelink
|
5 |
<div class="mb-6"> |
|
c588255…
|
ragelink
|
6 |
<a href="{% url 'organization:role_list' %}" class="text-sm text-brand-light hover:text-brand">← Back to Roles</a> |
|
c588255…
|
ragelink
|
7 |
</div> |
|
c588255…
|
ragelink
|
8 |
|
|
c588255…
|
ragelink
|
9 |
<div class="overflow-hidden rounded-lg bg-gray-800 shadow border border-gray-700"> |
|
c588255…
|
ragelink
|
10 |
<div class="px-6 py-5 sm:flex sm:items-center sm:justify-between"> |
|
c588255…
|
ragelink
|
11 |
<div> |
|
c588255…
|
ragelink
|
12 |
<h1 class="text-2xl font-bold text-gray-100">{{ role.name }}</h1> |
|
c588255…
|
ragelink
|
13 |
<p class="mt-1 text-sm text-gray-400">{{ role.description|default:"No description." }}</p> |
|
c588255…
|
ragelink
|
14 |
</div> |
|
c588255…
|
ragelink
|
15 |
<div class="mt-4 flex items-center gap-3 sm:mt-0"> |
|
c588255…
|
ragelink
|
16 |
{% if role.is_default %} |
|
c588255…
|
ragelink
|
17 |
<span class="inline-flex rounded-full bg-blue-900/50 px-2 text-xs font-semibold leading-5 text-blue-300">Default Role</span> |
|
c588255…
|
ragelink
|
18 |
{% endif %} |
|
c588255…
|
ragelink
|
19 |
{% if perms.organization.change_organization or user.is_superuser %} |
|
c588255…
|
ragelink
|
20 |
<a href="{% url 'organization:role_edit' slug=role.slug %}" |
|
c588255…
|
ragelink
|
21 |
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"> |
|
c588255…
|
ragelink
|
22 |
Edit |
|
c588255…
|
ragelink
|
23 |
</a> |
|
c588255…
|
ragelink
|
24 |
<a href="{% url 'organization:role_delete' slug=role.slug %}" |
|
c588255…
|
ragelink
|
25 |
class="rounded-md bg-red-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-red-500"> |
|
c588255…
|
ragelink
|
26 |
Delete |
|
c588255…
|
ragelink
|
27 |
</a> |
|
c588255…
|
ragelink
|
28 |
{% endif %} |
|
c588255…
|
ragelink
|
29 |
</div> |
|
c588255…
|
ragelink
|
30 |
</div> |
|
c588255…
|
ragelink
|
31 |
|
|
c588255…
|
ragelink
|
32 |
<div class="border-t border-gray-700 px-6 py-5"> |
|
c588255…
|
ragelink
|
33 |
<dl class="grid grid-cols-1 gap-x-4 gap-y-6 sm:grid-cols-2"> |
|
c588255…
|
ragelink
|
34 |
<div> |
|
c588255…
|
ragelink
|
35 |
<dt class="text-sm font-medium text-gray-400">Slug</dt> |
|
c588255…
|
ragelink
|
36 |
<dd class="mt-1 text-sm text-gray-400 font-mono">{{ role.slug }}</dd> |
|
c588255…
|
ragelink
|
37 |
</div> |
|
c588255…
|
ragelink
|
38 |
<div> |
|
c588255…
|
ragelink
|
39 |
<dt class="text-sm font-medium text-gray-400">GUID</dt> |
|
c588255…
|
ragelink
|
40 |
<dd class="mt-1 text-sm text-gray-400 font-mono">{{ role.guid }}</dd> |
|
c588255…
|
ragelink
|
41 |
</div> |
|
c588255…
|
ragelink
|
42 |
<div> |
|
c588255…
|
ragelink
|
43 |
<dt class="text-sm font-medium text-gray-400">Created</dt> |
|
c588255…
|
ragelink
|
44 |
<dd class="mt-1 text-sm text-gray-400">{{ role.created_at|date:"N j, Y g:i a" }}</dd> |
|
c588255…
|
ragelink
|
45 |
</div> |
|
c588255…
|
ragelink
|
46 |
<div> |
|
c588255…
|
ragelink
|
47 |
<dt class="text-sm font-medium text-gray-400">Updated</dt> |
|
c588255…
|
ragelink
|
48 |
<dd class="mt-1 text-sm text-gray-400">{{ role.updated_at|date:"N j, Y g:i a" }}</dd> |
|
c588255…
|
ragelink
|
49 |
</div> |
|
c588255…
|
ragelink
|
50 |
</dl> |
|
c588255…
|
ragelink
|
51 |
</div> |
|
c588255…
|
ragelink
|
52 |
</div> |
|
c588255…
|
ragelink
|
53 |
|
|
c588255…
|
ragelink
|
54 |
<div class="mt-8"> |
|
c588255…
|
ragelink
|
55 |
<h2 class="text-lg font-semibold text-gray-100 mb-4">Permissions</h2> |
|
c588255…
|
ragelink
|
56 |
{% if grouped_permissions %} |
|
c588255…
|
ragelink
|
57 |
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2"> |
|
c588255…
|
ragelink
|
58 |
{% for category, perms in grouped_permissions.items %} |
|
c588255…
|
ragelink
|
59 |
<div class="overflow-hidden rounded-lg border border-gray-700 bg-gray-800 shadow-sm"> |
|
c588255…
|
ragelink
|
60 |
<div class="bg-gray-900 px-4 py-3"> |
|
c588255…
|
ragelink
|
61 |
<h3 class="text-sm font-semibold text-gray-200">{{ category }}</h3> |
|
c588255…
|
ragelink
|
62 |
</div> |
|
c588255…
|
ragelink
|
63 |
<ul class="divide-y divide-gray-700"> |
|
c588255…
|
ragelink
|
64 |
{% for perm in perms %} |
|
c588255…
|
ragelink
|
65 |
<li class="px-4 py-2 text-sm text-gray-400"> |
|
c588255…
|
ragelink
|
66 |
<span class="font-mono text-xs">{{ perm.codename }}</span> |
|
c588255…
|
ragelink
|
67 |
<span class="ml-2 text-gray-500">{{ perm.name }}</span> |
|
c588255…
|
ragelink
|
68 |
</li> |
|
c588255…
|
ragelink
|
69 |
{% endfor %} |
|
c588255…
|
ragelink
|
70 |
</ul> |
|
c588255…
|
ragelink
|
71 |
</div> |
|
c588255…
|
ragelink
|
72 |
{% endfor %} |
|
c588255…
|
ragelink
|
73 |
</div> |
|
c588255…
|
ragelink
|
74 |
{% else %} |
|
c588255…
|
ragelink
|
75 |
<p class="text-sm text-gray-400">No permissions assigned to this role.</p> |
|
c588255…
|
ragelink
|
76 |
{% endif %} |
|
c588255…
|
ragelink
|
77 |
</div> |
|
c588255…
|
ragelink
|
78 |
|
|
c588255…
|
ragelink
|
79 |
<div class="mt-8"> |
|
c588255…
|
ragelink
|
80 |
<h2 class="text-lg font-semibold text-gray-100 mb-4">Members with this Role</h2> |
|
7d099f3…
|
ragelink
|
81 |
<div class="overflow-x-auto rounded-lg border border-gray-700 bg-gray-800 shadow-sm"> |
|
c588255…
|
ragelink
|
82 |
<table class="min-w-full divide-y divide-gray-700"> |
|
c588255…
|
ragelink
|
83 |
<thead class="bg-gray-900"> |
|
c588255…
|
ragelink
|
84 |
<tr> |
|
c588255…
|
ragelink
|
85 |
<th class="px-6 py-3 text-left text-xs font-medium uppercase text-gray-400">Username</th> |
|
c588255…
|
ragelink
|
86 |
<th class="px-6 py-3 text-left text-xs font-medium uppercase text-gray-400">Email</th> |
|
c588255…
|
ragelink
|
87 |
<th class="px-6 py-3 text-left text-xs font-medium uppercase text-gray-400">Status</th> |
|
c588255…
|
ragelink
|
88 |
</tr> |
|
c588255…
|
ragelink
|
89 |
</thead> |
|
c588255…
|
ragelink
|
90 |
<tbody class="divide-y divide-gray-700 bg-gray-800"> |
|
c588255…
|
ragelink
|
91 |
{% for membership in role_members %} |
|
c588255…
|
ragelink
|
92 |
<tr class="hover:bg-gray-700/50"> |
|
c588255…
|
ragelink
|
93 |
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium"> |
|
c588255…
|
ragelink
|
94 |
<a href="{% url 'organization:user_detail' username=membership.member.username %}" class="text-brand-light hover:text-brand">{{ membership.member.username }}</a> |
|
c588255…
|
ragelink
|
95 |
</td> |
|
c588255…
|
ragelink
|
96 |
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-400">{{ membership.member.email|default:"--" }}</td> |
|
c588255…
|
ragelink
|
97 |
<td class="px-6 py-4 whitespace-nowrap"> |
|
c588255…
|
ragelink
|
98 |
{% if membership.is_active %} |
|
c588255…
|
ragelink
|
99 |
<span class="inline-flex rounded-full bg-green-900/50 px-2 text-xs font-semibold leading-5 text-green-300">Active</span> |
|
c588255…
|
ragelink
|
100 |
{% else %} |
|
c588255…
|
ragelink
|
101 |
<span class="inline-flex rounded-full bg-gray-700 px-2 text-xs font-semibold leading-5 text-gray-300">Inactive</span> |
|
c588255…
|
ragelink
|
102 |
{% endif %} |
|
c588255…
|
ragelink
|
103 |
</td> |
|
c588255…
|
ragelink
|
104 |
</tr> |
|
c588255…
|
ragelink
|
105 |
{% empty %} |
|
c588255…
|
ragelink
|
106 |
<tr> |
|
c588255…
|
ragelink
|
107 |
<td colspan="3" class="px-6 py-8 text-center text-sm text-gray-400">No members assigned to this role.</td> |
|
c588255…
|
ragelink
|
108 |
</tr> |
|
c588255…
|
ragelink
|
109 |
{% endfor %} |
|
c588255…
|
ragelink
|
110 |
</tbody> |
|
c588255…
|
ragelink
|
111 |
</table> |
|
c588255…
|
ragelink
|
112 |
</div> |
|
c588255…
|
ragelink
|
113 |
</div> |
|
c588255…
|
ragelink
|
114 |
{% endblock %} |