feat(templates/users): adopt role objects for branding and selection

Replace role name comparisons with slug checks and display role.name to support dynamic role definitions.
This commit is contained in:
sankalp committed 2026-06-29 06:56:55 +05:45
1 parent 128866bda2
commit b7d43b57f4
3 files changed
+13 -15

No files matched your search

+2 -3
View File
@@ -39,10 +39,9 @@
<p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">Role</p>
<p class="mt-1">
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium
{% if role == 'superadmin' %}bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400
{% elif role == 'manager' %}bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400
{% if role.slug in admin_roles %}bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400
{% else %}bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400{% endif %}">
{% for r, label in roles_label.items %}{% if r == role %}{{ label }}{% endif %}{% endfor %}
{{ role.name|default:"Unassigned" }}
</span>
</p>
</div>