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 -2
View File
@@ -96,8 +96,8 @@
<label class="block text-sm font-semibold text-gray-900 dark:text-gray-100 mb-1.5">Roles</label>
{% if can_change_role %}
<select name="role" class="w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-950 px-3 py-2 text-sm focus:border-blue-500 focus:ring-1 focus:ring-blue-500 outline-none transition-colors">
{% for r, label in roles_label.items %}
<option value="{{ r }}" {% if editing and current_role == r or not editing and r == 'backend_developer' %}selected{% endif %}>{{ label }}</option>
{% for role in roles %}
<option value="{{ role.slug }}" {% if editing and current_role == role or not editing and role.slug == 'backend_developer' %}selected{% endif %}>{{ role.name }}</option>
{% endfor %}
</select>
{% else %}