New changes.

main
nataly 12 months ago
parent ec212b0b22
commit 81d65b4236

Binary file not shown.

@ -762,7 +762,7 @@
</div>
</div>
<script type="text/javascript" src='{% static "js/pop-modals.js" %}'></script>
<script type="module" src='{% static "js/pop-modals.js" %}'></script>
<!---------------------- JS SCRIPTS -------------------->

@ -51,6 +51,13 @@
<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">Create
Story</button>
<a href="" 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">Add
Ticket</button>
</a>
<a href="{% url 'editproject' project.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">Edit
@ -84,6 +91,70 @@
</div>
</div>
<!-- TYPE -->
<div class="w-full">
<p class="text-gray-500 text-xl">Type:
{% for type in project.project_type.all %}
<span class="text-secondosiblue text-xl font-semibold">
{{type.name}} {% if not forloop.last %}, {% endif %}
{% endfor %}</span>
</p>
</div>
<!-- STATUS -->
<p class="text-gray-500 text-xl">Status:
{% if project.projectstatus_set.exists %}
{% with latest_status=project.projectstatus_set.last.status %}
{% if latest_status == 'Cancelled' %}
<span class="text-red-500 text-xl font-semibold">{{ latest_status }}</span>
{% elif latest_status == 'Completed' %}
<span class="text-green-700 text-xl font-semibold">{{ latest_status }}</span>
{% elif latest_status == 'In Progress' %}
<span class="text-orange-500 text-xl font-semibold">{{ latest_status }}</span>
{% elif latest_status == 'Pending' %}
<span class="text-yellow-400 text-xl font-semibold">{{ latest_status }}</span>
{% else %}
<span class="text-gray-700 text-xl font-semibold">Unknown</span>
{% endif %}
{% endwith %}
{% else %}
<span class="text-gray-700 text-xl font-semibold">No status available</span>
{% endif %}
</p>
<!-- PROJECT DETAILS -->
<div>
<div>
<p class="text-gray-500 text-xl">Project Details:</p>
<div class="w-full pr-8">
<p class="text-secondosiblue font-semibold">
{{project.details}}
</p>
</div>
</div>
</div>
<!-- TAGS -->
<div>
<p class="text-gray-500 text-xl">Tags:</p>
<div class="w-full h-fit px-4 mt-3 flex flex-wrap justify-start items-center gap-3">
<button
class="text-sm text-gray-400 border border-gray-400 rounded-md w-fit py-2 px-3 outline-none">Media
Streaming</button>
<button
class="text-sm text-gray-400 border border-gray-400 rounded-md w-fit py-2 px-3 outline-none">Live
Streaming</button>
<button
class="text-sm text-gray-400 border border-gray-400 rounded-md w-fit py-2 px-3 outline-none">Audio
On Demand</button>
</div>
</div>
<!-- MEMBERS -->
<div class="w-full mt-5">
<div
@ -126,64 +197,107 @@
</div>
</div>
<!-- TYPE -->
<!-- TICKETS -->
<div class="w-full mt-5">
<p class="text-gray-500 text-xl">Type:
{% for type in project.project_type.all %}
<span class="text-secondosiblue text-xl font-semibold">
{{type.name}} {% if not forloop.last %}, {% endif %}
{% endfor %}</span>
</p>
</div>
<div class="overflow-x-auto border border-gray-300 rounded-md">
<div
class=" bg-gray-200 rounded-t-md flex justify-between items-center text-white text-xl font-bold h-[50px]">
<div class="px-3">
<p class="text-secondosiblue uppercase font-bold">Tickets</p>
</div>
<button
class="h-full rounded-tr-md px-4 bg-secondosiblue text-gray-200 text-[18px] outline-none border-none cursor-pointer flex justify-center items-center">
<i class="fa fa-plus"></i>
</button>
</div>
<table class="min-w-full divide-y">
<!-- TABLE HEADER -->
<thead class="bg-gray-50">
<tr>
<th scope="col"
class="px-6 py-3 text-sm font-medium text-gray-500 uppercase border-r border-gray-300 whitespace-nowrap">
Subject
</th>
<th scope="col"
class="px-6 py-3 text-sm font-medium text-gray-500 uppercase border-r border-gray-300 whitespace-nowrap">
Ticket ID
</th>
<th scope="col"
class="px-6 py-3 text-sm font-medium text-gray-500 uppercase border-r border-gray-300 whitespace-nowrap">
Regarding
</th>
<th scope="col"
class="px-6 py-3 text-sm font-medium text-gray-500 uppercase border-r border-gray-300 whitespace-nowrap">
Last Updated
</th>
<th scope="col"
class="px-6 py-3 text-sm font-medium text-gray-500 uppercase border-r border-gray-300 whitespace-nowrap">
Updated By
</th>
<th scope="col"
class="px-6 py-3 text-sm font-medium text-gray-500 uppercase whitespace-nowrap">
Actions
</th>
</tr>
</thead>
<!-- STATUS -->
<div>
<p class="text-gray-500 text-xl">Status:
{% if project.status == 'Cancelled' %}
<span class="text-red-500 text-xl font-semibold">{{project.status}}</span>
{% endif %}
{% if project.status == 'Completed' %}
<span class="text-green-700 text-xl font-semibold">{{project.status}}</span>
{% endif %}
{% if project.status == 'Active' %}
<span class="text-orange-500 text-xl font-semibold">{{project.status}}</span>
{% endif %}
{% if project.status == 'Pending' %}
<span class="text-yellow-400 text-xl font-semibold">{{project.status}}</span>
{% endif %}
</p>
</div>
<!-- TABLE BODY -->
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 text-center text-sm border-r border-gray-300">
<p class="text-secondosiblue">hhh</p>
</td>
<td class="px-6 py-4 text-center text-sm border-r border-gray-300">
<p class="text-secondosiblue">hhh</p>
</td>
<!-- PROJECT DETAILS -->
<div>
<div>
<p class="text-gray-500 text-xl">Project Details:</p>
<div class="w-full pr-8">
<p class="text-secondosiblue font-semibold">
{{project.details}}
</p>
</div>
</div>
</div>
<td class="px-6 py-4 text-center text-sm border-r border-gray-300">
<p class="text-secondosiblue">hhh</p>
</td>
<td class="px-6 py-4 text-center text-sm border-r border-gray-300">
<p class="text-secondosiblue">hhh</p>
</td>
<!-- TAGS -->
<div>
<p class="text-gray-500 text-xl">Tags:</p>
<div class="w-full h-fit px-4 mt-3 flex flex-wrap justify-start items-center gap-3">
<button
class="text-sm text-gray-400 border border-gray-400 rounded-md w-fit py-2 px-3 outline-none">Media
Streaming</button>
<td class="px-6 py-4 text-center text-sm border-r border-gray-300">
<p class="text-secondosiblue">hhh</p>
</td>
<button
class="text-sm text-gray-400 border border-gray-400 rounded-md w-fit py-2 px-3 outline-none">Live
Streaming</button>
<td class="px-6 py-4 text-center text-sm">
<div class="w-full flex justify-center items-center gap-3">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-[16px] cursor-pointer text-fifthosiblue hover:scale-110 duration-500 transition-transform">
<path stroke-linecap="round" stroke-linejoin="round" d="M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z" />
</svg>
<button
class="text-sm text-gray-400 border border-gray-400 rounded-md w-fit py-2 px-3 outline-none">Audio
On Demand</button>
<a href="">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"class="w-[18px] text-fifthosiblue hover:scale-110 duration-500 transition-transform">
<path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z" />
<path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
</svg>
</a>
<a href="">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-[18px] text-fifthosiblue hover:scale-110 duration-500 transition-transform">
<path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10" />
</svg>
</a>
<div class="cursor-pointer deleteTicketButton"
data-modal-url="">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-[18px] text-red-500 hover:scale-110 duration-500 transition-transform">
<path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0" />
</svg>
</div>
</div>
</td>
</tr>
<!-- <tr>
<td colspan="6" class="px-6 py-4 text-center text-sm text-secondosiblue">
No Tickets at the moment
</td>
</tr> -->
</tbody>
</table>
</div>
</div>
@ -253,15 +367,16 @@
class="w-fit py-2 px-3 bg-green-700 border border-green-700 text-white rounded-md cursor-pointer hover:bg-white hover:text-green-700">Add
Task</button>
</a>
<a href="">
<div class="text-[15px] text-blue-500 cursor-pointer">
<i class="fa fa-edit"></i>
</div>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-[18px] text-fifthosiblue hover:scale-110 duration-500 transition-transform">
<path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10" />
</svg>
</a>
<div class="text-[15px] text-red-500 cursor-pointer">
<i class="fa fa-trash"></i>
<div class="cursor-pointer deleteTicketButton"
data-modal-url="">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-[18px] text-red-500 hover:scale-110 duration-500 transition-transform">
<path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0" />
</svg>
</div>
</div>
</td>
@ -281,7 +396,7 @@
<!-- CREDENTIALS -->
<div class="mt-5 relative">
<div class="w-full mt-5">
<div
class=" bg-gray-200 rounded-t-md flex justify-between items-center text-white text-xl font-bold h-[50px]">
<div class="px-3">
@ -349,7 +464,7 @@
<!-- RELATED FILES -->
<div class="w-full mt-5">
<div class="overflow-x-auto border border-gray-300 rounded-md mt-5">
<div class="overflow-x-auto border border-gray-300 rounded-md">
<div
class=" bg-gray-200 rounded-t-md flex justify-between items-center text-white text-xl font-bold h-[50px]">
<div class="px-3">

