Files
django_wallet/templates/wallet_api/list_users.html
2025-02-06 15:10:51 +01:00

59 lines
1.4 KiB
HTML

{% extends 'layouts/blank.html' %} {% block content %}
<h1>List Mosquitto Users</h1>
{% if ase_adm_group %}
<a href="{% url 'create_user' %}">
<button class="btn btn-primary mb-3">Add User</button>
</a>
{% endif %}
<table class="table table-striped">
<thead>
<tr>
<th>Site</th>
<th>Username</th>
<th>Client ID</th>
<th>Topic</th>
{% if ase_adm_group %}
<th>Actions</th>
<th> </th>
{% endif %}
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td>{{user.site}}</td>
<td>{% if ase_adm_group %}
<a href="{% url 'edit_user' user.slug %}">
{% endif %}
{{user.username}}</a>
</td>
<td>{{user.client_id}}</td>
<td>{{user.topic}}</td>
{% if ase_adm_group %}
<td>
{% if user.status == "enabled" %}
<a href="{% url 'disable_user' user.slug %}"
<button class="btn btn-warning btn-sm" >Disable</button>
</a>
{% else %}
<a href="{% url 'enable_user' user.slug %}"
<button class="btn btn-info btn-sm" >Enable</button>
</a>
{% endif %}
<td><a href="{% url 'delete_user' user.slug %}">
<button class="btn btn-danger btn-sm">Delete</button>
</a></td>
</td>
{% endif %}
</tr>
{% empty %}
<tr>
<td colspan="5"><i> No users </i></td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock content %}