first push

This commit is contained in:
2025-05-23 14:44:12 +08:00
commit abefd1b19b
817 changed files with 580289 additions and 0 deletions
+70
View File
@@ -0,0 +1,70 @@
{% if page_object %}
{% load static %}
{% for user in page_object %}
<tr>
<td>
{% if page_object.start_index %}
{{page_object.start_index|add:forloop.counter0}}
{% else %}
{{forloop.counter}}
{% endif %}
</td>
<td>
<div class="user-img d-flex align-items-center">
<div class="avatar avatar-lg">
{% if user.profile_pic %}
<img src="{{user.profile_pic.url}}">
{% else %}
<img src="{% static 'assets/images/faces/1.jpg' %}">
{% endif %}
</div>
</div>
</td>
<td>{{user.full_name | title}}</td>
<td>{{user.email}}</td>
<td>{{user.role}}</td>
<td>
{% if user.access_level %}
All
{% else %}
Only Assigned
{% endif %}
</td>
<td>{{user.last_login}}</td>
{% if request.user.is_superuser %}
<td>
<div class="form-check form-switch">
<input
class="form-check-input"
hx-post="{% url 'users:status' user.id %}"
hx-headers='{"X-CSRFToken":"{{ csrf_token }}"}'
type="checkbox" {% if user.is_active %} checked {% endif %}
style="cursor: pointer;"
>
</div>
</td>
{% endif %}
<td>
<div class="btn-group btn-group-sm" role="group" aria-label="Basic example">
{% if perms.authentication.view_users %}
<a href="{% url 'users:details' user.id %}" class="btn btn-success"><i class="bi bi-eye-fill"></i></a>
{% endif %}
{% if perms.authentication.edit_users %}
<button type="button" class="btn btn-info"
hx-get="{% url 'users:update' user.id %}" hx-target="#update-user-modal-content"
data-bs-toggle="modal" data-bs-target="#update-user-modal"
><i class="bi bi-pencil-square"></i></button>
{% endif %}
{% if perms.authentication.delete_users %}
<form action="{% url 'users:delete' user.id %}" method="post" onsubmit="return confirm('Are you sure you want to delete this?')">
{% csrf_token %}
<button type="submit" value="Delete" class="btn btn-sm btn-danger"><i class="bi bi-trash3-fill"></i></button>
</form>
{% endif %}
</div>
</td>
</tr>
{% endfor %}
{% else %}
<td colspan="8" class="text-center"> No record found related to your search keyword</td>
{% endif %}