emile 3 months ago
parent 1032d9dcc6
commit f2cfe0c791

@ -104,6 +104,12 @@
class="w-full md:w-fit text-base px-3 py-2 bg-transparent text-osiblue outline-none border border-osiblue duration-300 rounded-md cursor-pointer hover:bg-osiblue hover:text-white">Edit
Project</button>
</a>
<a href="{% url 'projects_dashboard' %}?projects={{project.id}}" class="w-full md:w-fit">
<button
class="w-full md:w-fit text-base px-3 py-2 bg-transparent text-osiblue outline-none border border-osiblue duration-300 rounded-md cursor-pointer hover:bg-osiblue hover:text-white">
Project Logs</button>
</a>
</div>
</div>

@ -42,18 +42,19 @@
<div class="dashboard-container rounded-xl bg-gray-50 shadow-md">
<div class="flex flex-row gap-3 justify-between items-center mb-4">
<h1 class="font-semibold text-xl text-primary">Projects Dashboard</h1>
<h1 class="font-semibold text-xl text-secondosiblue font-poppinsBold ">Projects Dashboard</h1>
</div>
<form method="get" id="filter-form" class="mb-4">
<div class="w-full flex flex-col gap-4">
<div class="flex flex-col lg:flex-row w-full gap-4">
<form method="get" id="filter-form" class="mb-4 font-poppins ">
<div class="w-full flex flex-col gap-4 font-poppins ">
<div class="flex flex-col lg:flex-row w-full gap-4 font-poppins ">
<div class="flex-1 flex flex-col">
<label class="font-medium text-secondary mb-1">Date Range</label>
<label class="mb-1 text-secondosiblue font-semibold cursor-pointer">Date Range</label>
<div class="flex flex-col lg:flex-row gap-2">
<input name="start_date" id="start-date" type="date"
value="{{ start_date }}"
class="border rounded-md outline-none focus:border-primary p-2">
<input name="end_date" id="end-date" type="date"
value="{{ end_date }}"
class="border rounded-md outline-none focus:border-primary p-2">
@ -61,7 +62,7 @@
</div>
<div class="flex-1 flex flex-col">
<label class="font-medium text-secondary mb-1">Projects</label>
<label class="mb-1 text-secondosiblue font-semibold cursor-pointer">Projects</label>
<select name="projects" id="projects" class="rounded-md" multiple>
{% for project in projects %}
<option value="{{ project.id }}"
@ -73,7 +74,7 @@
</div>
<div class="flex-1 flex flex-col">
<label class="font-medium text-secondary mb-1">Staff</label>
<label class="text-secondosiblue font-semibold cursor-pointer mb-1">Staff</label>
<select name="staff" id="staff" class="rounded-md" multiple>
{% for staff in staffs %}
<option value="{{ staff.id }}"
@ -106,7 +107,7 @@
</thead>
<tbody class="bg-white divide-y divide-gray-200">
{% for point in points %}
<tr>
<tr class="border border-gray-200 text-center">
<td>{{ point.task.project.name }}</td>
<td>{{ point.task.name }}</td>
<td>{{ point.text|truncatechars:30 }}</td>

@ -935,7 +935,7 @@ def projects_dashboard(request):
end_date = parse_date(end_date_str) if end_date_str else None
# Filter points based on parameters
points = Point.objects.select_related('task__project', 'task__assigned_to').prefetch_related('pointactivity_set')
points = Point.objects.select_related('task__project', 'task__assigned_to').prefetch_related('pointactivity_set').order_by('-pointactivity__end_time')
if selected_project_ids:
points = points.filter(task__project__id__in=selected_project_ids)

Loading…
Cancel
Save