fixes at while testing

This commit is contained in:
Faheed 2025-11-22 22:23:14 +03:00
parent 34e2224f80
commit 8a0f715145
8 changed files with 753 additions and 622 deletions

View File

@ -1634,7 +1634,7 @@ class CandidateEmailForm(forms.Form):
message_parts = [ message_parts = [
f"Than you, for your interest in the {self.job.title} role.", f"Than you, for your interest in the {self.job.title} role.",
f"We're pleased to inform you that you have cleared your exam!", f"We're pleased to inform you that you have cleared your exam!",
f"The next step is the mandatory online assessment exam.", f"The next step is the mandatory interview.",
f"Please complete the assessment by using the following link:", f"Please complete the assessment by using the following link:",
f"https://kaauh/hire/exam", f"https://kaauh/hire/exam",
f"We look forward to reviewing your results.", f"We look forward to reviewing your results.",
@ -1659,6 +1659,8 @@ class CandidateEmailForm(forms.Form):
f"If you have any questions before your start date, please contact [Onboarding Contact].", f"If you have any questions before your start date, please contact [Onboarding Contact].",
f"Best regards, The KAAUH Hiring team" f"Best regards, The KAAUH Hiring team"
] ]
elif candidate:
message_parts=""

View File

@ -99,9 +99,9 @@ class JobPosting(Base):
# Core Fields # Core Fields
title = models.CharField(max_length=200) title = models.CharField(max_length=200)
department = models.CharField(max_length=100, blank=True) department = models.CharField(max_length=100, blank=True)
job_type = models.CharField(max_length=20, choices=JOB_TYPES, default="FULL_TIME") job_type = models.CharField(max_length=20, choices=JOB_TYPES, default="Full-time")
workplace_type = models.CharField( workplace_type = models.CharField(
max_length=20, choices=WORKPLACE_TYPES, default="ON_SITE" max_length=20, choices=WORKPLACE_TYPES, default="On-site"
) )
# Location # Location
@ -243,6 +243,11 @@ class JobPosting(Base):
help_text=_("Whether the job posting has been parsed by AI"), help_text=_("Whether the job posting has been parsed by AI"),
verbose_name=_("AI Parsed"), verbose_name=_("AI Parsed"),
) )
# Field to store the generated zip file
cv_zip_file = models.FileField(upload_to='job_zips/', null=True, blank=True)
# Field to track if the background task has completed
zip_created = models.BooleanField(default=False)
class Meta: class Meta:
ordering = ["-created_at"] ordering = ["-created_at"]
@ -906,11 +911,35 @@ class Application(Base):
@property @property
def get_latest_meeting(self): def get_latest_meeting(self):
"""Legacy compatibility - get latest meeting for this application""" """
Retrieves the most specific location details (subclass instance)
of the latest ScheduledInterview for this application, or None.
"""
# 1. Get the latest ScheduledInterview
schedule = self.scheduled_interviews.order_by("-created_at").first() schedule = self.scheduled_interviews.order_by("-created_at").first()
if schedule:
return schedule.zoom_meeting # Check if a schedule exists and if it has an interview location
return None if not schedule or not schedule.interview_location:
return None
# Get the base location instance
interview_location = schedule.interview_location
# 2. Safely retrieve the specific subclass details
# Determine the expected subclass accessor name based on the location_type
if interview_location.location_type == 'Remote':
accessor_name = 'zoommeetingdetails'
else: # Assumes 'Onsite' or any other type defaults to Onsite
accessor_name = 'onsitelocationdetails'
# Use getattr to safely retrieve the specific meeting object (subclass instance).
# If the accessor exists but points to None (because the subclass record was deleted),
# or if the accessor name is wrong for the object's true type, it will return None.
meeting_details = getattr(interview_location, accessor_name, None)
return meeting_details
@property @property
def has_future_meeting(self): def has_future_meeting(self):
@ -960,6 +989,14 @@ class Application(Base):
content_type = ContentType.objects.get_for_model(self.__class__) content_type = ContentType.objects.get_for_model(self.__class__)
return Document.objects.filter(content_type=content_type, object_id=self.id) return Document.objects.filter(content_type=content_type, object_id=self.id)
@property
def belong_to_an_agency(self):
if self.hiring_agency:
return True
else:
return False
class TrainingMaterial(Base): class TrainingMaterial(Base):
@ -983,137 +1020,326 @@ class TrainingMaterial(Base):
return self.title return self.title
class OnsiteMeeting(Base): class InterviewLocation(Base):
class MeetingStatus(models.TextChoices): """
Base model for all interview location/meeting details (remote or onsite)
using Multi-Table Inheritance.
"""
class LocationType(models.TextChoices):
REMOTE = 'Remote', _('Remote (e.g., Zoom, Google Meet)')
ONSITE = 'Onsite', _('In-Person (Physical Location)')
class Status(models.TextChoices):
"""Defines the possible real-time statuses for any interview location/meeting."""
WAITING = "waiting", _("Waiting") WAITING = "waiting", _("Waiting")
STARTED = "started", _("Started") STARTED = "started", _("Started")
ENDED = "ended", _("Ended") ENDED = "ended", _("Ended")
CANCELLED = "cancelled", _("Cancelled") CANCELLED = "cancelled", _("Cancelled")
# Basic meeting details location_type = models.CharField(
topic = models.CharField(max_length=255, verbose_name=_("Topic")) max_length=10,
start_time = models.DateTimeField( choices=LocationType.choices,
db_index=True, verbose_name=_("Start Time") verbose_name=_("Location Type"),
) # Added index db_index=True
duration = models.PositiveIntegerField( )
verbose_name=_("Duration")
) # Duration in minutes details_url = models.URLField(
timezone = models.CharField(max_length=50, verbose_name=_("Timezone")) verbose_name=_("Meeting/Location URL"),
location = models.CharField(null=True, blank=True) max_length=2048,
status = models.CharField(
db_index=True,
max_length=20, # Added index
null=True,
blank=True, blank=True,
verbose_name=_("Status"), null=True
default=MeetingStatus.WAITING, )
topic = models.CharField( # Renamed from 'description' to 'topic' to match your input
max_length=255,
verbose_name=_("Location/Meeting Topic"),
blank=True,
help_text=_("e.g., 'Zoom Topic: Software Interview' or 'Main Conference Room, 3rd Floor'")
)
timezone = models.CharField(
max_length=50,
verbose_name=_("Timezone"),
default='UTC'
) )
def __str__(self):
# Use 'topic' instead of 'description'
return f"{self.get_location_type_display()} - {self.topic[:50]}"
class ZoomMeeting(Base): class Meta:
class MeetingStatus(models.TextChoices): verbose_name = _("Interview Location")
WAITING = "waiting", _("Waiting") verbose_name_plural = _("Interview Locations")
STARTED = "started", _("Started")
ENDED = "ended", _("Ended")
CANCELLED = "cancelled", _("Cancelled")
# Basic meeting details
topic = models.CharField(max_length=255, verbose_name=_("Topic")) class ZoomMeetingDetails(InterviewLocation):
meeting_id = models.CharField( """Concrete model for remote interviews (Zoom specifics)."""
status = models.CharField(
db_index=True, db_index=True,
max_length=20, max_length=20,
unique=True, choices=InterviewLocation.Status.choices,
verbose_name=_("Meeting ID"), # Added index default=InterviewLocation.Status.WAITING,
) # Unique identifier for the meeting )
start_time = models.DateTimeField( start_time = models.DateTimeField(
db_index=True, verbose_name=_("Start Time") db_index=True, verbose_name=_("Start Time")
) # Added index )
duration = models.PositiveIntegerField( duration = models.PositiveIntegerField(
verbose_name=_("Duration") verbose_name=_("Duration (minutes)")
) # Duration in minutes )
timezone = models.CharField(max_length=50, verbose_name=_("Timezone")) meeting_id = models.CharField(
join_url = models.URLField( db_index=True,
verbose_name=_("Join URL") max_length=50,
) # URL for participants to join unique=True,
participant_video = models.BooleanField( verbose_name=_("External Meeting ID")
default=True, verbose_name=_("Participant Video")
) )
password = models.CharField( password = models.CharField(
max_length=20, blank=True, null=True, verbose_name=_("Password") max_length=20, blank=True, null=True, verbose_name=_("Password")
) )
zoom_gateway_response = models.JSONField(
blank=True, null=True, verbose_name=_("Zoom Gateway Response")
)
participant_video = models.BooleanField(
default=True, verbose_name=_("Participant Video")
)
join_before_host = models.BooleanField( join_before_host = models.BooleanField(
default=False, verbose_name=_("Join Before Host") default=False, verbose_name=_("Join Before Host")
) )
host_email=models.CharField(null=True,blank=True)
mute_upon_entry = models.BooleanField( mute_upon_entry = models.BooleanField(
default=False, verbose_name=_("Mute Upon Entry") default=False, verbose_name=_("Mute Upon Entry")
) )
waiting_room = models.BooleanField(default=False, verbose_name=_("Waiting Room")) waiting_room = models.BooleanField(default=False, verbose_name=_("Waiting Room"))
zoom_gateway_response = models.JSONField( # *** REVERTED TO @classmethod (Factory Method) for cleaner instantiation ***
blank=True, null=True, verbose_name=_("Zoom Gateway Response") # @classmethod
# def create(cls, **kwargs):
# """Factory method to ensure location_type is set to REMOTE."""
# return cls(location_type=InterviewLocation.LocationType.REMOTE, **kwargs)
class Meta:
verbose_name = _("Zoom Meeting Details")
verbose_name_plural = _("Zoom Meeting Details")
class OnsiteLocationDetails(InterviewLocation):
"""Concrete model for onsite interviews (Room/Address specifics)."""
physical_address = models.CharField(
max_length=255,
verbose_name=_("Physical Address"),
blank=True,
null=True
)
room_number = models.CharField(
max_length=50,
verbose_name=_("Room Number/Name"),
blank=True,
null=True
)
start_time = models.DateTimeField(
db_index=True, verbose_name=_("Start Time")
)
duration = models.PositiveIntegerField(
verbose_name=_("Duration (minutes)")
) )
status = models.CharField( status = models.CharField(
db_index=True, db_index=True,
max_length=20, # Added index max_length=20,
choices=InterviewLocation.Status.choices,
default=InterviewLocation.Status.WAITING,
)
# *** REVERTED TO @classmethod (Factory Method) for cleaner instantiation ***
# @classmethod
# def create(cls, **kwargs):
# """Factory method to ensure location_type is set to ONSITE."""
# return cls(location_type=InterviewLocation.LocationType.ONSITE, **kwargs)
class Meta:
verbose_name = _("Onsite Location Details")
verbose_name_plural = _("Onsite Location Details")
# --- 2. Scheduling Models ---
class InterviewSchedule(Base):
"""Stores the TEMPLATE criteria for BULK interview generation."""
# We need a field to store the template location details linked to this bulk schedule.
# This location object contains the generic Zoom/Onsite info to be cloned.
template_location = models.ForeignKey(
InterviewLocation,
on_delete=models.SET_NULL,
related_name="schedule_templates",
null=True, null=True,
blank=True, blank=True,
verbose_name=_("Status"), verbose_name=_("Location Template (Zoom/Onsite)")
default=MeetingStatus.WAITING, )
# NOTE: schedule_interview_type field is needed in the form,
# but not on the model itself if we use template_location.
# If you want to keep it:
schedule_interview_type = models.CharField(
max_length=10,
choices=InterviewLocation.LocationType.choices,
verbose_name=_("Interview Type"),
default=InterviewLocation.LocationType.REMOTE
)
job = models.ForeignKey(
JobPosting,
on_delete=models.CASCADE,
related_name="interview_schedules",
db_index=True,
)
applications = models.ManyToManyField(
Application, related_name="interview_schedules", blank=True
)
start_date = models.DateField(db_index=True, verbose_name=_("Start Date"))
end_date = models.DateField(db_index=True, verbose_name=_("End Date"))
working_days = models.JSONField(
verbose_name=_("Working Days")
)
start_time = models.TimeField(verbose_name=_("Start Time"))
end_time = models.TimeField(verbose_name=_("End Time"))
break_start_time = models.TimeField(
verbose_name=_("Break Start Time"), null=True, blank=True
)
break_end_time = models.TimeField(
verbose_name=_("Break End Time"), null=True, blank=True
)
interview_duration = models.PositiveIntegerField(
verbose_name=_("Interview Duration (minutes)")
)
buffer_time = models.PositiveIntegerField(
verbose_name=_("Buffer Time (minutes)"), default=0
)
created_by = models.ForeignKey(
User, on_delete=models.CASCADE, db_index=True
) )
# Timestamps
def __str__(self): def __str__(self):
return self.topic return f"Schedule for {self.job.title}"
@property
def get_job(self):
return self.interview.job
@property
def get_candidate(self):
return self.interview.application.person
@property
def candidate_full_name(self):
return self.interview.application.person.full_name
@property
def get_participants(self):
return self.interview.job.participants.all()
@property
def get_users(self):
return self.interview.job.users.all()
class MeetingComment(Base): class ScheduledInterview(Base):
""" """Stores individual scheduled interviews (whether bulk or individually created)."""
Model for storing meeting comments/notes
""" class InterviewStatus(models.TextChoices):
SCHEDULED = "scheduled", _("Scheduled")
CONFIRMED = "confirmed", _("Confirmed")
CANCELLED = "cancelled", _("Cancelled")
COMPLETED = "completed", _("Completed")
meeting = models.ForeignKey( application = models.ForeignKey(
ZoomMeeting, Application,
on_delete=models.CASCADE, on_delete=models.CASCADE,
related_name="comments", related_name="scheduled_interviews",
verbose_name=_("Meeting"), db_index=True,
) )
job = models.ForeignKey(
JobPosting,
on_delete=models.CASCADE,
related_name="scheduled_interviews",
db_index=True,
)
# Links to the specific, individual location/meeting details for THIS interview
interview_location = models.OneToOneField(
InterviewLocation,
on_delete=models.CASCADE,
related_name="scheduled_interview",
null=True,
blank=True,
db_index=True,
verbose_name=_("Meeting/Location Details")
)
# Link back to the bulk schedule template (optional if individually created)
schedule = models.ForeignKey(
InterviewSchedule,
on_delete=models.SET_NULL,
related_name="interviews",
null=True,
blank=True,
db_index=True,
)
participants = models.ManyToManyField('Participants', blank=True)
system_users = models.ManyToManyField(User, related_name="attended_interviews", blank=True)
interview_date = models.DateField(db_index=True, verbose_name=_("Interview Date"))
interview_time = models.TimeField(verbose_name=_("Interview Time"))
status = models.CharField(
db_index=True,
max_length=20,
choices=InterviewStatus.choices,
default=InterviewStatus.SCHEDULED,
)
def __str__(self):
return f"Interview with {self.application.person.full_name} for {self.job.title}"
class Meta:
indexes = [
models.Index(fields=["job", "status"]),
models.Index(fields=["interview_date", "interview_time"]),
models.Index(fields=["application", "job"]),
]
# --- 3. Interview Notes Model (Fixed) ---
class InterviewNote(Base):
"""Model for storing notes, feedback, or comments related to a specific ScheduledInterview."""
class NoteType(models.TextChoices):
FEEDBACK = 'Feedback', _('Candidate Feedback')
LOGISTICS = 'Logistics', _('Logistical Note')
GENERAL = 'General', _('General Comment')
1
interview = models.ForeignKey(
ScheduledInterview,
on_delete=models.CASCADE,
related_name="notes",
verbose_name=_("Scheduled Interview"),
db_index=True
)
author = models.ForeignKey( author = models.ForeignKey(
User, User,
on_delete=models.CASCADE, on_delete=models.CASCADE,
related_name="meeting_comments", related_name="interview_notes",
verbose_name=_("Author"), verbose_name=_("Author"),
db_index=True
) )
content = CKEditor5Field(verbose_name=_("Content"), config_name="extends")
# Inherited from Base: created_at, updated_at, slug note_type = models.CharField(
max_length=50,
choices=NoteType.choices,
default=NoteType.FEEDBACK,
verbose_name=_("Note Type")
)
content = CKEditor5Field(verbose_name=_("Content/Feedback"), config_name="extends")
class Meta: class Meta:
verbose_name = _("Meeting Comment") verbose_name = _("Interview Note")
verbose_name_plural = _("Meeting Comments") verbose_name_plural = _("Interview Notes")
ordering = ["-created_at"] ordering = ["created_at"]
def __str__(self): def __str__(self):
return f"Comment by {self.author.get_username()} on {self.meeting.topic}" return f"{self.get_note_type_display()} by {self.author.get_username()} on {self.interview.id}"
class FormTemplate(Base): class FormTemplate(Base):
""" """
@ -1926,143 +2152,6 @@ class BreakTime(models.Model):
return f"{self.start_time} - {self.end_time}" return f"{self.start_time} - {self.end_time}"
class InterviewSchedule(Base):
"""Stores the scheduling criteria for interviews"""
class InterviewType(models.TextChoices):
REMOTE = "Remote", "Remote Interview"
ONSITE = "Onsite", "In-Person Interview"
interview_type = models.CharField(
max_length=10,
choices=InterviewType.choices,
default=InterviewType.REMOTE,
verbose_name="Interview Meeting Type",
)
job = models.ForeignKey(
JobPosting,
on_delete=models.CASCADE,
related_name="interview_schedules",
db_index=True,
)
applications = models.ManyToManyField(
Application, related_name="interview_schedules", blank=True, null=True
)
start_date = models.DateField(
db_index=True, verbose_name=_("Start Date")
) # Added index
end_date = models.DateField(
db_index=True, verbose_name=_("End Date")
) # Added index
working_days = models.JSONField(
verbose_name=_("Working Days")
) # Store days of week as [0,1,2,3,4] for Mon-Fri
start_time = models.TimeField(verbose_name=_("Start Time"))
end_time = models.TimeField(verbose_name=_("End Time"))
break_start_time = models.TimeField(
verbose_name=_("Break Start Time"), null=True, blank=True
)
break_end_time = models.TimeField(
verbose_name=_("Break End Time"), null=True, blank=True
)
interview_duration = models.PositiveIntegerField(
verbose_name=_("Interview Duration (minutes)")
)
buffer_time = models.PositiveIntegerField(
verbose_name=_("Buffer Time (minutes)"), default=0
)
created_by = models.ForeignKey(
User, on_delete=models.CASCADE, db_index=True
) # Added index
def __str__(self):
return f"Interview Schedule for {self.job.title}"
class Meta:
indexes = [
models.Index(fields=["start_date"]),
models.Index(fields=["end_date"]),
models.Index(fields=["created_by"]),
]
class ScheduledInterview(Base):
"""Stores individual scheduled interviews"""
application = models.ForeignKey(
Application,
on_delete=models.CASCADE,
related_name="scheduled_interviews",
db_index=True,
)
participants = models.ManyToManyField("Participants", blank=True)
system_users = models.ManyToManyField(User, blank=True)
job = models.ForeignKey(
"JobPosting",
on_delete=models.CASCADE,
related_name="scheduled_interviews",
db_index=True,
)
zoom_meeting = models.OneToOneField(
ZoomMeeting,
on_delete=models.CASCADE,
related_name="interview",
db_index=True,
null=True,
blank=True,
)
onsite_meeting = models.OneToOneField(
OnsiteMeeting,
on_delete=models.CASCADE,
related_name="onsite_interview",
db_index=True,
null=True,
blank=True,
)
schedule = models.ForeignKey(
InterviewSchedule,
on_delete=models.CASCADE,
related_name="interviews",
null=True,
blank=True,
db_index=True,
)
interview_date = models.DateField(
db_index=True, verbose_name=_("Interview Date")
) # Added index
interview_time = models.TimeField(verbose_name=_("Interview Time"))
status = models.CharField(
db_index=True,
max_length=20, # Added index
choices=[
("scheduled", _("Scheduled")),
("confirmed", _("Confirmed")),
("cancelled", _("Cancelled")),
("completed", _("Completed")),
],
default="scheduled",
)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
def __str__(self):
return (
f"Interview with {self.application.person.full_name} for {self.job.title}"
)
class Meta:
indexes = [
models.Index(fields=["job", "status"]),
models.Index(fields=["interview_date", "interview_time"]),
models.Index(fields=["application", "job"]),
]
class Notification(models.Model): class Notification(models.Model):
@ -2101,7 +2190,7 @@ class Notification(models.Model):
verbose_name=_("Status"), verbose_name=_("Status"),
) )
related_meeting = models.ForeignKey( related_meeting = models.ForeignKey(
ZoomMeeting, ZoomMeetingDetails,
on_delete=models.CASCADE, on_delete=models.CASCADE,
related_name="notifications", related_name="notifications",
null=True, null=True,

View File

@ -93,8 +93,26 @@
<i class="fas fa-tachometer-alt me-1"></i> {% trans "Dashboard" %} <i class="fas fa-tachometer-alt me-1"></i> {% trans "Dashboard" %}
</a> </a>
</li> </li>
<li class="nav-item">
<a class="nav-link text-white" href="{% url 'kaauh_career' %}">
<i class="fas fa-hand me-1"></i> {% trans "KAAUH Careers" %}
</a>
</li>
{% endif %} {% endif %}
{% if request.user.is_authenticated %}
<li class="nav-item">
<a class="nav-link text-white" href="{% url 'user_detail' request.user.pk %}">
<i class="fas fa-user-circle me-1"></i> <span>{% trans "My Profile" %}</span></a></li>
{% endif %}
<li class="nav-item me-2">
<a class="nav-link text-white" href="{% url 'message_list' %}">
<i class="fas fa-envelope"></i> <span>{% trans "Messages" %}</span>
</a>
</li>
<li class="nav-item dropdown"> <li class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-white" href="#" role="button" data-bs-toggle="dropdown" <a class="nav-link dropdown-toggle text-white" href="#" role="button" data-bs-toggle="dropdown"
data-bs-offset="0, 8" aria-expanded="false" aria-label="{% trans 'Toggle language menu' %}"> data-bs-offset="0, 8" aria-expanded="false" aria-label="{% trans 'Toggle language menu' %}">
@ -120,16 +138,6 @@
</li> </li>
</ul> </ul>
</li> </li>
{% if request.user.is_authenticated %}
<li class="nav-item">
<a class="nav-link text-white" href="{% url 'user_detail' request.user.pk %}">
<i class="fas fa-user-circle me-1"></i> <span>{% trans "My Profile" %}</span></a></li>
{% endif %}
<li class="nav-item me-2">
<a class="nav-link text-white" href="{% url 'message_list' %}">
<i class="fas fa-envelope"></i> <span>{% trans "Messages" %}</span>
</a>
</li>
<li class="nav-item ms-3"> <li class="nav-item ms-3">
{% if request.user.is_authenticated %} {% if request.user.is_authenticated %}

View File

@ -9,285 +9,265 @@
:root { :root {
--kaauh-teal: #00636e; --kaauh-teal: #00636e;
--kaauh-teal-dark: #004a53; --kaauh-teal-dark: #004a53;
--kaauh-border: #e9ecef; --kaauh-border: #eaeff3;
--kaauh-primary-text: #212529; --kaauh-primary-text: #343a40;
--kaauh-success: #198754; --kaauh-success: #28a745;
--kaauh-info: #0dcaf0; --kaauh-info: #17a2b8;
--kaauh-danger: #dc3545; --kaauh-danger: #dc3545;
--kaauh-warning: #ffc107; --kaauh-warning: #ffc107;
--kaauh-bg-light: #f8f9fa;
}
.text-primary-teal {
color: var(--kaauh-teal) !important;
} }
.kaauh-card { .kaauh-card {
border: none; border: 1px solid var(--kaauh-border);
border-radius: 0.75rem; border-radius: 0.75rem;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04); box-shadow: 0 4px 12px rgba(0,0,0,0.06);
background-color: white; background-color: white;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kaauh-card:hover {
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
} }
.btn-main-action { .btn-main-action {
background-color: var(--kaauh-teal); background-color: var(--kaauh-teal);
border-color: var(--kaauh-teal); border-color: var(--kaauh-teal);
color: white; color: white;
font-weight: 500; font-weight: 600;
padding: 0.5rem 1.2rem;
transition: all 0.2s ease; transition: all 0.2s ease;
} }
.btn-main-action:hover { .btn-main-action:hover {
background-color: var(--kaauh-teal-dark); background-color: var(--kaauh-teal-dark);
border-color: var(--kaauh-teal-dark); border-color: var(--kaauh-teal-dark);
color: white; box-shadow: 0 4px 8px rgba(0,0,0,0.15);
transform: translateY(-1px);
}
.btn-white {
background-color: white;
border-color: var(--kaauh-border);
color: var(--kaauh-primary-text);
}
.btn-white:hover {
background-color: var(--kaauh-bg-light);
border-color: #dee2e6;
} }
.status-badge { .status-badge {
font-size: 0.75rem; font-size: 0.75rem;
font-weight: 600; padding: 0.3em 0.7em;
letter-spacing: 0.5px; border-radius: 0.35rem;
text-transform: uppercase; font-weight: 700;
}
.status-ACTIVE {
background-color: #d1e7dd;
color: #0f5132;
}
.status-EXPIRED {
background-color: #f8d7da;
color: #842029;
}
.status-COMPLETED {
background-color: #cff4fc;
color: #055160;
}
.status-CANCELLED {
background-color: #fff3cd;
color: #664d03;
}
.bg-soft-primary {
background-color: rgba(13, 110, 253, 0.1);
}
.bg-soft-info {
background-color: rgba(13, 202, 240, 0.1);
}
.bg-soft-success {
background-color: rgba(25, 135, 84, 0.1);
}
.avatar-circle {
width: 40px;
height: 40px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
}
.w-20 {
width: 20px;
text-align: center;
} }
.status-ACTIVE { background-color: var(--kaauh-success); color: white; }
.status-EXPIRED { background-color: var(--kaauh-danger); color: white; }
.status-COMPLETED { background-color: var(--kaauh-info); color: white; }
.status-CANCELLED { background-color: var(--kaauh-warning); color: #856404; }
.progress-ring { .progress-ring {
width: 120px;
height: 120px;
position: relative;
}
.progress-ring-circle {
transition: stroke-dashoffset 0.35s;
transform: rotate(-90deg); transform: rotate(-90deg);
transform-origin: 50% 50%; transform-origin: 50% 50%;
} }
.progress-ring-circle { .progress-ring-text {
transition: stroke-dashoffset 0.5s ease-in-out; position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 1.5rem;
font-weight: 700;
color: var(--kaauh-teal-dark);
}
.message-item {
border-left: 4px solid var(--kaauh-teal);
background-color: #f8f9fa;
padding: 1rem;
margin-bottom: 1rem;
border-radius: 0 0.5rem 0.5rem 0;
}
.message-item.unread {
border-left-color: var(--kaauh-info);
background-color: #e7f3ff;
} }
</style> </style>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container-fluid py-5 bg-light"> <div class="container-fluid py-4">
<!-- Header --> <!-- Header -->
<div class="row mb-4"> <div class="d-flex justify-content-between align-items-center mb-4">
<div class="col-12"> <div>
<div class="d-flex justify-content-between align-items-start"> <h1 class="h3 mb-1" style="color: var(--kaauh-teal-dark); font-weight: 700;">
<div> <i class="fas fa-tasks me-2"></i>
<nav aria-label="breadcrumb" class="mb-2"> {{ assignment.agency.name }} - {{ assignment.job.title }}
<ol class="breadcrumb mb-0 small"> </h1>
<li class="breadcrumb-item"><a href="{% url 'agency_assignment_list' %}" <p class="text-muted mb-0">
class="text-decoration-none text-muted">{% trans "Assignments" %}</a></li> {% trans "Assignment Details and Management" %}
<li class="breadcrumb-item active" aria-current="page">{{ assignment.job.title }}</li> </p>
</ol> </div>
</nav> <div>
<h1 class="h2 fw-bold text-dark mb-2"> <a href="{% url 'agency_assignment_list' %}" class="btn btn-outline-secondary me-2">
{{ assignment.job.title }} <i class="fas fa-arrow-left me-1"></i> {% trans "Back to Assignments" %}
</h1> </a>
<div class="d-flex align-items-center text-muted"> <a href="{% url 'agency_assignment_update' assignment.slug %}" class="btn btn-main-action">
<span class="me-3"><i class="fas fa-building me-1"></i> {{ assignment.agency.name }}</span> <i class="fas fa-edit me-1"></i> {% trans "Edit Assignment" %}
<span class="badge status-{{ assignment.status }} rounded-pill px-3">{{ </a>
assignment.get_status_display }}</span>
</div>
</div>
<div class="d-flex gap-2">
<a href="{% url 'agency_assignment_list' %}" class="btn btn-white border shadow-sm">
<i class="fas fa-arrow-left me-1"></i> {% trans "Back" %}
</a>
<a href="{% url 'agency_assignment_update' assignment.slug %}"
class="btn btn-main-action shadow-sm">
<i class="fas fa-edit me-1"></i> {% trans "Edit" %}
</a>
</div>
</div>
</div> </div>
</div> </div>
<div class="row g-4"> <div class="row">
<!-- Left Column: Details & Candidates --> <!-- Assignment Overview -->
<div class="col-lg-8 col-md-12"> <div class="col-lg-8">
<!-- Assignment Details Card --> <!-- Assignment Details Card -->
<div class="kaauh-card mb-4"> <div class="kaauh-card p-4 mb-4">
<div class="card-header bg-transparent border-bottom py-3 px-4"> <h5 class="mb-4" style="color: var(--kaauh-teal-dark);">
<h5 class="mb-0 fw-bold text-dark"> <i class="fas fa-info-circle me-2"></i>
<i class="fas fa-info-circle me-2 text-primary-teal"></i> {% trans "Assignment Details" %}
{% trans "Assignment Details" %} </h5>
</h5>
</div> <div class="row">
<div class="card-body p-4"> <div class="col-md-6">
<div class="row g-4"> <div class="mb-3">
<div class="col-md-6"> <label class="text-muted small">{% trans "Agency" %}</label>
<div class="detail-group"> <div class="fw-bold">{{ assignment.agency.name }}</div>
<label class="text-uppercase text-muted small fw-bold mb-1">{% trans "Agency" %}</label> <div class="text-muted small">{{ assignment.agency.contact_person }}</div>
<div class="fs-6 fw-medium text-dark">{{ assignment.agency.name }}</div> </div>
<div class="text-muted small">{{ assignment.agency.contact_person }}</div> <div class="mb-3">
<label class="text-muted small">{% trans "Job" %}</label>
<div class="fw-bold">{{ assignment.job.title }}</div>
<div class="text-muted small">{{ assignment.job.department }}</div>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label class="text-muted small">{% trans "Status" %}</label>
<div>
<span class="status-badge status-{{ assignment.status }}">
{{ assignment.get_status_display }}
</span>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="mb-3">
<div class="detail-group"> <label class="text-muted small">{% trans "Deadline" %}</label>
<label class="text-uppercase text-muted small fw-bold mb-1">{% trans "Department" <div class="{% if assignment.is_expired %}text-danger{% else %}text-muted{% endif %}">
%}</label> <i class="fas fa-calendar-alt me-1"></i>
<div class="fs-6 fw-medium text-dark">{{ assignment.job.department }}</div> {{ assignment.deadline_date|date:"Y-m-d H:i" }}
</div> </div>
</div> {% if assignment.is_expired %}
<div class="col-md-6"> <small class="text-danger">
<div class="detail-group">
<label class="text-uppercase text-muted small fw-bold mb-1">{% trans "Deadline"
%}</label>
<div
class="fs-6 fw-medium {% if assignment.is_expired %}text-danger{% else %}text-dark{% endif %}">
{{ assignment.deadline_date|date:"M d, Y - H:i" }}
</div>
{% if assignment.is_expired %}
<small class="text-danger fw-bold">
<i class="fas fa-exclamation-triangle me-1"></i>{% trans "Expired" %} <i class="fas fa-exclamation-triangle me-1"></i>{% trans "Expired" %}
</small> </small>
{% endif %} {% endif %}
</div>
</div>
<div class="col-md-6">
<div class="detail-group">
<label class="text-uppercase text-muted small fw-bold mb-1">{% trans "Created At"
%}</label>
<div class="fs-6 fw-medium text-dark">{{ assignment.created_at|date:"M d, Y" }}</div>
</div>
</div> </div>
</div> </div>
{% if assignment.admin_notes %}
<div class="mt-4 pt-4 border-top">
<label class="text-uppercase text-muted small fw-bold mb-2">{% trans "Admin Notes" %}</label>
<div class="p-3 bg-light rounded border-start border-4 border-info text-muted">
{{ assignment.admin_notes }}
</div>
</div>
{% endif %}
</div> </div>
{% if assignment.admin_notes %}
<div class="mt-3 pt-3 border-top">
<label class="text-muted small">{% trans "Admin Notes" %}</label>
<div class="text-muted">{{ assignment.admin_notes }}</div>
</div>
{% endif %}
</div> </div>
{% comment %} <div class="kaauh-card shadow-sm mb-4">
<div class="card-body my-2">
<h5 class="card-title mb-3 mx-2">
<i class="fas fa-key me-2 text-warning"></i>
{% trans "Access Credentials" %}
</h5>
<div class="mb-3 mx-2">
<label class="form-label text-muted small">{% trans "Login URL" %}</label>
<div class="input-group">
<input type="text" readonly value="{{ request.scheme }}://{{ request.get_host }}{% url 'agency_portal_login' %}"
class="form-control font-monospace" id="loginUrl">
<button class="btn btn-outline-secondary" type="button" onclick="copyToClipboard('loginUrl')">
<i class="fas fa-copy"></i>
</button>
</div>
</div>
<div class="mb-3 mx-2">
<label class="form-label text-muted small">{% trans "Access Token" %}</label>
<div class="input-group">
<input type="text" readonly value="{{ access_link.unique_token }}"
class="form-control font-monospace" id="accessToken">
<button class="btn btn-outline-secondary" type="button" onclick="copyToClipboard('accessToken')">
<i class="fas fa-copy"></i>
</button>
</div>
</div>
<div class="mb-3 mx-2">
<label class="form-label text-muted small">{% trans "Password" %}</label>
<div class="input-group">
<input type="text" readonly value="{{ access_link.access_password }}"
class="form-control font-monospace" id="accessPassword">
<button class="btn btn-outline-secondary" type="button" onclick="copyToClipboard('accessPassword')">
<i class="fas fa-copy"></i>
</button>
</div>
</div>
<div class="alert alert-info mx-2">
<i class="fas fa-info-circle me-2"></i>
{% trans "Share these credentials securely with the agency. They can use this information to log in and submit candidates." %}
</div>
{% if access_link %}
<a href="{% url 'agency_access_link_detail' access_link.slug %}"
class="btn btn-outline-info btn-sm mx-2">
<i class="fas fa-eye me-1"></i> {% trans "View Access Links Details" %}
</a>
{% endif %}
</div>
</div> {% endcomment %}
<!-- Candidates Card --> <!-- Candidates Card -->
<div class="kaauh-card"> <div class="kaauh-card p-4">
<div <div class="d-flex justify-content-between align-items-center mb-4">
class="card-header bg-transparent border-bottom py-3 px-4 d-flex justify-content-between align-items-center"> <h5 class="mb-0" style="color: var(--kaauh-teal-dark);">
<h5 class="mb-0 fw-bold text-dark"> <i class="fas fa-users me-2"></i>
<i class="fas fa-users me-2 text-primary-teal"></i> {% trans "Submitted Candidates" %} ({{ total_candidates }})
{% trans "Submitted Candidates" %}
<span class="badge bg-light text-dark border ms-2">{{ total_candidates }}</span>
</h5> </h5>
{% if access_link %} {% if access_link %}
<a href="{% url 'agency_portal_login' %}" target="_blank" class="btn btn-sm btn-outline-info"> <a href="{% url 'agency_portal_login' %}" target="_blank" class="btn btn-outline-info btn-sm">
<i class="fas fa-external-link-alt me-1"></i> {% trans "Portal Preview" %} <i class="fas fa-external-link-alt me-1"></i> {% trans "Preview Portal" %}
</a> </a>
{% endif %} {% endif %}
</div> </div>
<div class="card-body p-0">
{% if candidates %} {% if candidates %}
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-hover align-middle mb-0"> <table class="table table-hover">
<thead class="bg-light"> <thead>
<tr> <tr>
<th class="px-4 py-3 text-uppercase small fw-bold text-muted">{% trans "Candidate" <th>{% trans "Name" %}</th>
%}</th> <th>{% trans "Contact" %}</th>
<th class="px-4 py-3 text-uppercase small fw-bold text-muted">{% trans "Contact" %} <th>{% trans "Stage" %}</th>
</th> <th>{% trans "Submitted" %}</th>
<th class="px-4 py-3 text-uppercase small fw-bold text-muted">{% trans "Stage" %} <th>{% trans "Actions" %}</th>
</th>
<th class="px-4 py-3 text-uppercase small fw-bold text-muted">{% trans "Submitted"
%}</th>
<th class="px-4 py-3 text-uppercase small fw-bold text-muted text-end">{% trans
"Actions" %}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for candidate in candidates %} {% for candidate in candidates %}
<tr> <tr>
<td class="px-4"> <td>
<div class="d-flex align-items-center"> <div class="fw-bold">{{ candidate.name }}</div>
<div class="avatar-circle me-3 bg-soft-primary text-primary fw-bold"> </td>
{{ candidate.name|slice:":2"|upper }} <td>
</div> <div class="small">
<div> <div><i class="fas fa-envelope me-1"></i> {{ candidate.email }}</div>
<div class="fw-bold text-dark">{{ candidate.name }}</div> <div><i class="fas fa-phone me-1"></i> {{ candidate.phone }}</div>
</div>
</div> </div>
</td> </td>
<td class="px-4"> <td>
<span class="badge bg-info">{{ candidate.get_stage_display }}</span>
</td>
<td>
<div class="small text-muted"> <div class="small text-muted">
<div class="mb-1"><i class="fas fa-envelope me-2 w-20"></i>{{ {{ candidate.created_at|date:"Y-m-d H:i" }}
candidate.email }}</div>
<div><i class="fas fa-phone me-2 w-20"></i>{{ candidate.phone }}</div>
</div> </div>
</td> </td>
<td class="px-4"> <td>
<span class="badge bg-soft-info text-info rounded-pill px-3">{{
candidate.get_stage_display }}</span>
</td>
<td class="px-4">
<span class="small text-muted">{{ candidate.created_at|date:"M d, Y" }}</span>
</td>
<td class="px-4 text-end">
<a href="{% url 'candidate_detail' candidate.slug %}" <a href="{% url 'candidate_detail' candidate.slug %}"
class="btn btn-sm btn-white border shadow-sm text-primary" class="btn btn-sm btn-outline-primary" title="{% trans 'View Details' %}">
title="{% trans 'View Details' %}">
<i class="fas fa-eye"></i> <i class="fas fa-eye"></i>
</a> </a>
</td> </td>
@ -296,103 +276,130 @@
</tbody> </tbody>
</table> </table>
</div> </div>
{% else %} {% else %}
<div class="text-center py-5"> <div class="text-center py-4">
<div class="mb-3"> <i class="fas fa-users fa-2x text-muted mb-3"></i>
<div class="avatar-circle bg-light text-muted mx-auto" <h6 class="text-muted">{% trans "No candidates submitted yet" %}</h6>
style="width: 64px; height: 64px; font-size: 24px;"> <p class="text-muted small">
<i class="fas fa-user-plus"></i> {% trans "Candidates will appear here once the agency submits them through their portal." %}
</div>
</div>
<h6 class="fw-bold text-dark">{% trans "No candidates yet" %}</h6>
<p class="text-muted small mb-0">
{% trans "Candidates submitted by the agency will appear here." %}
</p> </p>
</div> </div>
{% endif %} {% endif %}
</div>
</div> </div>
</div> </div>
<!-- Right Column: Sidebar --> <!-- Sidebar -->
<div class="col-lg-4 col-md-12"> <div class="col-lg-4">
<!-- Progress Card --> <!-- Progress Card -->
<div class="kaauh-card mb-4"> <div class="kaauh-card p-4 mb-4">
<div class="card-body p-4 text-center"> <h5 class="mb-4 text-center" style="color: var(--kaauh-teal-dark);">
<h6 class="text-uppercase text-muted small fw-bold mb-4">{% trans "Submission Goal" %}</h6> {% trans "Submission Progress" %}
</h5>
<div class="position-relative d-inline-block mb-3"> <div class="text-center mb-3">
<svg class="progress-ring" width="140" height="140"> <div class="progress-ring">
<circle class="progress-ring-bg" stroke="#f1f3f5" stroke-width="10" fill="transparent" <svg width="120" height="120">
r="60" cx="70" cy="70" /> <circle class="progress-ring-circle"
<circle class="progress-ring-circle" stroke="var(--kaauh-teal)" stroke-width="10" stroke="#e9ecef"
fill="transparent" r="60" cx="70" cy="70" stroke-width="8"
style="stroke-dasharray: 376.99; stroke-dashoffset: {{ stroke_dashoffset }};" /> fill="transparent"
r="52"
cx="60"
cy="60"/>
<circle class="progress-ring-circle"
stroke="var(--kaauh-teal)"
stroke-width="8"
fill="transparent"
r="52"
cx="60"
cy="60"
style="stroke-dasharray: 326.73; stroke-dashoffset: {{ stroke_dashoffset }};"/>
</svg> </svg>
<div class="position-absolute top-50 start-50 translate-middle text-center"> <div class="progress-ring-text">
<div class="h3 fw-bold mb-0 text-dark">{{ total_candidates }}</div> {% widthratio total_candidates assignment.max_candidates 100 as progress %}
<div class="small text-muted text-uppercase">{% trans "of" %} {{ assignment.max_candidates {{ progress|floatformat:0 }}%
}}</div>
</div> </div>
</div> </div>
</div>
<p class="text-muted small mb-0"> <div class="text-center">
{% trans "Candidates submitted" %} <div class="h4 mb-1">{{ total_candidates }}</div>
</p> <div class="text-muted">/ {{ assignment.max_candidates }} {% trans "candidates" %}</div>
</div>
<div class="progress mt-3" style="height: 8px;">
{% widthratio total_candidates assignment.max_candidates 100 as progress %}
<div class="progress-bar" style="width: {{ progress }}%"></div>
</div> </div>
</div> </div>
<!-- Actions Card -->
<div class="kaauh-card mb-4">
<div class="card-header bg-transparent border-bottom py-3 px-4">
<h6 class="mb-0 fw-bold text-dark">{% trans "Quick Actions" %}</h6>
</div>
<div class="card-body p-4">
<div class="d-grid gap-3">
<a href="" class="btn btn-outline-primary">
<i class="fas fa-envelope me-2"></i> {% trans "Send Message" %}
</a>
{% if assignment.is_active and not assignment.is_expired %} <!-- Actions Card -->
<button type="button" class="btn btn-outline-warning" data-bs-toggle="modal" <div class="kaauh-card p-4">
data-bs-target="#extendDeadlineModal"> <h5 class="mb-4" style="color: var(--kaauh-teal-dark);">
<i class="fas fa-clock me-2"></i> {% trans "Extend Deadline" %} <i class="fas fa-cog me-2"></i>
{% trans "Actions" %}
</h5>
<div class="d-grid gap-2">
<a href=""
class="btn btn-outline-primary">
<i class="fas fa-envelope me-1"></i> {% trans "Send Message" %}
</a>
{% if assignment.is_active and not assignment.is_expired %}
<button type="button" class="btn btn-outline-warning"
data-bs-toggle="modal" data-bs-target="#extendDeadlineModal">
<i class="fas fa-clock me-1"></i> {% trans "Extend Deadline" %}
</button> </button>
{% endif %}
<a href="{% url 'agency_assignment_update' assignment.slug %}"
class="btn btn-outline-secondary">
<i class="fas fa-edit me-1"></i> {% trans "Edit Assignment" %}
</a>
</div>
</div>
</div>
</div>
<!-- Messages Section -->
{% if messages_ %}
<div class="kaauh-card p-4 mt-4">
<h5 class="mb-4" style="color: var(--kaauh-teal-dark);">
<i class="fas fa-comments me-2"></i>
{% trans "Recent Messages" %}
</h5>
<div class="row">
{% for message in messages_|slice:":6" %}
<div class="col-lg-6 mb-3">
<div class="message-item {% if not message.is_read %}unread{% endif %}">
<div class="d-flex justify-content-between align-items-start mb-2">
<div class="fw-bold">{{ message.subject }}</div>
<small class="text-muted">{{ message.created_at|date:"Y-m-d H:i" }}</small>
</div>
<div class="small text-muted mb-2">
{% trans "From" %}: {{ message.sender.get_full_name }}
</div>
<div class="small">{{ message.message|truncatewords:30 }}</div>
{% if not message.is_read %}
<span class="badge bg-info mt-2">{% trans "New" %}</span>
{% endif %} {% endif %}
</div> </div>
</div> </div>
{% endfor %}
</div> </div>
<!-- Recent Messages --> {% if messages_.count > 6 %}
{% if messages_ %} <div class="text-center mt-3">
<div class="kaauh-card"> <a href="#" class="btn btn-outline-primary btn-sm">
<div {% trans "View All Messages" %}
class="card-header bg-transparent border-bottom py-3 px-4 d-flex justify-content-between align-items-center"> </a>
<h6 class="mb-0 fw-bold text-dark">{% trans "Recent Messages" %}</h6>
{% if messages_.count > 3 %}
<a href="#" class="small text-decoration-none">{% trans "View All" %}</a>
{% endif %}
</div> </div>
<div class="card-body p-0">
<div class="list-group list-group-flush">
{% for message in messages_|slice:":3" %}
<div
class="list-group-item p-3 border-bottom-0 {% if not message.is_read %}bg-soft-info{% endif %}">
<div class="d-flex justify-content-between mb-1">
<span class="fw-bold text-dark small">{{ message.sender.get_full_name }}</span>
<small class="text-muted" style="font-size: 0.7rem;">{{ message.created_at|date:"M d"
}}</small>
</div>
<div class="fw-medium small text-dark mb-1">{{ message.subject }}</div>
<div class="text-muted small text-truncate">{{ message.message }}</div>
</div>
{% endfor %}
</div>
</div>
</div>
{% endif %} {% endif %}
</div> </div>
</div> {% endif %}
</div> </div>
<!-- Extend Deadline Modal --> <!-- Extend Deadline Modal -->
@ -413,8 +420,8 @@
<label for="new_deadline" class="form-label"> <label for="new_deadline" class="form-label">
{% trans "New Deadline" %} <span class="text-danger">*</span> {% trans "New Deadline" %} <span class="text-danger">*</span>
</label> </label>
<input type="datetime-local" class="form-control" id="new_deadline" name="new_deadline" <input type="datetime-local" class="form-control" id="new_deadline"
required> name="new_deadline" required>
<small class="form-text text-muted"> <small class="form-text text-muted">
{% trans "Current deadline:" %} {{ assignment.deadline_date|date:"Y-m-d H:i" }} {% trans "Current deadline:" %} {{ assignment.deadline_date|date:"Y-m-d H:i" }}
</small> </small>
@ -436,13 +443,13 @@
{% block customJS %} {% block customJS %}
<script> <script>
function copyToClipboard(text) { function copyToClipboard(text) {
navigator.clipboard.writeText(text).then(function () { navigator.clipboard.writeText(text).then(function() {
// Show success message // Show success message
const toast = document.createElement('div'); const toast = document.createElement('div');
toast.className = 'position-fixed top-0 end-0 p-3'; toast.className = 'position-fixed top-0 end-0 p-3';
toast.style.zIndex = '1050'; toast.style.zIndex = '1050';
toast.innerHTML = ` toast.innerHTML = `
<div class="toast show" role="alert"> <div class="toast show" role="alert">
<div class="toast-header"> <div class="toast-header">
<strong class="me-auto">{% trans "Success" %}</strong> <strong class="me-auto">{% trans "Success" %}</strong>
@ -453,61 +460,61 @@
</div> </div>
</div> </div>
`; `;
document.body.appendChild(toast); document.body.appendChild(toast);
setTimeout(() => {
toast.remove();
}, 3000);
});
}
function copyToClipboard(elementId) {
const element = document.getElementById(elementId);
element.select();
document.execCommand('copy');
// Show feedback
const button = element.nextElementSibling;
const originalHTML = button.innerHTML;
button.innerHTML = '<i class="fas fa-check"></i>';
button.classList.add('btn-success');
button.classList.remove('btn-outline-secondary');
setTimeout(() => { setTimeout(() => {
button.innerHTML = originalHTML; toast.remove();
button.classList.remove('btn-success'); }, 3000);
button.classList.add('btn-outline-secondary');
}, 2000);
}
function confirmDeactivate() {
if (confirm('{% trans "Are you sure you want to deactivate this access link? Agencies will no longer be able to use it." %}')) {
// Submit form to deactivate
window.location.href = '';
}
}
function confirmReactivate() {
if (confirm('{% trans "Are you sure you want to reactivate this access link?" %}')) {
// Submit form to reactivate
window.location.href = '';
}
}
document.addEventListener('DOMContentLoaded', function () {
// Set minimum datetime for new deadline
const deadlineInput = document.getElementById('new_deadline');
if (deadlineInput) {
const currentDeadline = new Date('{{ assignment.deadline_date|date:"Y-m-d\\TH:i" }}');
const now = new Date();
const minDateTime = new Date(Math.max(currentDeadline, now));
const localDateTime = new Date(minDateTime.getTime() - minDateTime.getTimezoneOffset() * 60000)
.toISOString()
.slice(0, 16);
deadlineInput.min = localDateTime;
deadlineInput.value = localDateTime;
}
}); });
}
function copyToClipboard(elementId) {
const element = document.getElementById(elementId);
element.select();
document.execCommand('copy');
// Show feedback
const button = element.nextElementSibling;
const originalHTML = button.innerHTML;
button.innerHTML = '<i class="fas fa-check"></i>';
button.classList.add('btn-success');
button.classList.remove('btn-outline-secondary');
setTimeout(() => {
button.innerHTML = originalHTML;
button.classList.remove('btn-success');
button.classList.add('btn-outline-secondary');
}, 2000);
}
function confirmDeactivate() {
if (confirm('{% trans "Are you sure you want to deactivate this access link? Agencies will no longer be able to use it." %}')) {
// Submit form to deactivate
window.location.href = '';
}
}
function confirmReactivate() {
if (confirm('{% trans "Are you sure you want to reactivate this access link?" %}')) {
// Submit form to reactivate
window.location.href = '';
}
}
document.addEventListener('DOMContentLoaded', function() {
// Set minimum datetime for new deadline
const deadlineInput = document.getElementById('new_deadline');
if (deadlineInput) {
const currentDeadline = new Date('{{ assignment.deadline_date|date:"Y-m-d\\TH:i" }}');
const now = new Date();
const minDateTime = new Date(Math.max(currentDeadline, now));
const localDateTime = new Date(minDateTime.getTime() - minDateTime.getTimezoneOffset() * 60000)
.toISOString()
.slice(0, 16);
deadlineInput.min = localDateTime;
deadlineInput.value = localDateTime;
}
});
</script> </script>
{% endblock %} {% endblock %}

View File

@ -165,7 +165,7 @@
<tr class="person-row"> <tr class="person-row">
<td> <td>
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="rounded-circle bg-primary text-white d-flex align-items-center justify-content-center me-2" <div class="rounded-circle bg-primary-theme text-white d-flex align-items-center justify-content-center me-2"
style="width: 32px; height: 32px; font-size: 14px; font-weight: 600;"> style="width: 32px; height: 32px; font-size: 14px; font-weight: 600;">
{{ person.first_name|first|upper }}{{ person.last_name|first|upper }} {{ person.first_name|first|upper }}{{ person.last_name|first|upper }}
</div> </div>
@ -178,7 +178,7 @@
</div> </div>
</td> </td>
<td> <td>
<a href="mailto:{{ person.email }}" class="text-decoration-none"> <a href="mailto:{{ person.email }}" class="text-decoration-none text-dark">
{{ person.email }} {{ person.email }}
</a> </a>
</td> </td>

View File

@ -185,7 +185,7 @@
<a href="{% url 'candidate_portal_dashboard' %}" class=" text-decoration-none text-secondary">{% trans "Dashboard" %}</a> <a href="{% url 'candidate_portal_dashboard' %}" class=" text-decoration-none text-secondary">{% trans "Dashboard" %}</a>
</li> </li>
<li class="breadcrumb-item"> <li class="breadcrumb-item">
<a href="{% url 'candidate_portal_dashboard' %}#applications" class="text-secondary text-decoration">{% trans "My Applications" %}</a> <a href="{% url 'candidate_portal_dashboard' %}#applications" class="text-secondary text-decoration-none">{% trans "My Applications" %}</a>
</li> </li>
<li class="breadcrumb-item active" aria-current="page" style=" <li class="breadcrumb-item active" aria-current="page" style="
color: #F43B5E; /* Rosy Accent Color */ color: #F43B5E; /* Rosy Accent Color */
@ -309,9 +309,10 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row mb-5"> <div class="row mb-5">
<div class="col-md-6 col-6"> <div class="col-md-6 col-6">
<a href="{% url 'candidate_portal_dashboard' %}" class="text-decoration-none text-dark">
<div class="kaauh-card h-50 shadow-sm action-card"> <div class="kaauh-card h-50 shadow-sm action-card">
<div class="card-body text-center mb-4"> <div class="card-body text-center mb-4">
<i class="fas fa-arrow-left fa-2x text-primary-theme mb-3"></i> <i class="fas fa-arrow-left fa-2x text-primary-theme mb-3"></i>
@ -322,16 +323,19 @@
</a> </a>
</div> </div>
</div> </div>
</a>
</div> </div>
{% if application.resume %} {% if application.resume %}
<div class="col-md-6 col-6"> <div class="col-md-6 col-6">
<a href="{{ application.resume.url }}"
target="_blank" class="text-decoration-none text-dark">
<div class="kaauh-card h-50 shadow-sm action-card"> <div class="kaauh-card h-50 shadow-sm action-card">
<div class="card-body text-center mb-4"> <div class="card-body text-center mb-4">
<i class="fas fa-file-download fa-2x text-success mb-3"></i> <i class="fas fa-file-download fa-2x text-success mb-3"></i>
<h6>{% trans "Download Resume" %}</h6> <h6>{% trans "Download Resume" %}</h6>
<p class="text-muted small">{% trans "Get your submitted file" %}</p> <p class="text-muted small">{% trans "Get your submitted file" %}</p>
<a href="{{ application.resume.url }}" <a href="{{ application.resume.url }}"
target="_blank" target="_blank"
class="btn btn-main-action btn-sm w-100"> class="btn btn-main-action btn-sm w-100">
<i class="fas fa-download me-2"></i> <i class="fas fa-download me-2"></i>
@ -339,9 +343,11 @@
</a> </a>
</div> </div>
</div> </div>
</a>
</div> </div>
{% endif %} {% endif %}
</div> </div>
@ -617,7 +623,7 @@
<input type="hidden" name="application_slug" value="{{ application.slug }}"> <input type="hidden" name="application_slug" value="{{ application.slug }}">
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{% trans "Cancel" %}</button> <button type="button" class="btn btn-outline-secondary btn-lg" data-bs-dismiss="modal">{% trans "Cancel" %}</button>
<button type="submit" class="btn btn-main-action"> <button type="submit" class="btn btn-main-action">
<i class="fas fa-upload me-2"></i> <i class="fas fa-upload me-2"></i>
{% trans "Upload" %} {% trans "Upload" %}

View File

@ -662,6 +662,7 @@
<i class="fas fa-eye me-1"></i> <i class="fas fa-eye me-1"></i>
{% trans "View Actual Resume" %} {% trans "View Actual Resume" %}
</a> {% endcomment %} </a> {% endcomment %}
<a href="{{ candidate.resume.url }}" download class="btn btn-outline-primary"> <a href="{{ candidate.resume.url }}" download class="btn btn-outline-primary">
<i class="fas fa-download me-1"></i> <i class="fas fa-download me-1"></i>
{% trans "Download Resume" %} {% trans "Download Resume" %}

View File

@ -395,15 +395,14 @@
{% endwith %} {% endwith %}
</td> </td>
<td class="text-center"> <td class="text-center">
<button type="button" <button type="button" class="btn btn-outline-secondary btn-sm"
class="btn btn-sm btn-main-action" data-bs-toggle="modal"
data-bs-toggle="modal" data-bs-target="#candidateviewModal"
data-bs-target="#documentModal" hx-get="{% url 'candidate_criteria_view_htmx' candidate.pk %}"
hx-get="{% url 'candidate_application_detail' candidate.slug %}" hx-target="#candidateviewModalBody"
hx-target="#documentModalBody" title="View Profile">
title="{% trans 'View Candidate Details' %}"> <i class="fas fa-eye ms-1"></i>
<i class="fas fa-eye me-1"></i> {% trans "View Details" %} </button>
</button>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
@ -419,30 +418,49 @@
</form> </form>
</div> </div>
<!-- Modal for viewing candidate details -->
<div class="modal fade modal-xl" id="documentModal" tabindex="-1" aria-labelledby="documentModalLabel" aria-hidden="true"> </div>
<div class="modal-dialog">
<div class="modal-content kaauh-card"> <div class="modal fade modal-xl" id="candidateviewModal" tabindex="-1" aria-labelledby="candidateviewModalLabel" aria-hidden="true">
<div class="modal-header" style="border-bottom: 1px solid var(--kaauh-border);"> <div class="modal-dialog">
<h5 class="modal-title" id="documentModalLabel" style="color: var(--kaauh-teal-dark);"> <div class="modal-content kaauh-card"> <div class="modal-header" style="border-bottom: 1px solid var(--kaauh-border);">
{% trans "Candidate Details" %} <h5 class="modal-title" id="candidateviewModalLabel" style="color: var(--kaauh-teal-dark);">
</h5> {% trans "Candidate Details / Bulk Action Form" %}
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </h5>
</div> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<div id="documentModalBody" class="modal-body"> </div>
<div class="text-center py-5 text-muted"> <div id="candidateviewModalBody" class="modal-body">
<i class="fas fa-spinner fa-spin fa-2x"></i><br> <div class="text-center py-5 text-muted">
{% trans "Loading candidate details..." %} <i class="fas fa-spinner fa-spin fa-2x"></i><br>
</div> {% trans "Loading content..." %}
</div>
<div class="modal-footer" style="border-top: 1px solid var(--kaauh-border);">
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">
{% trans "Close" %}
</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- Email Modal -->
<div class="modal fade" id="emailModal" tabindex="-1" aria-labelledby="emailModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content kaauh-card">
<div class="modal-header" style="border-bottom: 1px solid var(--kaauh-border);">
<h5 class="modal-title" id="emailModalLabel" style="color: var(--kaauh-teal-dark);">
<i class="fas fa-envelope me-2"></i>{% trans "Compose Email" %}
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div id="emailModalBody" class="modal-body">
<div class="text-center py-5 text-muted">
<i class="fas fa-spinner fa-spin fa-2x"></i><br>
{% trans "Loading email form..." %}
</div>
</div>
</div>
</div>
</div> </div>
{% endblock %} {% endblock %}
{% block customJS %} {% block customJS %}