added manager user type
This commit is contained in:
@@ -129,12 +129,16 @@
|
||||
<div class="absolute left-0 bottom-full mb-2 hidden group-hover:block bg-gray-800 text-white text-xs rounded py-1 px-2 w-48">
|
||||
Admin users have full access to manage contacts and system settings.
|
||||
</div>
|
||||
{% if is_last_admin and form.is_admin.data %}
|
||||
<div class="ml-2 text-sm text-amber-600">
|
||||
<i class="fas fa-exclamation-circle"></i>
|
||||
You are the only admin
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="flex items-center relative group">
|
||||
{{ form.is_manager(
|
||||
class="h-4 w-4 focus:ring-blue-500 border-gray-300 rounded",
|
||||
style="accent-color: #16767b;"
|
||||
) }}
|
||||
{{ form.is_manager.label(class="ml-2 block text-sm text-gray-900") }}
|
||||
<div class="absolute left-0 bottom-full mb-2 hidden group-hover:block bg-gray-800 text-white text-xs rounded py-1 px-2 w-48">
|
||||
Manager users have similar permissions to admins but with some restrictions.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if form.is_admin.errors %}
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<select name="role" class="px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-200">
|
||||
<option value="">All Roles</option>
|
||||
<option value="admin" {% if request.args.get('role') == 'admin' %}selected{% endif %}>Admin</option>
|
||||
<option value="manager" {% if request.args.get('role') == 'manager' %}selected{% endif %}>Manager</option>
|
||||
<option value="user" {% if request.args.get('role') == 'user' %}selected{% endif %}>User</option>
|
||||
</select>
|
||||
<button type="button" id="clearFilters" class="px-4 py-2 rounded-lg text-white font-medium transition-colors duration-200"
|
||||
@@ -99,9 +100,9 @@
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<div class="flex flex-row flex-wrap gap-1.5">
|
||||
<span class="inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-sm font-medium"
|
||||
style="background-color: {% if user.is_admin %}rgba(147,51,234,0.1){% else %}rgba(107,114,128,0.1){% endif %}; color: {% if user.is_admin %}#7e22ce{% else %}#374151{% endif %};">
|
||||
<i class="fas fa-{% if user.is_admin %}shield-alt{% else %}user{% endif %}" style="font-size: 0.85em; opacity: 0.7;"></i>
|
||||
{{ 'Admin' if user.is_admin else 'User' }}
|
||||
style="background-color: {% if user.is_admin %}rgba(147,51,234,0.1){% elif user.is_manager %}rgba(59,130,246,0.1){% else %}rgba(107,114,128,0.1){% endif %}; color: {% if user.is_admin %}#7e22ce{% elif user.is_manager %}#2563eb{% else %}#374151{% endif %};">
|
||||
<i class="fas fa-{% if user.is_admin %}shield-alt{% elif user.is_manager %}user-tie{% else %}user{% endif %}" style="font-size: 0.85em; opacity: 0.7;"></i>
|
||||
{{ 'Admin' if user.is_admin else 'Manager' if user.is_manager else 'User' }}
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user