minor update
This commit is contained in:
@@ -89,7 +89,8 @@
|
||||
|
||||
{% if user.is_resolver %}
|
||||
<li>
|
||||
<a class="dropdown-item" href="{% url 'department_dashboard' %}">Department Dashboard</a>
|
||||
<a class="dropdown-item" href="{% url 'department_dashboard' %}">
|
||||
<i class="fas fa-building me-2 text-success"></i>Department Dashboard</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
|
||||
@@ -141,8 +141,18 @@
|
||||
<img src="https://via.placeholder.com/300x200/6c757d/ffffff?text=No+Image" class="card-img-top" alt="No image">
|
||||
{% endif %}
|
||||
<div class="card-body">
|
||||
<span class="badge bg-{% if issue.category.name == 'Roads' %}warning text-dark{% elif issue.category.name == 'Sanitation' %}success{% else %}info{% endif %} mb-2">
|
||||
{{ issue.category.name|default:"General" }}
|
||||
<span class="badge
|
||||
{% if issue.department.name == 'Roads & Transportation' %} bg-primary
|
||||
{% elif issue.department.name == 'Sanitation & Waste Management' %} bg-success
|
||||
{% elif issue.department.name == 'Public Safety' %} bg-danger
|
||||
{% elif issue.department.name == 'Water & Sewage' %} bg-info text-dark
|
||||
{% elif issue.department.name == 'Parks & Recreation' %} bg-warning text-dark
|
||||
{% elif issue.department.name == 'Electricity & Utilities' %} bg-dark
|
||||
{% elif issue.department.name == 'Environmental Services' %} bg-secondary
|
||||
{% elif issue.department.name == 'Public Works' %} bg-teal text-white
|
||||
{% else %} bg-light text-dark
|
||||
{% endif %} mb-2">
|
||||
{{ issue.department.name|default:"General" }}
|
||||
</span>
|
||||
<h5 class="card-title">{{ issue.title|truncatewords:5 }}</h5>
|
||||
<p class="card-text text-muted">{{ issue.description|truncatewords:15 }}</p>
|
||||
|
||||
@@ -5,8 +5,13 @@
|
||||
<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>
|
||||
Welcome, {{ request.user.username }}. Your Departments:
|
||||
{% for dept in departments %}
|
||||
<span class="badge bg-light text-dark">{{ dept.name }}</span>
|
||||
{% empty %}
|
||||
<span class="text-muted">No department assigned.</span>
|
||||
{% endfor %}
|
||||
</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@@ -20,6 +25,7 @@
|
||||
<th>Reported By</th>
|
||||
<th>Status</th>
|
||||
<th>Created At</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -43,6 +49,23 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ issue.created_at|date:"M d, Y H:i" }}</td>
|
||||
<td>
|
||||
{% if issue.status in "reported,acknowledged" %}
|
||||
<form method="post" action="{% url 'update_issue_status' issue.id %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="status" value="in_progress">
|
||||
<button type="submit" class="btn btn-sm btn-warning">In Progress</button>
|
||||
</form>
|
||||
{% elif issue.status == "in_progress" %}
|
||||
<form method="post" action="{% url 'update_issue_status' issue.id %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="status" value="resolved">
|
||||
<button type="submit" class="btn btn-sm btn-success">Resolved</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<span class="text-muted">No actions</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user