emile 12 months ago
parent 683325aada
commit 2453f3b80f

BIN
.DS_Store vendored

Binary file not shown.

BIN
osinaweb/.DS_Store vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -107,7 +107,7 @@
<div> <div>
<p class="text-gray-500 text-xl">Member(s):</p> <p class="text-gray-500 text-xl">Member(s):</p>
<div class="w-full flex justify-start items-center gap-3 flex-wrap mt-2"> <div class="w-full flex justify-start items-center gap-3 flex-wrap mt-2">
{% for member in project.members.all %} {% for member in members %}
<div <div
class="w-fit flex flex-col justify-center items-center gap-3 px-9 py-3 bg-gray-100 rounded-md shadow-md"> class="w-fit flex flex-col justify-center items-center gap-3 px-9 py-3 bg-gray-100 rounded-md shadow-md">
<div class="flex justify-start items-center gap-1"> <div class="flex justify-start items-center gap-1">
@ -124,7 +124,9 @@
</p> </p>
</div> </div>
<p class="text-secondosiblue font-poppinsBold text-sm">Working Hours: 0hr 0min 0sec</p> {% if request.user.is_superuser %}
<p class="text-secondosiblue font-poppinsBold text-sm">Working Hours: {{member.total_time_worked_hours}}hr {{member.total_time_worked_minutes}}min {{member.total_time_worked_seconds}}sec</p>
{% endif %}
</div> </div>
{% endfor %} {% endfor %}
</div> </div>

@ -619,10 +619,30 @@ def projectdetails(request, project_id):
project_notes = Note.objects.filter(project=project).order_by('-id') project_notes = Note.objects.filter(project=project).order_by('-id')
members = project.members.all()
for member in members:
tasks = project.task_set.filter(assigned_to=member)
total_time_seconds = 0
for task in tasks:
total_time_hours, total_time_minutes, total_time_seconds_task = task.total_task_time()
total_time_seconds += (total_time_hours * 3600) + (total_time_minutes * 60) + total_time_seconds_task
total_time_hours = total_time_seconds // 3600
total_time_minutes = (total_time_seconds % 3600) // 60
total_time_seconds = total_time_seconds % 60
member.total_time_worked_hours = total_time_hours
member.total_time_worked_minutes = total_time_minutes
member.total_time_worked_seconds = total_time_seconds
context = { context = {
'project': project, 'project': project,
'epics': epics, 'epics': epics,
'project_notes' : project_notes, 'project_notes' : project_notes,
'members': members,
} }
return render(request, 'details_templates/project-details.html', context) return render(request, 'details_templates/project-details.html', context)

Loading…
Cancel
Save