-
+ |
{{ticket.title}}
@@ -99,12 +95,9 @@
|
- {{ticket.ticketupdate_set.all.last.date_added}}
- |
-
-
- {{ticket.ticketupdate_set.all.last.added_by.first_name}}
-
+ {% if ticket.ticketupdate_set.all %}
+ {{ticket.ticketupdate_set.all.last.date_added}} by {{ticket.ticketupdate_set.all.last.added_by.first_name}}
+ {% endif %}
|
@@ -181,10 +174,6 @@
class="px-6 py-3 text-sm font-medium text-gray-500 border-r border-gray-300 uppercase whitespace-nowrap">
Last Updated
- |
- Updated By
- |
Actions
@@ -210,12 +199,9 @@
|
- {{ticket.ticketupdate_set.all.last.date_added}}
- |
-
-
- {{ticket.ticketupdate_set.all.last.added_by.first_name}}
-
+ {% if ticket.ticketupdate_set.all %}
+ {{ticket.ticketupdate_set.all.last.date_added}} by {{ticket.ticketupdate_set.all.last.added_by.first_name}}
+ {% endif %}
|
diff --git a/osinaweb/osinacore/views.py b/osinaweb/osinacore/views.py
index 9d0c0575..8afab2ad 100644
--- a/osinaweb/osinacore/views.py
+++ b/osinaweb/osinacore/views.py
@@ -367,56 +367,7 @@ def my_tasks(request, *args, **kwargs):
@staff_login_required
def tickets(request, *args, **kwargs):
- if request.user.is_superuser:
- all_tickets = Ticket.objects.all()
- all_tickets_with_update_date = all_tickets.annotate(
- latest_update_date=Max('ticketupdate__date_added'))
- all_tickets_ordered = all_tickets_with_update_date.order_by('-latest_update_date')
- open_tickets = []
- closed_tickets = []
- for ticket in all_tickets_ordered:
- last_status = ticket.ticketstatus_set.last()
- if last_status:
- last_status = last_status.status
- if last_status == 'Closed':
- closed_tickets.append(ticket)
- else:
- open_tickets.append(ticket)
- else:
- # If no status is found, assume it's open
- open_tickets.append(ticket)
- else:
- all_tickets = Ticket.objects.all()
- all_tickets_with_update_date = all_tickets.annotate(
- latest_update_date=Max('ticketupdate__date_added'))
- all_tickets_ordered = all_tickets_with_update_date.order_by('-latest_update_date')
- open_tickets = []
- closed_tickets = []
- for ticket in all_tickets_ordered:
- last_status = ticket.ticketstatus_set.last()
- if last_status:
- last_status = last_status.status
- if last_status == 'Closed':
- closed_tickets.append(ticket)
- else:
- open_tickets.append(ticket)
- else:
- # If no status is found, assume it's open
- open_tickets.append(ticket)
-
- for ticket in open_tickets:
- unread_updates_count = 0
- for ticket_update in ticket.ticketupdate_set.exclude(added_by=request.user):
- if not TicketRead.objects.filter(ticket_update=ticket_update, user=request.user, read=True).exists():
- unread_updates_count += 1
-
- ticket.unread_updates_count = unread_updates_count
-
-
context = {
- 'open_tickets': open_tickets,
- 'closed_tickets': closed_tickets
-
}
return render(request, 'listing_pages/tickets.html', context)
diff --git a/osinaweb/static/dist/output.css b/osinaweb/static/dist/output.css
index 902a64b3..2893aa81 100644
--- a/osinaweb/static/dist/output.css
+++ b/osinaweb/static/dist/output.css
@@ -916,6 +916,14 @@ video {
margin-right: auto;
}
+.-ml-10 {
+ margin-left: -2.5rem;
+}
+
+.-ml-5 {
+ margin-left: -1.25rem;
+}
+
.-mr-3 {
margin-right: -0.75rem;
}
@@ -960,6 +968,10 @@ video {
margin-left: 0px;
}
+.ml-10 {
+ margin-left: 2.5rem;
+}
+
.ml-2 {
margin-left: 0.5rem;
}
@@ -968,6 +980,10 @@ video {
margin-left: 1rem;
}
+.ml-5 {
+ margin-left: 1.25rem;
+}
+
.ml-\[300px\] {
margin-left: 300px;
}
@@ -1081,22 +1097,6 @@ video {
margin-top: 80px;
}
-.ml-5 {
- margin-left: 1.25rem;
-}
-
-.ml-10 {
- margin-left: 2.5rem;
-}
-
-.-ml-10 {
- margin-left: -2.5rem;
-}
-
-.-ml-5 {
- margin-left: -1.25rem;
-}
-
.block {
display: block;
}
@@ -1221,6 +1221,10 @@ video {
height: 16px;
}
+.h-\[180px\] {
+ height: 180px;
+}
+
.h-\[18px\] {
height: 18px;
}
@@ -1560,14 +1564,6 @@ video {
width: 100%;
}
-.min-w-\[250px\] {
- min-width: 250px;
-}
-
-.min-w-\[300px\] {
- min-width: 300px;
-}
-
.min-w-full {
min-width: 100%;
}
@@ -1584,14 +1580,6 @@ video {
max-width: 72rem;
}
-.max-w-\[250px\] {
- max-width: 250px;
-}
-
-.max-w-\[300px\] {
- max-width: 300px;
-}
-
.max-w-lg {
max-width: 32rem;
}
@@ -3076,6 +3064,11 @@ video {
color: rgb(156 163 175 / var(--tw-text-opacity));
}
+.text-gray-50 {
+ --tw-text-opacity: 1;
+ color: rgb(249 250 251 / var(--tw-text-opacity));
+}
+
.text-gray-500 {
--tw-text-opacity: 1;
color: rgb(107 114 128 / var(--tw-text-opacity));
@@ -3171,11 +3164,6 @@ video {
color: rgb(234 179 8 / var(--tw-text-opacity));
}
-.text-gray-50 {
- --tw-text-opacity: 1;
- color: rgb(249 250 251 / var(--tw-text-opacity));
-}
-
.underline {
text-decoration-line: underline;
}
diff --git a/osinaweb/static/js/tickets/tickets-room.js b/osinaweb/static/js/tickets/tickets-room.js
index 206600fd..8736bd93 100644
--- a/osinaweb/static/js/tickets/tickets-room.js
+++ b/osinaweb/static/js/tickets/tickets-room.js
@@ -120,10 +120,10 @@ function initializeWebSocket() {
});
} else if (data.event_type === 'user_status') {
- const onlineUsersDiv = document.getElementById('online-users');
- if (onlineUsersDiv) {
- onlineUsersDiv.innerHTML = data.html;
- }
+ const toponlineUsersDiv = document.getElementById('top-online-users');
+ const fixedonlineUsersDiv = document.getElementById('fixed-online-users');
+ toponlineUsersDiv.innerHTML = data.html;
+ fixedonlineUsersDiv.innerHTML = data.html;
} else {
messagesDiv.insertAdjacentHTML('beforeend', data.html);
typingDiv.innerHTML = '';
diff --git a/osinaweb/support/__pycache__/models.cpython-310.pyc b/osinaweb/support/__pycache__/models.cpython-310.pyc
index 2c2fd1bd..201c3570 100644
Binary files a/osinaweb/support/__pycache__/models.cpython-310.pyc and b/osinaweb/support/__pycache__/models.cpython-310.pyc differ
diff --git a/osinaweb/support/__pycache__/views.cpython-310.pyc b/osinaweb/support/__pycache__/views.cpython-310.pyc
index 2c1e1988..4325d55a 100644
Binary files a/osinaweb/support/__pycache__/views.cpython-310.pyc and b/osinaweb/support/__pycache__/views.cpython-310.pyc differ
diff --git a/osinaweb/support/add/__pycache__/views.cpython-310.pyc b/osinaweb/support/add/__pycache__/views.cpython-310.pyc
index 7edaf795..4bbed824 100644
Binary files a/osinaweb/support/add/__pycache__/views.cpython-310.pyc and b/osinaweb/support/add/__pycache__/views.cpython-310.pyc differ
diff --git a/osinaweb/support/add/views.py b/osinaweb/support/add/views.py
index 3749dd9a..0ac2d19f 100644
--- a/osinaweb/support/add/views.py
+++ b/osinaweb/support/add/views.py
@@ -3,13 +3,25 @@
from django.shortcuts import render, get_object_or_404
from support.models import *
from osinacore.decorators import *
-
-
-
-def add_ticket_department_modal(request):
-
- context = {
-
+from django.http import HttpResponse
+
+
+def add_ticket_department_modal(request, ticket_number):
+ ticket = get_object_or_404(Ticket, ticket_number=ticket_number)
+ departments = Department.objects.all().order_by('-id')
+ if request.method == 'POST':
+ department = get_object_or_404(Department, id=request.POST.get('department'))
+ ticketdepartment = TicketDepartment(
+ department=department,
+ ticket=ticket,
+ date_added = request.POST.get('date')
+ )
+ ticketdepartment.save()
+ return HttpResponse('')
+
+ context = {
+ 'ticket': ticket,
+ 'departments': departments,
}
return render(request, 'add_templates/add-ticket-department-modal.html', context)
@@ -17,10 +29,22 @@ def add_ticket_department_modal(request):
-def add_ticket_member_modal(request):
-
- context = {
+def add_ticket_member_modal(request, ticket_number):
+ ticket = get_object_or_404(Ticket, ticket_number=ticket_number)
+ staffprofiles = StaffProfile.objects.filter(active=True).all()
+ if request.method == 'POST':
+ staff = get_object_or_404(StaffProfile, id=request.POST.get('staff'))
+ ticketstaff = TicketStaff(
+ staff=staff,
+ ticket=ticket,
+ date_added = request.POST.get('date')
+ )
+ ticketstaff.save()
+ return HttpResponse('')
+ context = {
+ 'ticket': ticket,
+ 'staffprofiles': staffprofiles,
}
return render(request, 'add_templates/add-ticket-member-modal.html', context)
diff --git a/osinaweb/support/models.py b/osinaweb/support/models.py
index d856cb83..239f5b77 100644
--- a/osinaweb/support/models.py
+++ b/osinaweb/support/models.py
@@ -129,14 +129,15 @@ class Ticket(models.Model):
return f"last seen on {last_seen_time.strftime('%b %d at %I:%M %p')}"
def get_all_ticket_staff(self):
- ticket_staff = TicketStaff.objects.filter(ticket=self).select_related('staff')
+ ticket_staff = TicketStaff.objects.filter(ticket=self)
+ staff_members = [entry.staff for entry in ticket_staff]
latest_department = TicketDepartment.objects.filter(ticket=self).order_by('-date_added').first()
if latest_department:
department_staff = latest_department.department.get_staff()
else:
department_staff = []
- all_staff = list(ticket_staff.values_list('staff', flat=True)) + list(department_staff)
+ all_staff = list(staff_members) + list(department_staff)
return all_staff
diff --git a/osinaweb/support/templates/add_templates/add-ticket-department-modal.html b/osinaweb/support/templates/add_templates/add-ticket-department-modal.html
index 44f27db7..0f384a38 100644
--- a/osinaweb/support/templates/add_templates/add-ticket-department-modal.html
+++ b/osinaweb/support/templates/add_templates/add-ticket-department-modal.html
@@ -14,16 +14,19 @@
- |