minor update
This commit is contained in:
@@ -75,6 +75,7 @@
|
||||
</ul>
|
||||
|
||||
<!-- 🔥 ADD THE DROPDOWN CODE RIGHT HERE 🔥 -->
|
||||
<!-- Right side -->
|
||||
<div class="d-flex">
|
||||
{% if user.is_authenticated %}
|
||||
<div class="dropdown">
|
||||
@@ -82,10 +83,18 @@
|
||||
<i class="fas fa-user me-1"></i> {{ user.username }}
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
{% if user.is_citizen %}
|
||||
<li>
|
||||
<a class="dropdown-item" href="{% url 'citizen_dashboard' %}">Dashboard</a>
|
||||
<a class="dropdown-item" href="{% url 'citizen_dashboard' %}">Citizen Dashboard</a>
|
||||
</li>
|
||||
<li><a class="dropdown-item" href="#">Profile</a></li>
|
||||
{% endif %}
|
||||
|
||||
{% if user.is_resolver %}
|
||||
<li>
|
||||
<a class="dropdown-item" href="{% url 'department_dashboard' %}">Department Dashboard</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if user.is_superuser %}
|
||||
<li>
|
||||
<a class="dropdown-item text-danger fw-bold" href="{% url 'superadmin_dashboard' %}">
|
||||
@@ -93,6 +102,7 @@
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
<li>
|
||||
<hr class="dropdown-divider" />
|
||||
</li>
|
||||
@@ -105,10 +115,12 @@
|
||||
</ul>
|
||||
</div>
|
||||
{% else %}
|
||||
<!-- Login / Register buttons for anonymous users -->
|
||||
<a href="{% url 'login' %}" class="btn btn-outline-light me-2">Login</a>
|
||||
<a href="{% url 'register' %}" class="btn btn-primary">Register</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
{% extends "core/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container my-5">
|
||||
<div class="card shadow-lg">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h3>Department Dashboard</h3>
|
||||
<p>Welcome, {{ request.user.username }}. Your Departments:
|
||||
{% for dept in departments %} {{ dept.name }}{% if not forloop.last %}, {% endif %}{% endfor %}
|
||||
</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% if issues %}
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Title</th>
|
||||
<th>Category</th>
|
||||
<th>Reported By</th>
|
||||
<th>Status</th>
|
||||
<th>Created At</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for issue in issues %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ issue.title }}</td>
|
||||
<td>{{ issue.category.name|default:"—" }}</td>
|
||||
<td>{{ issue.reporter.username }}</td>
|
||||
<td>
|
||||
{% if issue.status == "reported" %}
|
||||
<span class="badge bg-danger">Reported</span>
|
||||
{% elif issue.status == "acknowledged" %}
|
||||
<span class="badge bg-info text-dark">Acknowledged</span>
|
||||
{% elif issue.status == "in_progress" %}
|
||||
<span class="badge bg-warning text-dark">In Progress</span>
|
||||
{% elif issue.status == "resolved" %}
|
||||
<span class="badge bg-success">Resolved</span>
|
||||
{% else %}
|
||||
<span class="badge bg-secondary">Unknown</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ issue.created_at|date:"M d, Y H:i" }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p class="text-muted">No issues assigned to your departments yet.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,4 +1,3 @@
|
||||
<!-- core/templates/core/superadmin_dashboard.html -->
|
||||
{% extends "core/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
Reference in New Issue
Block a user