Swift-Query / templates /admin /manage_users.html
Darshan Kumar R
Deploy to Hugging Face Spaces (Clean)
ed0b977
Raw History Blame Contribute Delete
1.67 kB
<!DOCTYPE html>
<html>
<head>
<title>Manage {{ user_type.title() }}</title>
</head>
<body>
<h1>Manage {{ user_type.title() }}</h1>
<a href="{{ url_for('admin.add_user', user_type=user_type) }}">Add {{ user_type.title() }}</a>
<br><br>
<table border="1">
<thead>
<tr>
<th>ID</th>
{% if user_type == 'doctors' or user_type == 'patients' %}
<th>Name</th>
{% endif %}
{% if user_type == 'doctors' %}
<th>Specialization</th>
{% endif %}
<th>Username</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td>{{ user.id }}</td>
{% if user_type == 'doctors' or user_type == 'patients' %}
<td>{{ user.name }}</td>
{% endif %}
{% if user_type == 'doctors' %}
<td>{{ user.specialization }}</td>
{% endif %}
<td>{{ user.username }}</td>
<td>
<a href="{{ url_for('admin.edit_user', user_type=user_type, user_id=user.id) }}">Edit</a>
<form method="post" action="{{ url_for('admin.delete_user', user_type=user_type, user_id=user.id) }}" style="display:inline;">
<button type="submit">Delete</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</body>
</html>