@ -40,7 +40,6 @@
</div>
</div>
<div class="w-full flex justify-center items-center p-5 hidden" id="projectLoader">
<div role="status">
<svg aria-hidden="true" class="w-12 h-12 text-gray-400 animate-spin dark:text-gray-600 fill-osiblue"
@ -277,13 +276,13 @@
</div>
<!---------------------- JS SCRIPTS -------------------->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<!-- TO DISPLAY THE PROJECT PROGRESS BAR BASED ON ITS REMAINING TIME -->
<script type="text/javascript" src='{% static "js/calculate-all-projects-time.js" %}'></script>
<script type="module" src='{% static "js/calculate-all-projects-time.js" %}'></script>
<script type="module" src='{% static "js/projects-filtering.js" %}'></script>

@ -98,7 +98,7 @@
<button onclick="myFunction()">
<input type="text" class="hidden" value="https://osina.ositcom.com/my-tickets/{{ticket.ticket_number}}/" id="myInput">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-[16px] text-fifthosiblue">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-[16px] text-fifthosiblue hover:scale-110 duration-500 transition-transform">
<path stroke-linecap="round" stroke-linejoin="round" d="M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z" />
</svg>

@ -1106,7 +1106,7 @@
</div>
</div>
<script type="text/javascript" src='{% static "js/pop-modals.js" %}'></script>
<script type="module" src='{% static "js/pop-modals.js" %}'></script>
<!---------------------- JS SCRIPTS -------------------->
<!-- SIDE BAR SCRIPT -->

