Files
django_wallet/templates/wallet_api/list_users.html

65 lines
1.5 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>
<th>Action</th>
</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>
<td id="user-status">
{% if user.status == "enabled" %}
<a
{% if ase_adm_group %}
href="{% url 'disable_user' user.slug %}"
{% endif %}>
<button class="btn btn-danger btn-sm"
{% if not ase_adm_group %}
disabled
{% endif %}
>Disable</button>
</a>
{% else %}
<a
{% if ase_adm_group %}
href="{% url 'enable_user' user.slug %}"
{% endif %}>
<button class="btn btn-warning btn-sm"
{% if not ase_adm_group %}
disabled
{% endif %}
>Enable</button>
</a>
{% endif %}
</td>
</tr>
{% empty %}
<tr>
<td colspan="5"><i> No users </i></td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock content %}