New Changes.
parent
039e092cee
commit
e7b5200fc0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,97 @@
|
|||||||
|
{% load static %}
|
||||||
|
|
||||||
|
{% for project in projects %}
|
||||||
|
|
||||||
|
<div class="w-full h-fit bg-white rounded-md shadow-md p-3 projectContainer">
|
||||||
|
<p id="projectId" class="hidden">{{project.id}}</p>
|
||||||
|
|
||||||
|
<div class="w-full bg-white h-fit rounded-md border border-gray-200">
|
||||||
|
<div class="w-full px-5 py-5 {% if project.projectstatus_set.all.last.status == 'Completed' %}bg-green-700{% endif %}
|
||||||
|
{% if project.projectstatus_set.all.last.status == 'Cancelled' %}bg-red-500{% endif %}
|
||||||
|
{% if project.projectstatus_set.all.last.status == 'In Progress' %}bg-orange-500{% endif %}
|
||||||
|
{% if project.projectstatus_set.all.last.status == 'Pending' %}bg-yellow-500{% endif %}
|
||||||
|
flex justify-center items-center text-center text-white rounded-t-md text-[17px] s:text-[20px]">
|
||||||
|
<p>{{project.name}}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="w-full grid grid-cols-1 l:grid-cols-2">
|
||||||
|
<!-- Left Section -->
|
||||||
|
<div class="flex flex-col justify-between">
|
||||||
|
<!-- Details -->
|
||||||
|
<div class="w-full flex flex-col gap-3 p-5">
|
||||||
|
<div class="w-full flex justify-start items-center gap-2">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
||||||
|
stroke="currentColor" class="w-6 h-6 text-secondosiblue">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round"
|
||||||
|
d="M6 6.878V6a2.25 2.25 0 0 1 2.25-2.25h7.5A2.25 2.25 0 0 1 18 6v.878m-12 0c.235-.083.487-.128.75-.128h10.5c.263 0 .515.045.75.128m-12 0A2.25 2.25 0 0 0 4.5 9v.878m13.5-3A2.25 2.25 0 0 1 19.5 9v.878m0 0a2.246 2.246 0 0 0-.75-.128H5.25c-.263 0-.515.045-.75.128m15 0A2.25 2.25 0 0 1 21 12v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6c0-.98.626-1.813 1.5-2.122" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<p class="text-secondosiblue"><span
|
||||||
|
class="font-poppinsBold">{{project.open_user_tasks_count}}</span> Open
|
||||||
|
{% if project.open_user_tasks_count == 1 %} Task {% else %} Tasks {% endif %}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="w-full flex justify-start items-center gap-2">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
||||||
|
stroke="currentColor" class="w-6 h-6 text-secondosiblue">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round"
|
||||||
|
d="M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<p class="text-secondosiblue">Total Time: <span
|
||||||
|
class="font-poppinsBold">{{project.total_time_worked_hours}}hr
|
||||||
|
{{project.total_time_worked_minutes}}min
|
||||||
|
{{project.total_time_worked_seconds}}sec</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Action Buttons -->
|
||||||
|
<div class="w-full border-t border-b l:border-b-0 border-gray-200 grid grid-cols-1 s:grid-cols-3">
|
||||||
|
<a href="{% url 'detailed-project' project.project_id %}"
|
||||||
|
class="p-3 border-b s:border-b-0 border-r-0 s:border-r border-gray-200 text-base bg-gray-50 text-secondosiblue flex justify-center items-center">View</a>
|
||||||
|
|
||||||
|
<a href="{% url 'editproject' project.project_id %}"
|
||||||
|
class="p-3 text-base bg-gray-50 border-b s:border-b-0 border-r-0 s:border-r border-gray-200 text-secondosiblue flex justify-center items-center">Edit</a>
|
||||||
|
|
||||||
|
<button class="p-3 text-base bg-gray-50 text-secondosiblue deleteProjectButton"
|
||||||
|
data-modal-url="{% url 'deleteprojectmodal' project.id %}">Delete</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Right Section - Recent Notes -->
|
||||||
|
<div class="w-full border-l-none l:border-l border-gray-200">
|
||||||
|
{% if project.note_set.exists %}
|
||||||
|
{% with last_note=project.note_set.last %}
|
||||||
|
<div class="w-full h-full flex flex-col gap-3 justify-center items-center p-3">
|
||||||
|
<p class="text-secondosiblue break-all whitespace-pre-wrap">{{ last_note.text }}</p>
|
||||||
|
<div class="w-[30px] h-[30px] rounded-full shadow-md p-1 flex justify-center items-center bg-gray-100 cursor-pointer hover:scale-105 duration-300 addProjectNoteButton"
|
||||||
|
data-modal-url="{% url 'addprojectnotemodal' project.project_id %}">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="3"
|
||||||
|
stroke="currentColor" class="w-6 h-6 text-secondosiblue">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endwith %}
|
||||||
|
{% else %}
|
||||||
|
<div class="w-full h-full flex flex-col justify-center items-center gap-3 p-3">
|
||||||
|
<p class="text-secondosiblue">No Recent Note</p>
|
||||||
|
<div class="w-[30px] h-[30px] rounded-full shadow-md p-1 flex justify-center items-center bg-gray-100 cursor-pointer hover:scale-105 duration-300 addProjectNoteButton"
|
||||||
|
data-modal-url="{% url 'addprojectnotemodal' project.project_id %}">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="3"
|
||||||
|
stroke="currentColor" class="w-6 h-6 text-secondosiblue">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endfor %}
|
@ -0,0 +1,37 @@
|
|||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
const inProgressProjectsContainer = document.getElementById('inProgressProjectsContainer');
|
||||||
|
const projectsByStatusContainer = document.getElementById('projectsByStatusContainer');
|
||||||
|
const allProjectsContainer = document.getElementById('allProjectsContainer');
|
||||||
|
const projectLoader = document.getElementById('projectLoader');
|
||||||
|
|
||||||
|
var statusesSelectTag = document.getElementById('statusesSelectTag');
|
||||||
|
|
||||||
|
statusesSelectTag.addEventListener('change', function () {
|
||||||
|
var selectedStatus = statusesSelectTag.value;
|
||||||
|
|
||||||
|
projectLoader.classList.remove('hidden');
|
||||||
|
inProgressProjectsContainer.classList.add('hidden');
|
||||||
|
projectsByStatusContainer.classList.add('hidden');
|
||||||
|
allProjectsContainer.classList.add('hidden');
|
||||||
|
|
||||||
|
// Check if "All" is selected
|
||||||
|
if (selectedStatus === 'All') {
|
||||||
|
allProjectsContainer.classList.remove('hidden');
|
||||||
|
projectLoader.classList.add('hidden');
|
||||||
|
|
||||||
|
// Check if "Pending" is selected
|
||||||
|
} else if (selectedStatus === 'Pending') {
|
||||||
|
inProgressProjectsContainer.classList.remove('hidden');
|
||||||
|
projectLoader.classList.add('hidden');
|
||||||
|
} else {
|
||||||
|
fetch('/projects/status/' + selectedStatus + '/')
|
||||||
|
.then(response => response.text())
|
||||||
|
.then(data => {
|
||||||
|
projectsByStatusContainer.classList.remove('hidden');
|
||||||
|
$(projectsByStatusContainer).html(data);
|
||||||
|
projectLoader.classList.add('hidden');
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error:', error));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue