haikal/templates/groups/group_list.html
2025-06-30 13:57:19 +03:00

63 lines
2.8 KiB
HTML

{% extends "base.html" %}
{% load i18n %}
{% load render_table from django_tables2 %}
{% block title %}{% trans "Groups" %}{% endblock title %}
{% block content %}
<section class="">
<div class="row mt-4">
<div class="col-auto">
<div class="d-md-flex justify-content-between">
<div>
<a href="{% url 'group_create' request.dealer.slug %}" class="btn btn-sm btn-phoenix-primary me-5"><span class="fas fa-plus me-2"></span>{% trans "Add Group" %}</a>
<a href="{% url 'user_list' request.dealer.slug %}" class="btn btn-sm btn-phoenix-secondary"><span class="fas fas fa-arrow-left me-2"></span>{% trans "Back to Staffs" %}</a>
</div>
</div>
</div>
<div class="table-responsive scrollbar mx-n1 px-1 mt-3">
<table class="table align-items-center table-flush table-hover">
<thead>
<tr class="bg-body-highlight">
<th>{% trans 'name'|capfirst %}</th>
<th>{% trans 'total Users'|capfirst %}</th>
<th>{% trans 'total permission'|capfirst %}</th>
<th>{% trans 'actions'|capfirst %}</th>
</tr>
</thead>
<tbody>
{% for group in groups %}
<tr>
<td class="align-middle white-space-nowrap ps-1">{{ group.name }}</td>
<td class="align-middle white-space-nowrap"><i class="fa-solid fa-users me-1"></i> {{ group.users.count }}</td>
<td class="align-middle white-space-nowrap"><i class="fa-solid fa-unlock me-1"></i> {{ group.permissions.count }}</td>
<td class="align-middle white-space-nowrap">
<a class="btn btn-phoenix-success"
href="{% url 'group_detail' request.dealer.slug group.id %}">
<i class="fa-solid fa-eye"></i>
{% trans 'view'|capfirst %}
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% if page_obj.paginator.num_pages > 1 %}
<div class="d-flex justify-content-end mt-3">
<div class="d-flex">
{% include 'partials/pagination.html'%}
</div>
</div>
{% endif %}
</div>
</section>
{% endblock %}