@ -4,6 +4,9 @@
<div class="w-full h-fit bg-white rounded-md shadow-md p-3 projectContainer">
<p id="projectId" class="hidden">{{project.id}}</p>
<p class="hidden startDate">{{project.start_date}}</p>
<p class="hidden endDate">{{project.end_date}}</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 %}
@ -13,7 +16,14 @@
<p>{{project.name}}</p>
</div>
<!-- Progress Bar -->
<div class="w-full h-[8px] bg-gray-100 mainBar">
<div class="h-full progressBar">
</div>
</div>
<div class="w-full grid grid-cols-1 l:grid-cols-2">
<!-- Left Section -->
<div class="flex flex-col justify-between">
<!-- Details -->

@ -81,6 +81,7 @@ urlpatterns = [
path('recent-activities-page/', views.recent_activities_page, name='recentactivitiespage'),
path('fetch_epics/', views.fetch_epics, name='fetch_epics'),
path('projects/status/<str:status>/', views.fetch_projects_by_status, name='projects_by_status'),
path('all-projects/', views.fetch_projects_by_status, name='all_projects'),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

@ -868,7 +868,7 @@ def reset_password(request, uidb64, token):
def fetch_projects_by_status(request, status):
def fetch_projects_by_status(request, status=None):
user = request.user
if user.is_superuser:
@ -881,11 +881,14 @@ def fetch_projects_by_status(request, status):
).distinct().order_by('-project_id')
# Fetch projects with their last status as "In Progress"
filtered_projects = []
for project in projects:
last_status = ProjectStatus.objects.filter(project = project).last()
if last_status.status == status:
filtered_projects.append(project)
if status:
filtered_projects = []
for project in projects:
last_status = ProjectStatus.objects.filter(project = project).last()
if last_status.status == status:
filtered_projects.append(project)
else:
filtered_projects = projects
for project in projects:
total_time_seconds = 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 KiB

@ -23,17 +23,23 @@ function calculateProgress(startDate, endDate, progressBar) {
}
}
const projectContainers = document.querySelectorAll(".projectContainer");
function updateAllProjectProgress() {
const projectContainers = document.querySelectorAll(".projectContainer");
// Loop through each project container
projectContainers.forEach(projectContainer => {
const startDateElement = projectContainer.querySelector(".startDate");
const endDateElement = projectContainer.querySelector(".endDate");
// Loop through each project container
projectContainers.forEach(projectContainer => {
const startDateElement = projectContainer.querySelector(".startDate");
const endDateElement = projectContainer.querySelector(".endDate");
const progressBar = projectContainer.querySelector(".progressBar");
const progressBar = projectContainer.querySelector(".progressBar");
const startDate = new Date(startDateElement.textContent);
const endDate = new Date(endDateElement.textContent);
const startDate = new Date(startDateElement.textContent);
const endDate = new Date(endDateElement.textContent);
calculateProgress(startDate, endDate, progressBar);
});
calculateProgress(startDate, endDate, progressBar);
});
}
updateAllProjectProgress();
export { updateAllProjectProgress };

