major update

This commit is contained in:
2025-08-25 12:37:50 +05:30
parent 0d6aa5ad02
commit b608f6ca0f
8 changed files with 6 additions and 6 deletions
@@ -0,0 +1,45 @@
{% extends "core/base.html" %}
{% block content %}
<div class="container my-5">
<div class="card shadow-lg">
<div class="card-header bg-primary text-white d-flex justify-content-between align-items-center">
<h3>{{ department.name }} Department</h3>
<a href="{% url 'manage_departments' %}" class="btn btn-light btn-sm">⬅ Back</a>
</div>
<div class="card-body">
<h5>Department Users</h5>
{% if users %}
<ul class="list-group mb-3">
{% for user in users %}
<li class="list-group-item">
{{ user.username }} — {{ user.email }}
</li>
{% endfor %}
</ul>
{% else %}
<p class="text-muted">No users registered in this department yet.</p>
{% endif %}
<hr>
<h5>Register New User for {{ department.name }}</h5>
<form method="post" class="row g-2">
{% csrf_token %}
<div class="col-md-3">
<input type="text" name="username" class="form-control" placeholder="Username" required>
</div>
<div class="col-md-3">
<input type="email" name="email" class="form-control" placeholder="Email">
</div>
<div class="col-md-3">
<input type="password" name="password" class="form-control" placeholder="Password" required>
</div>
<div class="col-md-3">
<button type="submit" class="btn btn-primary w-100">Create User</button>
</div>
</form>
</div>
</div>
</div>
{% endblock %}
@@ -0,0 +1,48 @@
<!-- core/templates/core/manage_departments.html -->
{% extends "core/base.html" %}
{% block content %}
<div class="container my-5">
<div class="card shadow-lg">
<div class="card-header bg-success text-white d-flex justify-content-between align-items-center">
<h3>Manage Departments</h3>
<a href="{% url 'superadmin_dashboard' %}" class="btn btn-light btn-sm">Back to Dashboard</a>
</div>
<div class="card-body">
<!-- List departments -->
{% if departments %}
<ul class="list-group mb-3">
{% for dept in departments %}
<a href="{% url 'department_detail' dept.pk %}"
class="list-group-item list-group-item-action d-flex justify-content-between align-items-center">
<span>
<strong>{{ dept.name }}</strong><br>
<small class="text-muted">{{ dept.description }}</small>
</span>
<span class="badge bg-primary rounded-pill">Manage</span>
</a>
{% endfor %}
</ul>
{% else %}
<p class="text-muted">No departments added yet.</p>
{% endif %}
<!-- Add new department form -->
<form method="post" class="mt-3">
{% csrf_token %}
<div class="row g-2">
<div class="col-md-4">
<input type="text" name="name" class="form-control" placeholder="Department name" required>
</div>
<div class="col-md-6">
<input type="text" name="description" class="form-control" placeholder="Description (optional)">
</div>
<div class="col-md-2">
<button type="submit" class="btn btn-success w-100">Add</button>
</div>
</div>
</form>
</div>
</div>
</div>
{% endblock %}