minor update
This commit is contained in:
@@ -89,17 +89,35 @@
|
||||
{{ issue.description|truncatewords:15 }}
|
||||
</p>
|
||||
<div class="d-flex gap-2 align-items-center">
|
||||
<span class="badge bg-secondary">{{ issue.category.name|default:"No Category" }}</span>
|
||||
<span class="badge bg-{% if issue.status == 'resolved' %}success{% elif issue.status == 'in_progress' %}warning{% else %}primary{% endif %} issue-status">
|
||||
<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 %}">
|
||||
{{ issue.department.name|default:"No Department" }}
|
||||
</span>
|
||||
|
||||
<!-- 🔹 Status badge -->
|
||||
<span class="badge bg-{% if issue.status == 'resolved' %}success
|
||||
{% elif issue.status == 'in_progress' %}warning
|
||||
{% else %}primary{% endif %} issue-status">
|
||||
{{ issue.get_status_display }}
|
||||
</span>
|
||||
|
||||
<small class="text-muted">{{ issue.created_at|date:"M d, Y" }}</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if issue.photo %}
|
||||
<div class="ms-3">
|
||||
<img src="{{ issue.photo.url }}" alt="Issue photo"
|
||||
class="img-fluid rounded" style="max-height: 60px; max-width: 80px;">
|
||||
<img src="{{ issue.photo.url }}" alt="Issue photo" class="img-fluid rounded"
|
||||
style="max-height: 60px; max-width: 80px;">
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -114,6 +132,7 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -146,12 +165,7 @@
|
||||
{{ issue_form.title }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Category</label>
|
||||
{{ issue_form.category }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h3>Department Dashboard</h3>
|
||||
<p>
|
||||
Welcome, {{ request.user.username }}. Your Departments:
|
||||
Welcome, {{ request.user.username }}. Department:
|
||||
{% for dept in departments %}
|
||||
<span class="badge bg-light text-dark">{{ dept.name }}</span>
|
||||
{% empty %}
|
||||
@@ -21,7 +21,6 @@
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Title</th>
|
||||
<th>Category</th>
|
||||
<th>Reported By</th>
|
||||
<th>Status</th>
|
||||
<th>Created At</th>
|
||||
@@ -33,7 +32,6 @@
|
||||
<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" %}
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Title</th>
|
||||
<th>Category</th>
|
||||
<th>Reported By</th>
|
||||
<th>Status</th>
|
||||
<th>Created At</th>
|
||||
@@ -25,7 +24,6 @@
|
||||
<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" %}
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
</option>
|
||||
</select>
|
||||
|
||||
<select name="category" class="form-select">
|
||||
<option value="">All Categories</option>
|
||||
{% for cat in categories %}
|
||||
{% with cat.id|stringformat:"s" as cat_id %}
|
||||
<option value="{{ cat_id }}" {% if request.GET.category|default:'' == cat_id %}selected{% endif %}>
|
||||
{{ cat.name }}
|
||||
<select name="department" class="form-select">
|
||||
<option value="">All Departments</option>
|
||||
{% for dept in departments %}
|
||||
{% with dept.id|stringformat:"s" as dept_id %}
|
||||
<option value="{{ dept_id }}" {% if request.GET.department|default:'' == dept_id %}selected{% endif %}>
|
||||
{{ dept.name }}
|
||||
</option>
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
@@ -52,12 +52,22 @@
|
||||
{% endif %}
|
||||
|
||||
<div class="card-body d-flex flex-column">
|
||||
<!-- Category Badge -->
|
||||
<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" }}
|
||||
<!-- Department Badge -->
|
||||
<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>
|
||||
|
||||
|
||||
<!-- Title + Description -->
|
||||
<h5 class="card-title">{{ issue.title|truncatewords:6 }}</h5>
|
||||
<p class="card-text text-muted flex-grow-1">
|
||||
@@ -86,7 +96,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card-footer bg-transparent d-flex justify-content-between align-items-center">
|
||||
<small
|
||||
class="text-{% if issue.status == 'resolved' %}success{% elif issue.status == 'in_progress' %}warning{% else %}info{% endif %}">
|
||||
@@ -100,7 +110,7 @@
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
|
||||
Reference in New Issue
Block a user