@ -1,26 +1,30 @@
document.addEventListener("DOMContentLoaded", function () {
// Function to open a modal with dimensions
function initializeModalButtons() {
// OPEN THE MODAL WITH DIMENSIONS
function openModalWithDimensions(url, width, height) {
const modalUrl = url;
openModal(modalUrl);
console.log('hii4');
const iframe = document.getElementById("popupModalFrame");
iframe.style.height = height;
iframe.style.width = width;
}
// Function to open a modal
// OPEN MODAL
function openModal(url) {
const modalContainer = document.getElementById("popUpModal");
const iframe = document.getElementById("popupModalFrame");
const body = document.body;
body.style.overflow = "hidden";
console.log('hii1');
iframe.src = url;
console.log('hii2')
modalContainer.style.display = "flex";
console.log('hii3')
}
// Function to close the modal
// CLOSE MODAL
function closeModal() {
const modalContainer = document.getElementById("popUpModal");
const iframe = document.getElementById("popupModalFrame");
@ -38,11 +42,11 @@ document.addEventListener("DOMContentLoaded", function () {
button.addEventListener("click", () => {
const modalUrl = button.getAttribute("data-modal-url");
openModalWithDimensions(modalUrl, width, height);
console.log('hii5')
});
});
}
// Add button click listeners with dimensions for specific class names
addButtonClickListener("addStatusButton", "450px", "200px");
addButtonClickListener("addNoteButton", "400px", "225px");
addButtonClickListener("addProjectNoteButton", "400px", "225px");
@ -76,10 +80,6 @@ document.addEventListener("DOMContentLoaded", function () {
addButtonClickListener("editCustomerStatusButton", "400px", "160px");
addButtonClickListener("addProjectMemberModal", "400px", "230px");
// DELETE BUTTONS
addButtonClickListener("deleteCustomerButton", "400px", "140px");
addButtonClickListener("deleteBusinessButton", "400px", "140px");
@ -93,10 +93,6 @@ document.addEventListener("DOMContentLoaded", function () {
addButtonClickListener("deletePaymentButton", "400px", "140px");
addButtonClickListener("deletePaymentMethodButton", "400px", "140px");
const closeButton = document.getElementById("closeModalButton");
closeButton.addEventListener("click", () => {
closeModal();
@ -108,4 +104,9 @@ document.addEventListener("DOMContentLoaded", function () {
closeModal();
}
});
});
}
initializeModalButtons();
export { initializeModalButtons };

@ -1,10 +1,12 @@
import { initializeModalButtons } from '../js/pop-modals.js';
import { updateAllProjectProgress } from '../js/calculate-all-projects-time.js';
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');
const statusesSelectTag = document.getElementById('statusesSelectTag');
statusesSelectTag.addEventListener('change', function () {
var selectedStatus = statusesSelectTag.value;
@ -14,17 +16,20 @@ document.addEventListener('DOMContentLoaded', function () {
projectsByStatusContainer.classList.add('hidden');
allProjectsContainer.classList.add('hidden');
// Check if "All" is selected
if (selectedStatus === 'All') {
allProjectsContainer.classList.remove('hidden');
projectLoader.classList.add('hidden');
fetch('/all-projects/')
.then(response => response.text())
.then(data => {
projectsByStatusContainer.classList.remove('hidden');
$(projectsByStatusContainer).html(data);
projectLoader.classList.add('hidden');
initializeModalButtons();
updateAllProjectProgress();
})
.catch(error => console.error('Error:', error));
// Check if "In Progress" is selected
} else if (selectedStatus === 'In Progress') {
inProgressProjectsContainer.classList.remove('hidden');
projectsByStatusContainer.classList.add('hidden');
projectLoader.classList.add('hidden');
allProjectsContainer.classList.add('hidden');
} else {
fetch('/projects/status/' + selectedStatus + '/')
.then(response => response.text())
@ -32,6 +37,8 @@ document.addEventListener('DOMContentLoaded', function () {
projectsByStatusContainer.classList.remove('hidden');
$(projectsByStatusContainer).html(data);
projectLoader.classList.add('hidden');
initializeModalButtons();
updateAllProjectProgress();
})
.catch(error => console.error('Error:', error));
}

Loading…
Cancel
Save