FossilRepo

fossilrepo / templates / organization / role_confirm_delete.html
1
{% extends "base.html" %}
2
{% block title %}Delete {{ role.name }} — Fossilrepo{% endblock %}
3
4
{% block content %}
5
<div class="mb-6">
6
<a href="{% url 'organization:role_detail' slug=role.slug %}" class="text-sm text-brand-light hover:text-brand">&larr; Back to {{ role.name }}</a>
7
</div>
8
9
<div class="mx-auto max-w-lg">
10
<div class="rounded-lg bg-gray-800 p-6 shadow border border-gray-700">
11
<h2 class="text-lg font-semibold text-gray-100">Delete Role</h2>
12
13
{% if active_members.exists %}
14
<div class="mt-4 rounded-md bg-yellow-900/50 border border-yellow-700 p-4">
15
<p class="text-sm text-yellow-300">
16
This role has <strong>{{ active_members.count }}</strong> active member{{ active_members.count|pluralize }}.
17
You must reassign them to another role before deleting.
18
</p>
19
<ul class="mt-2 text-sm text-yellow-300 list-disc list-inside">
20
{% for membership in active_members %}
21
<li>{{ membership.member.username }}</li>
22
{% endfor %}
23
</ul>
24
</div>
25
<div class="mt-6 flex justify-end">
26
<a href="{% url 'organization:role_detail' slug=role.slug %}"
27
class="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">
28
Go Back
29
</a>
30
</div>
31
{% else %}
32
<p class="mt-2 text-sm text-gray-400">
33
Are you sure you want to delete <strong class="text-gray-100">{{ role.name }}</strong>? This action uses soft delete -- the record will be marked as deleted but can be recovered.
34
</p>
35
<form method="post" class="mt-6 flex justify-end gap-3">
36
{% csrf_token %}
37
<a href="{% url 'organization:role_detail' slug=role.slug %}"
38
class="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">
39
Cancel
40
</a>
41
<button type="submit"
42
class="rounded-md bg-red-600 px-4 py-2 text-sm font-semibold text-white shadow-sm hover:bg-red-500">
43
Delete
44
</button>
45
</form>
46
{% endif %}
47
</div>
48
</div>
49
{% endblock %}
50

Keyboard Shortcuts

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