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:
3 files changed
+13
-15
No files matched your search
@@ -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 %}
|
||||
|
||||
Reference in new issue
Block a user