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.
This commit is contained in:
5 files changed
+106
-12
No files matched your search
@@ -785,9 +785,9 @@ class="space-y-6"
|
||||
<select name="role" required
|
||||
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">
|
||||
<option value="">Select a role</option>
|
||||
{% for role_key, role_label in role_choices %}
|
||||
{% if role_key not in admin_roles %}
|
||||
<option value="{{ role_key }}">{{ role_label }}</option>
|
||||
{% for role in role_choices %}
|
||||
{% if role.slug not in admin_roles %}
|
||||
<option value="{{ role.slug }}">{{ role.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
@@ -826,7 +826,7 @@ class="space-y-6"
|
||||
<tbody class="divide-y divide-gray-100 dark:divide-gray-700">
|
||||
{% for perm in permissions %}
|
||||
<tr class="hover:bg-gray-50 dark:hover:bg-gray-800/30">
|
||||
<td class="px-4 py-3 font-medium text-gray-900 dark:text-white">{{ perm.get_role_display }}</td>
|
||||
<td class="px-4 py-3 font-medium text-gray-900 dark:text-white">{{ perm.role_display_name }}</td>
|
||||
<td class="px-4 py-3">
|
||||
<div class="flex flex-wrap gap-1.5">
|
||||
{% for status in perm.move_to_statuses.all %}
|
||||
@@ -842,7 +842,7 @@ class="space-y-6"
|
||||
<td class="px-4 py-3 text-right">
|
||||
<form method="post" action="{% url 'board-permission-delete' selected_project.id perm.id %}" class="inline">
|
||||
{% csrf_token %}
|
||||
<button type="button" @click="confirmAction({title:'Delete Permission', message:'Delete permission for <strong>' + '{{ perm.get_role_display|escapejs }}' + '</strong>?', confirmText:'Delete', danger:true, onConfirm:function(){ $el.closest('form').submit() }})" class="inline-flex items-center gap-1 px-2.5 py-1.5 text-xs font-medium text-red-600 dark:text-red-400 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors shadow-sm">
|
||||
<button type="button" @click="confirmAction({title:'Delete Permission', message:'Delete permission for <strong>' + '{{ perm.role_display_name|escapejs }}' + '</strong>?', confirmText:'Delete', danger:true, onConfirm:function(){ $el.closest('form').submit() }})" class="inline-flex items-center gap-1 px-2.5 py-1.5 text-xs font-medium text-red-600 dark:text-red-400 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors shadow-sm">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
Reference in new issue
Block a user