kaauh_ats/templates/interviews/interview_detail.html
2025-12-24 15:25:37 +03:00

1094 lines
50 KiB
HTML

{% extends 'base.html' %}
{% load static i18n crispy_forms_tags %}
{% block title %}{{ schedule.application.name }} - {% trans "Interview Details" %} - ATS{% endblock %}
{% block customCSS %}
<style>
/* KAAT-S UI Variables */
:root {
--kaauh-teal: #00636e;
--kaauh-teal-dark: #004a53;
--kaauh-border: #eaeff3;
--kaauh-primary-text: #343a40;
--kaauh-success: #28a745;
--kaauh-info: #17a2b8;
--kaauh-danger: #dc3545;
--kaauh-warning: #ffc107;
}
/* Primary Color Overrides */
.text-primary-theme { color: var(--kaauh-teal) !important; }
.bg-primary-theme { background-color: var(--kaauh-teal) !important; }
/* Main Container & Card Styling */
.kaauh-card {
border: 1px solid var(--kaauh-border);
border-radius: 0.75rem;
box-shadow: 0 4px 12px rgba(0,0,0,0.06);
background-color: white;
}
/* Button Styling */
.btn-main-action {
background-color: var(--kaauh-teal);
border-color: var(--kaauh-teal);
color: white;
font-weight: 600;
transition: all 0.2s ease;
}
.btn-main-action:hover {
background-color: var(--kaauh-teal-dark);
border-color: var(--kaauh-teal-dark);
box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.btn-outline-secondary {
color: var(--kaauh-teal-dark);
border-color: var(--kaauh-teal);
}
.btn-outline-secondary:hover {
background-color: var(--kaauh-teal-dark);
color: white;
border-color: var(--kaauh-teal-dark);
}
/* Info Panel Styling */
.info-panel {
background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
border-left: 4px solid var(--kaauh-teal);
border-radius: 0.5rem;
padding: 1.5rem;
margin-bottom: 1.5rem;
}
.info-panel h5 {
color: var(--kaauh-teal-dark);
font-weight: 600;
margin-bottom: 1rem;
}
/* Status Badge Styling */
.status-badge {
font-size: 0.9rem;
padding: 0.4em 0.8em;
border-radius: 0.4rem;
font-weight: 700;
}
.interview-type-badge {
font-size: 0.8rem;
padding: 0.3rem 0.6rem;
border-radius: 0.3rem;
font-weight: 600;
}
/* Status Colors */
.bg-scheduled { background-color: #6c757d !important; color: white; }
.bg-confirmed { background-color: var(--kaauh-info) !important; color: white; }
.bg-cancelled { background-color: var(--kaauh-danger) !important; color: white; }
.bg-completed { background-color: var(--kaauh-success) !important; color: white; }
.bg-remote { background-color: #004a53 color: white; }
.bg-onsite { background-color: #00636e !important; color: white; }
/* Timeline Styling */
.timeline {
position: relative;
padding-left: 2rem;
}
.timeline::before {
content: '';
position: absolute;
left: 0.5rem;
top: 0;
bottom: 0;
width: 2px;
background-color: var(--kaauh-border);
}
.timeline-item {
position: relative;
margin-bottom: 1.5rem;
}
.timeline-item::before {
content: '';
position: absolute;
left: -1.5rem;
top: 0.5rem;
width: 12px;
height: 12px;
border-radius: 50%;
background-color: var(--kaauh-teal);
border: 2px solid white;
box-shadow: 0 0 0 2px var(--kaauh-border);
}
.timeline-content {
background-color: #f8f9fa;
padding: 1rem;
border-radius: 0.5rem;
border: 1px solid var(--kaauh-border);
}
/* Participant List */
.participant-item {
display: flex;
align-items: center;
padding: 0.75rem;
border-bottom: 1px solid var(--kaauh-border);
transition: background-color 0.2s ease;
}
.participant-item:hover {
background-color: #f8f9fa;
}
.participant-item:last-child {
border-bottom: none;
}
.participant-avatar {
width: 40px;
height: 40px;
border-radius: 50%;
background-color: var(--kaauh-teal);
color: white;
display: flex;
align-items: center;
justify-content: center;
font-weight: 600;
margin-right: 1rem;
}
/* Meeting Details */
.meeting-details {
background-color: #f8f9fa;
border-radius: 0.5rem;
padding: 1rem;
border: 1px solid var(--kaauh-border);
}
.meeting-details .detail-item {
display: flex;
justify-content: space-between;
padding: 0.5rem 0;
border-bottom: 1px solid #e9ecef;
}
.meeting-details .detail-item:last-child {
border-bottom: none;
}
.meeting-details .detail-label {
font-weight: 600;
color: var(--kaauh-primary-text);
}
.meeting-details .detail-value {
color: #6c757d;
}
/* Custom Height Optimization */
.form-control-sm,
.btn-sm {
padding-top: 0.2rem !important;
padding-bottom: 0.2rem !important;
height: 28px !important;
font-size: 0.8rem !important;
}
/* Action Buttons */
.action-buttons {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
}
/* AI Questions Styling */
.ai-question-item {
background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
border: 1px solid var(--kaauh-border);
border-radius: 0.75rem;
padding: 1.25rem;
margin-bottom: 1rem;
position: relative;
transition: all 0.3s ease;
}
.ai-question-item:hover {
box-shadow: 0 6px 16px rgba(0,0,0,0.08);
transform: translateY(-2px);
}
.ai-question-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 0.75rem;
}
.ai-question-badges {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
}
.ai-question-badge {
font-size: 0.75rem;
padding: 0.25rem 0.5rem;
border-radius: 0.25rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.badge-technical {
background-color: #e3f2fd;
color: #1976d2;
}
.badge-behavioral {
background-color: #f3e5f5;
color: #7b1fa2;
}
.badge-situational {
background-color: #e8f5e8;
color: #388e3c;
}
.badge-easy {
background-color: #e8f5e8;
color: #2e7d32;
}
.badge-medium {
background-color: #fff3e0;
color: #f57c00;
}
.badge-hard {
background-color: #ffebee;
color: #c62828;
}
.ai-question-text {
font-size: 1rem;
line-height: 1.6;
color: var(--kaauh-primary-text);
margin-bottom: 0.75rem;
font-weight: 500;
}
.ai-question-meta {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.85rem;
color: #6c757d;
border-top: 1px solid #e9ecef;
padding-top: 0.5rem;
}
.ai-question-category {
display: flex;
align-items: center;
gap: 0.25rem;
}
.ai-question-category i {
color: var(--kaauh-teal);
}
.ai-question-actions {
display: flex;
gap: 0.5rem;
}
.ai-question-actions button {
padding: 0.25rem 0.5rem;
font-size: 0.8rem;
border-radius: 0.25rem;
border: 1px solid var(--kaauh-border);
background-color: white;
color: var(--kaauh-primary-text);
transition: all 0.2s ease;
}
.ai-question-actions button:hover {
background-color: var(--kaauh-teal);
color: white;
border-color: var(--kaauh-teal);
}
.ai-questions-empty {
text-align: center;
padding: 3rem 1rem;
color: #6c757d;
}
.ai-questions-empty i {
color: var(--kaauh-teal);
opacity: 0.6;
margin-bottom: 1rem;
}
.ai-questions-loading {
text-align: center;
padding: 2rem;
}
.htmx-indicator {
opacity: 0;
transition: opacity 200ms ease-in;
}
.htmx-request .htmx-indicator {
opacity: 1;
}
/* Responsive adjustments */
@media (max-width: 768px) {
.action-buttons {
flex-direction: column;
}
.action-buttons .btn {
width: 100%;
}
.ai-question-header {
flex-direction: column;
align-items: flex-start;
gap: 0.5rem;
}
.ai-question-badges {
width: 100%;
}
.ai-question-meta {
flex-direction: column;
align-items: flex-start;
gap: 0.5rem;
}
}
</style>
{% endblock %}
{% block content %}
<div class="container-fluid py-4">
<div class="d-flex justify-content-between align-items-center mb-4">
<div>
<h1 class="h3 mb-1" style="color: var(--kaauh-teal-dark); font-weight: 700;">
<i class="fas fa-calendar-alt me-2"></i>
{% trans "Interview Details" %}
</h1>
<h2 class="h5 text-muted mb-0">
{{ schedule.application.name }} - {{ schedule.job.title }}
</h2>
</div>
<div class="d-flex gap-2">
<a href="{% url 'interview_list' %}" class="btn btn-outline-secondary">
<i class="fas fa-arrow-left me-1"></i> {% trans "Back to Interviews" %}
</a>
<a href="{% url 'job_detail' schedule.job.slug %}" class="btn btn-outline-secondary">
<i class="fas fa-briefcase me-1"></i> {% trans "View Job" %}
</a>
{% if schedule.status != 'cancelled' %}
<button type="button" class="btn btn-outline-secondary"
data-bs-toggle="modal"
data-bs-target="#statusModal">
<i class="fas fa-redo-alt me-1"></i> {% trans "Update Interview status" %}
</button>
{% endif %}
</div>
</div>
<div class="row">
<div class="col-lg-8">
<div class="kaauh-card shadow-sm p-4 mb-4">
<div class="d-flex align-items-start justify-content-between mb-3">
<h5 class="mb-0" style="color: var(--kaauh-teal-dark); font-weight: 600;">
<i class="fas fa-user me-2"></i> {% trans "Candidate Information" %}
</h5>
<div class="action-buttons">
{% if schedule.application.resume %}
<a href="{{ schedule.application.resume.url }}" class="btn btn-outline-primary btn-sm" target="_blank">
<i class="fas fa-download me-1"></i> {% trans "Download Resume" %}
</a>
{% endif %}
{% comment %} <button type="button" class="btn btn-outline-primary btn-sm"
data-bs-toggle="modal"
data-bs-target="#candidateModal"
hx-get="#"
hx-target="#candidateModalBody">
<i class="fas fa-eye me-1"></i> {% trans "AI Scoring" %}
</button> {% endcomment %}
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="info-panel">
<h6>{% trans "Personal Details" %}</h6>
<p class="mb-2"><strong>{% trans "Name:" %}</strong> {{ schedule.application.name }}</p>
<p class="mb-2"><strong>{% trans "Email:" %}</strong> {{ schedule.application.email }}</p>
<p class="mb-2"><strong>{% trans "Phone:" %}</strong> {{ schedule.application.phone }}</p>
{% if schedule.application.location %}
<p class="mb-0"><strong>{% trans "Location:" %}</strong> {{ schedule.application.location }}</p>
{% endif %}
</div>
</div>
<div class="col-md-6">
<div class="info-panel">
<h6>{% trans "Application Details" %}</h6>
<p class="mb-2"><strong>{% trans "Job:" %}</strong> {{ schedule.job.title }}</p>
<p class="mb-2"><strong>{% trans "Department:" %}</strong> {{ schedule.job.department }}</p>
<p class="mb-2"><strong>{% trans "Applied Date:" %}</strong> {{ schedule.application.created_at|date:"d-m-Y" }}</p>
<p class="mb-0"><strong>{% trans "Current Stage:" %}</strong>
<span class="badge stage-badge bg-primary-theme">
{{ interview.application.stage }}
<span class="badge stage-badge stage-{{ schedule.application.stage|lower }}">
{{ schedule.application.stage }}
</span>
</p>
</div>
</div>
</div>
</div>
<div class="kaauh-card shadow-sm p-4 mb-4">
<div class="d-flex align-items-center justify-content-between mb-3">
<h5 class="mb-0" style="color: var(--kaauh-teal-dark); font-weight: 600;">
<i class="fas fa-calendar-check me-2"></i> {% trans "Interview Details" %}
</h5>
<div class="d-flex gap-2">
<span class="bg-primary-theme badge status-badge text-white">
{{interview.location_type}}
</span>
<span class="badge status-badge
{% if schedule.status == 'scheduled' %}bg-scheduled
{% elif schedule.status == 'confirmed' %}bg-confirmed
{% elif schedule.status == 'cancelled' %}bg-cancelled
{% elif schedule.status == 'completed' %}bg-completed
{% endif %}">
{{ schedule.status }}
</span>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="meeting-details">
<div class="detail-item">
<span class="detail-label">{% trans "Date:" %}</span>
<span class="detail-value">{{ schedule.interview_date|date:"d-m-Y" }}</span>
</div>
<div class="detail-item">
<span class="detail-label">{% trans "Time:" %}</span>
<span class="detail-value">{{ schedule.interview_time|date:"h:i A" }}</span>
</div>
<div class="detail-item">
<span class="detail-label">{% trans "Duration:" %}</span>
<span class="detail-value">{{ interview.duration }} {% trans "minutes" %}</span>
</div>
<div class="detail-item">
<span class="detail-label">{% trans "Status:" %}</span>
<span class="detail-value">
<span class="badge bg-primary-theme">
{{ interview.status }}</span>
</span>
</div>
</div>
</div>
<div class="col-md-6">
{% if interview.location_type == 'Remote' %}
<div class="meeting-details">
<h6 class="mb-3">{% trans "Remote Meeting Details" %}</h6>
<div class="detail-item">
<span class="detail-label">{% trans "Platform:" %}</span>
<span class="detail-value">Zoom</span>
</div>
{% if schedule.interview %}
<div class="detail-item">
<span class="detail-label">{% trans "Meeting ID:" %}</span>
<span class="detail-value">{{ interview.meeting_id }}</span>
</div>
<div class="detail-item">
<span class="detail-label">{% trans "Password:" %}</span>
<span class="detail-value">{{ interview.password }}</span>
</div>
{% if interview.join_url %}
<div class="mt-3">
<a href="{{ interview.join_url }}"
target="_blank"
class="btn btn-main-action btn-sm w-100" id="joinMeetingLink">
<i class="fas fa-video me-1"></i> {% trans "Join Meeting" %}
</a>
<button onclick="copyJoinUrl()" class="btn btn-outline-secondary btn-sm mt-2 w-100">
{% trans "Copy & share Join URL" %}
</button>
</div>
<p id="copyMessage" style="color: green;"></p>
{% endif %}
{% endif %}
</div>
{% else %}
<div class="meeting-details">
<h6 class="mb-3">{% trans "Onsite Location Details" %}</h6>
{% if schedule.interview %}
<div class="detail-item">
<span class="detail-label">{% trans "Address:" %}</span>
<span class="detail-value">{{ interview.physical_address }}</span>
</div>
<div class="detail-item">
<span class="detail-label">{% trans "Room:" %}</span>
<span class="detail-value">{{ interview.room_number }}</span>
</div>
{% endif %}
</div>
{% endif %}
</div>
</div>
</div>
<!-- AI Generated Questions Section -->
<div class="kaauh-card shadow-sm p-4 mb-4">
<div class="d-flex align-items-center justify-content-between mb-3">
<h5 class="mb-0" style="color: var(--kaauh-teal-dark); font-weight: 600;">
<i class="fas fa-brain me-2"></i> {% trans "AI Generated Questions" %}
</h5>
<div class="d-flex gap-2">
<div class="dropdown">
<button class="btn btn-main-action btn-sm dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
<i class="fas fa-magic me-1"></i> {% trans "AI Actions" %}
</button>
<ul class="dropdown-menu dropdown-menu-end shadow-sm">
<li>
<div class="px-3 py-2 small text-muted" style="width: 220px;">
{% trans "This will use AI to generate questions based on the job description." %}
</div>
</li>
<li><hr class="dropdown-divider"></li>
<li>
<form action="{% url 'generate_ai_questions' schedule.slug %}" method="post" class="m-0">
{% csrf_token %}
<button type="submit" class="dropdown-item text-primary-theme fw-bold py-2">
<i class="fas fa-check-circle me-2"></i> {% trans "Confirm & Generate" %}
</button>
</form>
</li>
</ul>
</div>
</div>
</div>
<div class="accordion" id="aiQuestionsAccordion">
<div class="accordion-item">
<h2 class="accordion-header" id="aiQuestionsHeading">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#aiQuestionsCollapse" aria-expanded="false" aria-controls="aiQuestionsCollapse">
<span class="accordion-icon"></span>
<span class="accordion-header-text">{% trans "Interview Questions" %}</span>
</button>
</h2>
<div id="aiQuestionsCollapse" class="accordion-collapse collapse show" aria-labelledby="aiQuestionsHeading">
<div class="accordion-body table-view">
<div class="table-responsive d-none d-lg-block">
<table class="table table-hover align-middle mb-0 ">
<thead>
<tr>
<th scope="col">{% trans "Question" %}</th>
<th scope="col">{% trans "Type" %}</th>
<th scope="col">{% trans "Difficulty" %}</th>
<th scope="col">{% trans "Category" %}</th>
</tr>
</thead>
<tbody>
{% if LANGUAGE_CODE == "ar" %}
{% for question in schedule.interview_questions.ar %}
<tr>
<td class="text-break">
<span class="d-block" style="font-size: 0.8rem; color: #757575">{{ question.question_text }}</span>
</td>
<td class="text-center">
<span class="badge rounded-pill bg-primary-theme">{{ question.question_type|capfirst }}</span>
</td>
<td class="text-center">
<span class="badge rounded-pill bg-primary-theme">{{ question.difficulty_level|capfirst }}</span>
</td>
<td class="text-center">
<span class="badge rounded-pill bg-primary-theme">{{ question.category|capfirst }}</span>
</td>
</tr>
{% endfor %}
{% else %}
{% for question in schedule.interview_questions.en %}
<tr>
<td class="text-break">
<span class="d-block" style="font-size: 0.8rem; color: #757575">{{ question.question_text }}</span>
</td>
<td class="text-center">
<span class="badge rounded-pill bg-primary-theme">{{ question.question_type|capfirst }}</span>
</td>
<td class="text-center">
<span class="badge rounded-pill bg-primary-theme">{{ question.difficulty_level|capfirst }}</span>
</td>
<td class="text-center">
<span class="badge rounded-pill bg-primary-theme">{{ question.category|capfirst }}</span>
</td>
</tr>
{% endfor %}
{% endif %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Loading Spinners -->
{% comment %} <div class="text-center py-3" id="generateQuestionsSpinner" class="htmx-indicator d-none">
<div class="spinner-border text-primary" role="status">
<span class="visually-hidden">{% trans "Generating questions..." %}</span>
</div>
<p class="mt-2 text-muted">{% trans "AI is generating personalized interview questions..." %}</p>
</div>
<div class="text-center py-3" id="refreshQuestionsSpinner" class="htmx-indicator d-none">
<div class="spinner-border text-secondary" role="status">
<span class="visually-hidden">{% trans "Refreshing..." %}</span>
</div>
<p class="mt-2 text-muted">{% trans "Loading questions..." %}</p>
</div>
<!-- Questions Container -->
<div id="aiQuestionsContainer">
<div class="text-center py-4 text-muted">
<i class="fas fa-brain fa-2x mb-3"></i>
<p class="mb-0">{% trans "No AI questions generated yet. Click 'Generate Questions' to create personalized interview questions based on the candidate's profile and job requirements." %}</p>
</div>
</div> {% endcomment %}
</div>
<div class="kaauh-card shadow-sm p-4">
<h5 class="mb-3" style="color: var(--kaauh-teal-dark); font-weight: 600;">
<i class="fas fa-history me-2"></i> {% trans "Interview Timeline" %}
</h5>
<div class="timeline">
<div class="timeline-item">
<div class="timeline-content">
<div class="d-flex justify-content-between align-items-start">
<div>
<h6 class="mb-1">{% trans "Interview Scheduled" %}</h6>
<p class="mb-0 text-muted">{% trans "Interview was scheduled for" %} {{ schedule.interview_date|date:"d-m-Y" }} {{ schedule.interview_time|date:"h:i A" }}</p>
</div>
<small class="text-muted">{{ interview.created_at|date:"d-m-Y h:i A" }}</small>
</div>
</div>
</div>
{% if schedule.status == 'confirmed' %}
<div class="timeline-item">
<div class="timeline-content">
<div class="d-flex justify-content-between align-items-start">
<div>
<h6 class="mb-1">{% trans "Interview Confirmed" %}</h6>
<p class="mb-0 text-muted">{% trans "Candidate has confirmed attendance" %}</p>
</div>
</div>
</div>
</div>
{% endif %}
{% if schedule.status == 'completed' %}
<div class="timeline-item">
<div class="timeline-content">
<div class="d-flex justify-content-between align-items-start">
<div>
<h6 class="mb-1">{% trans "Interview Completed" %}</h6>
<p class="mb-0 text-muted">{% trans "Interview has been completed" %}</p>
</div>
</div>
</div>
</div>
{% endif %}
{% if schedule.status == 'cancelled' %}
<div class="timeline-item">
<div class="timeline-content">
<div class="d-flex justify-content-between align-items-start">
<div>
<h6 class="mb-1">{% trans "Interview Cancelled" %}</h6>
<p class="mb-0 text-muted">{% trans "Interview was cancelled on: " %}{{ schedule.cancelled_at|date:"d-m-Y" }} {{ schedule.cancelled_at|date:"h:i A" }}</p>
</div>
</div>
</div>
</div>
{% endif %}
</div>
</div>
</div>
<div class="col-lg-4">
<!-- Participants Panel -->
{% comment %} <div class="kaauh-card shadow-sm p-4 mb-4">
<h5 class="mb-3" style="color: var(--kaauh-teal-dark); font-weight: 600;">
<i class="fas fa-users me-2"></i> {% trans "Participants" %}
</h5>
<!-- Internal Participants -->
{% if schedule.participants.exists %}
<h6 class="mb-2 text-muted">{% trans "Internal Participants" %}</h6>
{% for participant in schedule.participants.all %}
<div class="participant-item">
<div class="participant-avatar">
{{ participant.first_name.0 }}{{ participant.last_name.0 }}
</div>
<div class="flex-grow-1">
<div class="fw-semibold">{{ participant.get_full_name }}</div>
<div class="text-muted small">{{ participant.email }}</div>
</div>
</div>
{% endfor %}
{% endif %}
<!-- External Participants -->
{% if schedule.system_users.exists %}
<h6 class="mb-2 mt-3 text-muted">{% trans "External Participants" %}</h6>
{% for user in schedule.system_users.all %}
<div class="participant-item">
<div class="participant-avatar">
{{ user.first_name.0 }}{{ user.last_name.0 }}
</div>
<div class="flex-grow-1">
<div class="fw-semibold">{{ user.get_full_name }}</div>
<div class="text-muted small">{{ user.email }}</div>
</div>
</div>
{% endfor %}
{% endif %}
{% if not schedule.participants.exists and not schedule.system_users.exists %}
<div class="text-center py-3 text-muted">
<i class="fas fa-users fa-2x mb-2"></i>
<p class="mb-0">{% trans "No participants added yet" %}</p>
</div>
{% endif %}
<button type="button" class="btn btn-outline-secondary btn-sm w-100 mt-3"
data-bs-toggle="modal"
data-bs-target="#participantModal">
<i class="fas fa-user-plus me-1"></i> {% trans "Add Participants" %}
</button>
</div> {% endcomment %}
<div class="kaauh-card shadow-sm p-4">
<h5 class="mb-3" style="color: var(--kaauh-teal-dark); font-weight: 600;">
<i class="fas fa-cog me-2"></i> {% trans "Actions" %}
</h5>
<div class="action-buttons">
{% if schedule.status != 'cancelled' and schedule.status != 'completed' %}
<button type="button" class="btn btn-main-action"
data-bs-toggle="modal"
data-bs-target="#rescheduleModal">
<i class="fas fa-redo-alt me-1"></i> {% trans "Reschedule" %}
</button>
<button type="button" class="btn btn-outline-danger"
data-bs-toggle="modal"
data-bs-target="#cancelModal">
<i class="fas fa-times me-1"></i> {% trans "Cancel" %}
</button>
{% endif %}
{% if schedule.status == 'cancelled' %}
<p class="text-danger">{% trans "This interview has been cancelled" %}</p>
{% endif %}
<hr class="w-100 mt-2 mb-2">
<button type="button" class="btn btn-outline-primary btn-sm w-100"
data-bs-toggle="modal"
data-bs-target="#emailModal">
<i class="fas fa-envelope me-1"></i> {% trans "Send Email" %}
</button>
{% if schedule.status == 'completed' %}
<button type="button" class="btn btn-outline-primary btn-sm w-100"
data-bs-toggle="modal"
data-bs-target="#resultModal">
<i class="fas fa-check-circle me-1"></i> {% trans "Update Result" %}
</button>
<div class="w-100 text-center">
{% if interview.interview_result %}
<div class="my-2">{% trans 'Interview Result : ' %}</div>
{% if interview.interview_result == 'passed' %}
<div class="card mb-3" style="max-width: 30rem;">
<div class="card-header text-white">
<!-- Status Badge as a Pill -->
<span class="badge rounded-pill bg-white text-primary-theme p-2">
<i class="fas fa-check-circle me-1"></i>
<strong>{{ interview.interview_result|upper }}</strong>
</span>
</div>
{% if interview.result_comments %}
<div class="card-body text-primary-theme">
<h5 class="card-title">{% trans 'Result Comment:' %}</h5>
<!-- The comment text with slightly adjusted margins -->
<p class="card-text text-dark">
{{ interview.result_comments }}
</p>
</div>
{% endif %}
</div>
{% elif interview.interview_result == 'failed' %}
<div class="card mb-3" style="max-width: 30rem;">
<div class="card-header text-white">
<!-- Status Badge as a Pill -->
<span class="badge rounded-pill bg-white text-danger p-2">
<i class="fas fa-check-circle me-1"></i>
<strong>{{ interview.interview_result|upper }}</strong>
</span>
</div>
{% if interview.result_comments %}
<div class="card-body text-danger">
<h5 class="card-title">{% trans 'Result Comment:' %}</h5>
<!-- The comment text with slightly adjusted margins -->
<p class="card-text text-dark">
{{ interview.result_comments }}
</p>
</div>
{% endif %}
</div>
{% else %}
<div class="card mb-3" style="max-width: 30rem;">
<div class="card-header text-white">
<!-- Status Badge as a Pill -->
<span class="badge rounded-pill bg-white text-primary-theme p-2">
<i class="fas fa-check-circle me-1"></i>
<strong>{{ interview.interview_result|upper }}</strong>
</span>
</div>
{% if interview.result_comments %}
<div class="card-body text-primary-theme">
<h5 class="card-title">{% trans 'Result Comment:' %}</h5>
<!-- The comment text with slightly adjusted margins -->
<p class="card-text text-dark">
{{ interview.result_comments }}
</p>
</div>
{% endif %}
</div>
{% endif %}
{% else %}
<span class="badge rounded-pill bg-secondary text-white">
{% trans "No Result Yet" %}
</span>
{% endif %}
</div>
{% endif %}
</div>
</div>
</div>
</div>
</div>
<div class="modal fade modal-xl" id="candidateModal" tabindex="-1" aria-labelledby="candidateModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content kaauh-card">
<div class="modal-header" style="border-bottom: 1px solid var(--kaauh-border);">
<h5 class="modal-title" id="candidateModalLabel" style="color: var(--kaauh-teal-dark);">
{% trans "Candidate Profile" %}
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div id="candidateModalBody" class="modal-body">
<div class="text-center py-5 text-muted">
<i class="fas fa-spinner fa-spin fa-2x"></i><br>
{% trans "Loading profile..." %}
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="participantModal" tabindex="-1" aria-labelledby="participantModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content kaauh-card">
<div class="modal-header" style="border-bottom: 1px solid var(--kaauh-border);">
<h5 class="modal-title" id="participantModalLabel" style="color: var(--kaauh-teal-dark);">
{% trans "Add Participants" %}
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form method="post" action="#">
{% csrf_token %}
<div class="mb-3">
<label for="internal_participants" class="form-label">{% trans "Internal Participants" %}</label>
<select multiple class="form-select" id="internal_participants" name="participants">
</select>
</div>
<div class="mb-3">
<label for="external_participants" class="form-label">{% trans "External Participants" %}</label>
<select multiple class="form-select" id="external_participants" name="system_users">
</select>
</div>
<button type="submit" class="btn btn-main-action btn-sm">
<i class="fas fa-plus me-1"></i> {% trans "Add Participants" %}
</button>
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" id="emailModal" tabindex="-1" aria-labelledby="emailModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<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 class="modal-body">
<form method="post" action="{% url 'send_interview_email' schedule.slug %}">
{% csrf_token %}
{{interview_email_form|crispy}}
<button type="submit" class="btn btn-main-action btn-sm">
<i class="fas fa-paper-plane me-1"></i> {% trans "Send Email" %}
</button>
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" id="rescheduleModal" tabindex="-1" aria-labelledby="rescheduleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content kaauh-card">
<div class="modal-header" style="border-bottom: 1px solid var(--kaauh-border);">
<h5 class="modal-title" id="rescheduleModalLabel" style="color: var(--kaauh-teal-dark);">
{% trans "Reschedule Interview" %}
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form method="post" action="{% url 'reschedule_meeting_for_application' schedule.slug %}">
{% csrf_token %}
{{reschedule_form|crispy}}
<button type="submit" class="btn btn-main-action btn-sm">
<i class="fas fa-redo-alt me-1"></i> {% trans "Reschedule" %}
</button>
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" id="cancelModal" tabindex="-1" aria-labelledby="cancelModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content kaauh-card">
<div class="modal-header" style="border-bottom: 1px solid var(--kaauh-border);">
<h5 class="modal-title" id="cancelModalLabel" style="color: var(--kaauh-teal-dark);">
{% trans "Cancel Interview" %}
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form method="post" action="{% url 'cancel_interview_for_application' schedule.slug %}">
{% csrf_token %}
{{ cancel_form|crispy }}
<div class="alert alert-warning">
<i class="fas fa-exclamation-triangle me-2"></i>
{% trans "Are you sure you want to cancel this interview? This action cannot be undone." %}
</div>
<div class="d-flex gap-2 justify-content-end">
<button type="button" class="btn btn-outline-secondary btn-sm" data-bs-dismiss="modal">
{% trans "Close" %}
</button>
<button type="submit" class="btn btn-danger btn-sm">
<i class="fas fa-times me-1"></i> {% trans "Cancel Interview" %}
</button>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" id="resultModal" tabindex="-1" aria-labelledby="resultModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content kaauh-card">
<div class="modal-header" style="border-bottom: 1px solid var(--kaauh-border);">
<h5 class="modal-title" id="resultModalLabel" style="color: var(--kaauh-teal-dark);">
{% trans "Update Interview Result" %}
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form method="post" action="{% url 'update_interview_result' interview.slug %}">
{% csrf_token %}
{{interview_result_form|crispy}}
<button type="submit" class="btn btn-main-action btn-sm mt-2">
<i class="fas fa-check me-1"></i> {% trans "Update Result" %}
</button>
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" id="statusModal" tabindex="-1" aria-labelledby="statusModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content kaauh-card">
<div class="modal-header" style="border-bottom: 1px solid var(--kaauh-border);">
<h5 class="modal-title" id="statusModalLabel" style="color: var(--kaauh-teal-dark);">
<i class="fas fa-sync-alt me-2"></i> {% trans "Update Interview Status" %}
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form method="post" action="{% url 'update_interview_status' schedule.slug %}">
{% csrf_token %}
{{ interview_status_form|crispy }}
<div class="d-flex gap-2 mt-3 justify-content-end">
<button type="button" class="btn btn-outline-secondary btn-sm" data-bs-dismiss="modal">
{% trans "Close" %}
</button>
<button type="submit" class="btn btn-main-action btn-sm">
<i class="fas fa-check me-1"></i> {% trans "Update Status" %}
</button>
</div>
</form>
</div>
</div>
</div>
</div>
{% endblock %}
{% block customJS %}
<script>
document.addEventListener('DOMContentLoaded', function () {
// Clear modal content when hidden
const modals = ['candidateModal', 'participantModal', 'emailModal', 'rescheduleModal', 'cancelModal', 'resultModal', 'statusModal'];
modals.forEach(modalId => {
const modal = document.getElementById(modalId);
if (modal) {
modal.addEventListener('hidden.bs.modal', function () {
const modalBody = modal.querySelector('.modal-body');
if (modalBody && modalId === 'candidateModal') {
// Reset content for AJAX-loaded Candidate Modal
modalBody.innerHTML = `
<div class="text-center py-5 text-muted">
<i class="fas fa-spinner fa-spin fa-2x"></i><br>
{% trans "Loading profile..." %}
</div>
`;
}
});
}
});
});
//COPY TO Clipboard ZOOM LINK
async function copyJoinUrl(){
const joinUrlElement=document.getElementById('joinMeetingLink');
const urlToCopy=joinUrlElement.href;
const messageElement=document.getElementById('copyMessage');
console.log(urlToCopy)
try{
await navigator.clipboard.writeText(urlToCopy);
messageElement.textContent='Join URL copied successfully!';
setTimeout(()=>{
messageElement.textContent='';
},
3000
);
console.log('URL copied:', urlToCopy);
}
catch(e){
messageElement.textContent='Failed to copy Join URL.';
console.error('could not copy the URL',e);
}
}
</script>
{% endblock %}