From 7431c8f0508a772603733f4e0fe2519d97a5dd88 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Mon, 29 Jun 2026 06:57:52 +0545 Subject: [PATCH] refactor(templates): use role_display_name and improve role/admin clarity Clarify role display names, refine admin role labeling, and update confirmation messages for better UX. --- templates/accounts/roles.html | 90 ++++++++++++++++++++++++ templates/components/mobile_sidebar.html | 3 +- templates/components/sidebar.html | 5 +- templates/projects/board.html | 10 +-- templates/projects/detail.html | 10 +-- 5 files changed, 106 insertions(+), 12 deletions(-) create mode 100644 templates/accounts/roles.html diff --git a/templates/accounts/roles.html b/templates/accounts/roles.html new file mode 100644 index 0000000..6ed7f1d --- /dev/null +++ b/templates/accounts/roles.html @@ -0,0 +1,90 @@ +{% extends "base.html" %} +{% block title %}Roles{% endblock %} +{% block breadcrumb %} + +{% endblock %} +{% block content %} +
+
+

Roles

+

{{ roles.count }} role{{ roles.count|pluralize }}

+
+
+ +{% if request.user.is_admin %} +
+

Create Custom Role

Define a new role for your organization

+
+
+ {% csrf_token %} +
+ + +
+ +
+
+
+{% endif %} + +
+

All Roles

System roles cannot be deleted

+
+ + + + + + + + {% if request.user.is_admin %} + + {% endif %} + + + + {% for r in roles %} + + + + + + {% if request.user.is_admin %} + + {% endif %} + + {% empty %} + + {% endfor %} + +
NameSlugTypeUsersActions
+ {{ r.name }} + {% if r.slug in admin_roles %} + System + {% endif %} + {{ r.slug }} + {% if r.slug in admin_roles %} + Hardcoded — full access + {% else %} + Custom — follows rules + {% endif %} + {{ r.users.count }} + {% if not r.is_system %} +
+ {% csrf_token %} + +
+ {% else %} + Protected + {% endif %} +
No roles defined
+
+
+{% endblock %} diff --git a/templates/components/mobile_sidebar.html b/templates/components/mobile_sidebar.html index e7b059c..792454b 100644 --- a/templates/components/mobile_sidebar.html +++ b/templates/components/mobile_sidebar.html @@ -21,8 +21,9 @@ Tickets Ticket Timeline Epics - {% if request.user.role == 'superadmin' %} + {% if request.user.is_admin %}

Administration

+ Roles Users {{ total_users }} diff --git a/templates/components/sidebar.html b/templates/components/sidebar.html index 5645266..387fe64 100644 --- a/templates/components/sidebar.html +++ b/templates/components/sidebar.html @@ -54,8 +54,11 @@ UI Settings - {% if request.user.role == 'superadmin' %} + {% if request.user.is_admin %}

Administration

+ + Roles + Users {{ total_users }} diff --git a/templates/projects/board.html b/templates/projects/board.html index f4ed627..c7082ed 100644 --- a/templates/projects/board.html +++ b/templates/projects/board.html @@ -785,9 +785,9 @@ class="space-y-6" @@ -826,7 +826,7 @@ class="space-y-6" {% for perm in permissions %} - {{ perm.get_role_display }} + {{ perm.role_display_name }}
{% for status in perm.move_to_statuses.all %} @@ -842,7 +842,7 @@ class="space-y-6"
{% csrf_token %} -
diff --git a/templates/projects/detail.html b/templates/projects/detail.html index 92fee65..94a4068 100644 --- a/templates/projects/detail.html +++ b/templates/projects/detail.html @@ -722,9 +722,9 @@ @@ -763,7 +763,7 @@ {% for perm in permissions %} - {{ perm.get_role_display }} + {{ perm.role_display_name }}
{% for status in perm.move_to_statuses.all %} @@ -779,7 +779,7 @@
{% csrf_token %} -