jobs by status breakdown
This commit is contained in:
parent
36f7290fc7
commit
e148cf1df1
Binary file not shown.
@ -224,12 +224,13 @@
|
||||
<div class="stat-card">
|
||||
<h6 class="mb-3">Jobs by Status</h6>
|
||||
<ul class="list-group list-group-flush">
|
||||
{% for status in jobs_by_status %}
|
||||
{% for status in client_stat.client_jobs_by_status %}
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center px-0 py-1">
|
||||
<span class="badge bg-secondary rounded-pill"></span>
|
||||
{{ status.status__name }}
|
||||
<span class="badge bg-secondary rounded-pill">{{ status.count }}</span>
|
||||
</li>
|
||||
{% empty %}
|
||||
<li class="list-group-item px-0 py-1">No jobs found.</li>
|
||||
<li class="list-group-item px-0 py-1">No jobs found for this client.</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -162,11 +162,14 @@ def dashboard(request):
|
||||
'missing_count': missing_count,
|
||||
'folder_id': folder.id
|
||||
})
|
||||
# Calculate status breakdown for jobs with no client
|
||||
no_client_jobs_by_status = jobs_no_client.values('status__name').annotate(count=Count('id')).order_by('status__name')
|
||||
client_stats.append({
|
||||
'client_name': "No Client Assigned",
|
||||
'total_jobs': no_client_total_jobs,
|
||||
'incomplete_jobs': no_client_incomplete_jobs,
|
||||
'incomplete_folder_breakdown': no_client_incomplete_folder_breakdown
|
||||
'incomplete_folder_breakdown': no_client_incomplete_folder_breakdown,
|
||||
'client_jobs_by_status': no_client_jobs_by_status
|
||||
})
|
||||
|
||||
for client in clients:
|
||||
@ -188,12 +191,14 @@ def dashboard(request):
|
||||
'missing_count': missing_count,
|
||||
'folder_id': folder.id
|
||||
})
|
||||
|
||||
# Calculate status breakdown for the current client's jobs
|
||||
client_jobs_by_status = client_jobs.values('status__name').annotate(count=Count('id')).order_by('status__name')
|
||||
client_stats.append({
|
||||
'client_name': client.name,
|
||||
'total_jobs': total_client_jobs,
|
||||
'incomplete_jobs': client_incomplete_jobs,
|
||||
'incomplete_folder_breakdown': client_incomplete_folder_breakdown
|
||||
'incomplete_folder_breakdown': client_incomplete_folder_breakdown,
|
||||
'client_jobs_by_status': client_jobs_by_status
|
||||
})
|
||||
|
||||
|
||||
@ -831,4 +836,4 @@ def user_delete(request, pk):
|
||||
user_to_delete.delete()
|
||||
messages.success(request, f"User {username} deleted.")
|
||||
|
||||
return redirect('user_list')
|
||||
return redirect('user_list')
|
||||
Loading…
x
Reference in New Issue
Block a user