|
c588255…
|
ragelink
|
1 |
{% extends "base.html" %} |
|
c588255…
|
ragelink
|
2 |
{% block title %}Roles — Fossilrepo{% endblock %} |
|
c588255…
|
ragelink
|
3 |
|
|
c588255…
|
ragelink
|
4 |
{% block content %} |
|
c588255…
|
ragelink
|
5 |
<div class="mb-6"> |
|
c588255…
|
ragelink
|
6 |
<a href="{% url 'organization:settings' %}" class="text-sm text-brand-light hover:text-brand">← Back to Settings</a> |
|
c588255…
|
ragelink
|
7 |
</div> |
|
c588255…
|
ragelink
|
8 |
|
|
c588255…
|
ragelink
|
9 |
<div class="md:flex md:items-center md:justify-between mb-6"> |
|
c588255…
|
ragelink
|
10 |
<h1 class="text-2xl font-bold text-gray-100">Roles</h1> |
|
c588255…
|
ragelink
|
11 |
<div class="mt-4 md:mt-0 flex gap-3"> |
|
c588255…
|
ragelink
|
12 |
{% if not roles %} |
|
c588255…
|
ragelink
|
13 |
{% if perms.organization.change_organization or user.is_superuser %} |
|
c588255…
|
ragelink
|
14 |
<form method="post" action="{% url 'organization:role_initialize' %}"> |
|
c588255…
|
ragelink
|
15 |
{% csrf_token %} |
|
c588255…
|
ragelink
|
16 |
<button type="submit" |
|
c588255…
|
ragelink
|
17 |
class="inline-flex items-center rounded-md bg-gray-700 px-4 py-2 text-sm font-semibold text-gray-100 shadow-sm ring-1 ring-inset ring-gray-600 hover:bg-gray-600"> |
|
c588255…
|
ragelink
|
18 |
Initialize Roles |
|
c588255…
|
ragelink
|
19 |
</button> |
|
c588255…
|
ragelink
|
20 |
</form> |
|
c588255…
|
ragelink
|
21 |
{% endif %} |
|
c588255…
|
ragelink
|
22 |
{% endif %} |
|
c588255…
|
ragelink
|
23 |
{% if perms.organization.change_organization or user.is_superuser %} |
|
c588255…
|
ragelink
|
24 |
<a href="{% url 'organization:role_create' %}" |
|
c588255…
|
ragelink
|
25 |
class="inline-flex items-center rounded-md bg-brand px-4 py-2 text-sm font-semibold text-white shadow-sm hover:bg-brand-hover"> |
|
c588255…
|
ragelink
|
26 |
Create Role |
|
c588255…
|
ragelink
|
27 |
</a> |
|
c588255…
|
ragelink
|
28 |
{% endif %} |
|
c588255…
|
ragelink
|
29 |
</div> |
|
c588255…
|
ragelink
|
30 |
</div> |
|
c588255…
|
ragelink
|
31 |
|
|
c588255…
|
ragelink
|
32 |
{% if roles %} |
|
c588255…
|
ragelink
|
33 |
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2"> |
|
c588255…
|
ragelink
|
34 |
{% for role in roles %} |
|
c588255…
|
ragelink
|
35 |
<a href="{% url 'organization:role_detail' slug=role.slug %}" |
|
c588255…
|
ragelink
|
36 |
class="group block overflow-hidden rounded-lg bg-gray-800 shadow border border-gray-700 hover:border-brand p-5 transition-colors"> |
|
c588255…
|
ragelink
|
37 |
<div class="flex items-start justify-between"> |
|
c588255…
|
ragelink
|
38 |
<div> |
|
c588255…
|
ragelink
|
39 |
<h3 class="text-lg font-semibold text-gray-100 group-hover:text-brand-light">{{ role.name }}</h3> |
|
c588255…
|
ragelink
|
40 |
<p class="mt-1 text-sm text-gray-400">{{ role.description|default:"No description." }}</p> |
|
c588255…
|
ragelink
|
41 |
</div> |
|
c588255…
|
ragelink
|
42 |
{% if role.is_default %} |
|
c588255…
|
ragelink
|
43 |
<span class="inline-flex rounded-full bg-blue-900/50 px-2 text-xs font-semibold leading-5 text-blue-300">Default</span> |
|
c588255…
|
ragelink
|
44 |
{% endif %} |
|
c588255…
|
ragelink
|
45 |
</div> |
|
c588255…
|
ragelink
|
46 |
<div class="mt-4 flex items-center gap-4 text-sm text-gray-400"> |
|
c588255…
|
ragelink
|
47 |
<span class="flex items-center gap-1"> |
|
c588255…
|
ragelink
|
48 |
<svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> |
|
c588255…
|
ragelink
|
49 |
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z" /> |
|
c588255…
|
ragelink
|
50 |
</svg> |
|
c588255…
|
ragelink
|
51 |
{{ role.permission_count }} permission{{ role.permission_count|pluralize }} |
|
c588255…
|
ragelink
|
52 |
</span> |
|
c588255…
|
ragelink
|
53 |
<span class="flex items-center gap-1"> |
|
c588255…
|
ragelink
|
54 |
<svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> |
|
c588255…
|
ragelink
|
55 |
<path stroke-linecap="round" stroke-linejoin="round" d="M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z" /> |
|
c588255…
|
ragelink
|
56 |
</svg> |
|
c588255…
|
ragelink
|
57 |
{{ role.member_count }} member{{ role.member_count|pluralize }} |
|
c588255…
|
ragelink
|
58 |
</span> |
|
c588255…
|
ragelink
|
59 |
</div> |
|
c588255…
|
ragelink
|
60 |
</a> |
|
c588255…
|
ragelink
|
61 |
{% endfor %} |
|
c588255…
|
ragelink
|
62 |
</div> |
|
c588255…
|
ragelink
|
63 |
{% else %} |
|
c588255…
|
ragelink
|
64 |
<div class="rounded-lg border border-gray-700 bg-gray-800 px-6 py-12 text-center shadow"> |
|
c588255…
|
ragelink
|
65 |
<svg class="mx-auto h-12 w-12 text-gray-500" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> |
|
c588255…
|
ragelink
|
66 |
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z" /> |
|
c588255…
|
ragelink
|
67 |
</svg> |
|
c588255…
|
ragelink
|
68 |
<h3 class="mt-2 text-sm font-semibold text-gray-100">No roles defined</h3> |
|
c588255…
|
ragelink
|
69 |
<p class="mt-1 text-sm text-gray-400">Initialize the default roles to get started with role-based access control.</p> |
|
c588255…
|
ragelink
|
70 |
</div> |
|
c588255…
|
ragelink
|
71 |
{% endif %} |
|
c588255…
|
ragelink
|
72 |
{% endblock %} |