- Add custom border, background, and spacing utilities to base template - Enhance message notification styling and layout - Update delete modal button appearance and behavior - Refine comment card component with Tailwind classes and responsive behavior - Adjust sidebar responsiveness for mobile view
62 lines
3.6 KiB
HTML
62 lines
3.6 KiB
HTML
{% extends "base_authenticated.html" %}
|
|
{% block title %}Users{% endblock %}
|
|
{% block content_inner %}
|
|
<div class="flex items-center justify-between mb-6">
|
|
<div>
|
|
<h1 class="text-2xl font-bold text-primary">Users</h1>
|
|
<p class="text-tertiary mt-1">Manage system users and their roles.</p>
|
|
</div>
|
|
<a href="{% url 'user_create' %}" class="px-3 py-1.5 rounded-lg text-sm font-medium bg-blue-600 text-white hover:bg-blue-700 transition-colors">
|
|
<svg class="w-4 h-4 mr-1 inline" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/></svg>
|
|
New User
|
|
</a>
|
|
</div>
|
|
<div class="card-surface overflow-hidden">
|
|
<div class="overflow-x-auto">
|
|
<table class="w-full text-sm">
|
|
<thead>
|
|
<tr class="text-xs font-semibold text-muted uppercase tracking-wider bg-hover">
|
|
<th class="px-4 py-3 text-left">User</th>
|
|
<th class="px-4 py-3 text-left">Email</th>
|
|
<th class="px-4 py-3 text-left">Role</th>
|
|
<th class="px-4 py-3 text-left">Status</th>
|
|
<th class="px-4 py-3 text-left"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for u in users %}
|
|
<tr class="hover:bg-hover transition-colors border-t border-subtle">
|
|
<td class="px-4 py-3">
|
|
<div class="flex items-center gap-3">
|
|
<div class="w-8 h-8 rounded-full bg-blue-600 flex items-center justify-center text-white text-xs font-bold">{{ u.username|first|upper }}</div>
|
|
<a href="{% url 'user_detail' u.pk %}" class="font-medium text-primary hover:text-blue-600">{{ u.username }}</a>
|
|
</div>
|
|
</td>
|
|
<td class="px-4 py-3 text-secondary">{{ u.email|default:"-" }}</td>
|
|
<td class="px-4 py-3">
|
|
<span class="text-xs px-2 py-1 rounded-full font-medium border {% if u.role == 'admin' %}bg-sky-50 text-sky-700 border-sky-200{% elif u.role == 'client' %}bg-blue-50 text-blue-700 border-blue-200{% else %}bg-green-50 text-green-700 border-green-200{% endif %}">
|
|
{{ u.get_role_display }}
|
|
</span>
|
|
</td>
|
|
<td class="px-4 py-3">
|
|
{% if u.is_active %}
|
|
<span class="text-xs px-2 py-1 rounded-full font-medium border bg-green-50 text-green-700 border-green-200">Active</span>
|
|
{% else %}
|
|
<span class="text-xs px-2 py-1 rounded-full font-medium border bg-red-50 text-red-700 border-red-200">Inactive</span>
|
|
{% endif %}
|
|
</td>
|
|
<td class="px-4 py-3">
|
|
<div class="flex gap-1">
|
|
<a href="{% url 'user_detail' u.pk %}" class="px-3 py-1.5 rounded-lg text-sm font-medium text-secondary hover:bg-hover border border-soft transition-colors">View</a>
|
|
<a href="{% url 'user_edit' u.pk %}" class="px-3 py-1.5 rounded-lg text-sm font-medium text-secondary hover:bg-hover border border-soft transition-colors">Edit</a>
|
|
<a href="{% url 'user_delete' u.pk %}" class="px-3 py-1.5 rounded-lg text-sm font-medium bg-red-50 text-red-700 hover:bg-red-100 border border-red-200 transition-colors">Delete</a>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|