This commit is contained in:
Vivek P Prakash
2025-11-27 11:53:46 +05:30
commit aa40080012
50 changed files with 1135 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
{% extends 'base.html' %}
{% block content %}
<div class="row justify-content-center">
<div class="col-md-4">
<div class="card p-4 shadow-sm">
<h3 class="text-center mb-3">Login</h3>
<form method="post" novalidate>
{% csrf_token %}
{{ form.non_field_errors }}
<div class="mb-3">{{ form.username.label_tag }}{{ form.username }}</div>
<div class="mb-3">{{ form.password.label_tag }}{{ form.password }}</div>
<button class="btn btn-primary w-100">Login</button>
</form>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,7 @@
{% extends 'base.html' %}
{% block content %}
<h3>Delete User</h3>
<p>Are you sure you want to delete <strong>{{ object.username }}</strong>?</p>
<form method="post">{% csrf_token %}<button class="btn btn-danger">Yes, delete</button>
<a class="btn btn-secondary" href="{% url 'accounts:user_list' %}">Cancel</a></form>
{% endblock %}

View File

@@ -0,0 +1,9 @@
{% extends 'base.html' %}
{% block content %}
<h3>{% if object %}Edit{% else %}Add{% endif %} User</h3>
<form method="post">{% csrf_token %}
{{ form.as_p }}
<button class="btn btn-primary">Save</button>
<a class="btn btn-secondary" href="{% url 'accounts:user_list' %}">Cancel</a>
</form>
{% endblock %}

View File

@@ -0,0 +1,27 @@
{% extends 'base.html' %}
{% block content %}
<div class="d-flex justify-content-between mb-3">
<h3>Users</h3>
<a class="btn btn-success" href="{% url 'accounts:user_add' %}">Add User</a>
</div>
<table class="table table-striped">
<thead><tr><th>#</th><th>Username</th><th>Email</th><th>Phone</th><th>Role</th><th>Actions</th></tr></thead>
<tbody>
{% for u in users %}
<tr>
<td>{{ forloop.counter }}</td>
<td>{{ u.username }}</td>
<td>{{ u.email }}</td>
<td>{{ u.phone_number }}</td>
<td>{{ u.role }}</td>
<td>
<a class="btn btn-sm btn-primary" href="{% url 'accounts:user_edit' u.pk %}">Edit</a>
<a class="btn btn-sm btn-danger" href="{% url 'accounts:user_delete' u.pk %}">Delete</a>
</td>
</tr>
{% empty %}
<tr><td colspan="6">No users yet.</td></tr>
{% endfor %}
</tbody>
</table>
{% endblock %}