update for job and candidtes stage
This commit is contained in:
parent
9a768726e5
commit
c13450ae83
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -234,12 +234,12 @@ class JobPostingForm(forms.ModelForm):
|
||||
'value': 'United States'
|
||||
}),
|
||||
|
||||
|
||||
|
||||
'salary_range': forms.TextInput(attrs={
|
||||
'class': 'form-control',
|
||||
'placeholder': '$60,000 - $80,000'
|
||||
}),
|
||||
|
||||
|
||||
|
||||
# Application Information
|
||||
# 'application_url': forms.URLInput(attrs={
|
||||
@ -251,7 +251,7 @@ class JobPostingForm(forms.ModelForm):
|
||||
'class': 'form-control',
|
||||
'type': 'date'
|
||||
}),
|
||||
|
||||
|
||||
'open_positions': forms.NumberInput(attrs={
|
||||
'class': 'form-control',
|
||||
'min': 1,
|
||||
@ -479,4 +479,12 @@ class JobPostingStatusForm(forms.ModelForm):
|
||||
class FormTemplateIsActiveForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = FormTemplate
|
||||
fields = ['is_active']
|
||||
fields = ['is_active']
|
||||
|
||||
class CandidateExamDateForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Candidate
|
||||
fields = ['exam_date']
|
||||
widgets = {
|
||||
'exam_date': forms.DateTimeInput(attrs={'type': 'datetime-local', 'class': 'form-control'}),
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
# Generated by Django 5.2.6 on 2025-10-12 12:15
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('recruitment', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='candidate',
|
||||
name='is_potential_candidate',
|
||||
field=models.BooleanField(default=False, verbose_name='Potential Candidate'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='jobposting',
|
||||
name='status',
|
||||
field=models.CharField(choices=[('DRAFT', 'Draft'), ('ACTIVE', 'Active'), ('CLOSED', 'Closed'), ('CANCELLED', 'Cancelled'), ('ARCHIVED', 'Archived')], default='DRAFT', max_length=20),
|
||||
),
|
||||
]
|
||||
18
recruitment/migrations/0003_alter_candidate_exam_date.py
Normal file
18
recruitment/migrations/0003_alter_candidate_exam_date.py
Normal file
@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.2.6 on 2025-10-12 15:57
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('recruitment', '0002_candidate_is_potential_candidate_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='candidate',
|
||||
name='exam_date',
|
||||
field=models.DateTimeField(blank=True, null=True, verbose_name='Exam Date'),
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.2.6 on 2025-10-12 15:57
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('recruitment', '0003_alter_candidate_exam_date'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='candidate',
|
||||
name='interview_date',
|
||||
field=models.DateTimeField(blank=True, null=True, verbose_name='Interview Date'),
|
||||
),
|
||||
]
|
||||
@ -294,6 +294,9 @@ class Candidate(Base):
|
||||
is_resume_parsed = models.BooleanField(
|
||||
default=False, verbose_name=_("Resume Parsed")
|
||||
)
|
||||
is_potential_candidate = models.BooleanField(
|
||||
default=False, verbose_name=_("Potential Candidate")
|
||||
)
|
||||
parsed_summary = models.TextField(blank=True, verbose_name=_("Parsed Summary"))
|
||||
applied = models.BooleanField(default=False, verbose_name=_("Applied"))
|
||||
stage = models.CharField(
|
||||
@ -310,7 +313,7 @@ class Candidate(Base):
|
||||
blank=True,
|
||||
verbose_name=_("Applicant Status"),
|
||||
)
|
||||
exam_date = models.DateField(null=True, blank=True, verbose_name=_("Exam Date"))
|
||||
exam_date = models.DateTimeField(null=True, blank=True, verbose_name=_("Exam Date"))
|
||||
exam_status = models.CharField(
|
||||
choices=ExamStatus.choices,
|
||||
max_length=100,
|
||||
@ -318,7 +321,7 @@ class Candidate(Base):
|
||||
blank=True,
|
||||
verbose_name=_("Exam Status"),
|
||||
)
|
||||
interview_date = models.DateField(
|
||||
interview_date = models.DateTimeField(
|
||||
null=True, blank=True, verbose_name=_("Interview Date")
|
||||
)
|
||||
interview_status = models.CharField(
|
||||
|
||||
@ -64,8 +64,15 @@ urlpatterns = [
|
||||
path('forms/builder/<int:template_id>/', views.form_builder, name='form_builder'),
|
||||
path('forms/', views.form_templates_list, name='form_templates_list'),
|
||||
path('forms/create-template/', views.create_form_template, name='create_form_template'),
|
||||
|
||||
path('jobs/<slug:slug>/candidate-tiers/', views.candidate_tier_management_view, name='candidate_tier_management'),
|
||||
path('jobs/<slug:slug>/candidate_exam_view/', views.candidate_exam_view, name='candidate_exam_view'),
|
||||
path('jobs/<slug:slug>/update_candidate_exam_status/', views.update_candidate_exam_status, name='update_candidate_exam_status'),
|
||||
path('jobs/<slug:slug>/bulk_update_candidate_exam_status/', views.bulk_update_candidate_exam_status, name='bulk_update_candidate_exam_status'),
|
||||
|
||||
path('htmx/<int:pk>/candidate_criteria_view/', views.candidate_criteria_view_htmx, name='candidate_criteria_view_htmx'),
|
||||
path('htmx/<slug:slug>/candidate_set_exam_date/', views.candidate_set_exam_date, name='candidate_set_exam_date'),
|
||||
path('htmx/bulk_candidate_move_to_exam/', views.bulk_candidate_move_to_exam, name='bulk_candidate_move_to_exam'),
|
||||
|
||||
# path('forms/form/<int:template_id>/submit/', views.submit_form, name='submit_form'),
|
||||
# path('forms/form/<int:template_id>/', views.form_wizard_view, name='form_wizard'),
|
||||
|
||||
@ -12,6 +12,7 @@ from django.urls import reverse
|
||||
from django.conf import settings
|
||||
from django.utils import timezone
|
||||
from .forms import (
|
||||
CandidateExamDateForm,
|
||||
ZoomMeetingForm,
|
||||
JobPostingForm,
|
||||
FormTemplateForm,
|
||||
@ -216,7 +217,7 @@ def create_job(request):
|
||||
job.created_by = request.POST.get("created_by", "").strip()
|
||||
if not job.created_by:
|
||||
job.created_by = "University Administrator"
|
||||
|
||||
|
||||
job.save()
|
||||
job_apply_url_relative=reverse('job_detail_candidate',kwargs={'slug':job.slug})
|
||||
job_apply_url_absolute=request.build_absolute_uri(job_apply_url_relative)
|
||||
@ -273,7 +274,7 @@ def edit_job(request, slug):
|
||||
def job_detail(request, slug):
|
||||
"""View details of a specific job"""
|
||||
job = get_object_or_404(JobPosting, slug=slug)
|
||||
|
||||
|
||||
|
||||
# Get all candidates for this job, ordered by most recent
|
||||
candidates = job.candidates.all().order_by("-created_at")
|
||||
@ -289,22 +290,22 @@ def job_detail(request, slug):
|
||||
|
||||
# 2. Check for POST request (Status Update Submission)
|
||||
if request.method == 'POST':
|
||||
|
||||
|
||||
status_form = JobPostingStatusForm(request.POST, instance=job)
|
||||
|
||||
|
||||
if status_form.is_valid():
|
||||
status_form.save()
|
||||
|
||||
|
||||
# Add a success message
|
||||
messages.success(request, f"Status for '{job.title}' updated to '{job.get_status_display()}' successfully!")
|
||||
|
||||
|
||||
|
||||
|
||||
return redirect('job_detail', slug=slug)
|
||||
else:
|
||||
|
||||
|
||||
messages.error(request, "Failed to update status due to validation errors.")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
context = {
|
||||
"job": job,
|
||||
@ -325,15 +326,15 @@ def job_image_upload(request, slug):
|
||||
image_upload_form=JobPostingImageForm(request.POST,request.FILES)
|
||||
if image_upload_form.is_valid():
|
||||
image_upload_form = image_upload_form.save(commit=False)
|
||||
|
||||
|
||||
image_upload_form.job = job
|
||||
image_upload_form.save()
|
||||
messages.success(request, f"Image uploaded successfully for {job.title}.")
|
||||
return redirect('job_detail', slug=job.slug)
|
||||
else:
|
||||
|
||||
|
||||
messages.error(request, "Image upload failed: Please ensure a valid image file was selected.")
|
||||
|
||||
|
||||
return redirect('job_detail', slug=job.slug)
|
||||
return redirect('job_detail', slug=job.slug)
|
||||
|
||||
@ -1226,102 +1227,102 @@ def candidate_tier_management_view(request, slug):
|
||||
job = get_object_or_404(JobPosting, slug=slug)
|
||||
|
||||
# Get all candidates for this job, ordered by match score (descending)
|
||||
candidates = job.candidates.all().order_by("-match_score")
|
||||
candidates = job.candidates.filter(stage="Applied").order_by("-match_score")
|
||||
|
||||
# Get tier categorization parameters
|
||||
tier1_count = int(request.GET.get("tier1_count", 100))
|
||||
# tier1_count = int(request.GET.get("tier1_count", 100))
|
||||
|
||||
# Categorize candidates into tiers
|
||||
tier1_candidates = candidates[:tier1_count] if tier1_count > 0 else []
|
||||
remaining_candidates = candidates[tier1_count:] if tier1_count > 0 else []
|
||||
# # Categorize candidates into tiers
|
||||
# tier1_candidates = candidates[:tier1_count] if tier1_count > 0 else []
|
||||
# remaining_candidates = candidates[tier1_count:] if tier1_count > 0 else []
|
||||
|
||||
if len(remaining_candidates) > 0:
|
||||
# Tier 2: Next 50% of remaining candidates
|
||||
tier2_count = max(1, len(remaining_candidates) // 2)
|
||||
tier2_candidates = remaining_candidates[:tier2_count]
|
||||
tier3_candidates = remaining_candidates[tier2_count:]
|
||||
else:
|
||||
tier2_candidates = []
|
||||
tier3_candidates = []
|
||||
# if len(remaining_candidates) > 0:
|
||||
# # Tier 2: Next 50% of remaining candidates
|
||||
# tier2_count = max(1, len(remaining_candidates) // 2)
|
||||
# tier2_candidates = remaining_candidates[:tier2_count]
|
||||
# tier3_candidates = remaining_candidates[tier2_count:]
|
||||
# else:
|
||||
# tier2_candidates = []
|
||||
# tier3_candidates = []
|
||||
|
||||
# Handle form submissions
|
||||
if request.method == "POST":
|
||||
# Update tier categorization
|
||||
if "update_tiers" in request.POST:
|
||||
tier1_count = int(request.POST.get("tier1_count", 100))
|
||||
messages.success(request, f"Tier categorization updated. Tier 1: {tier1_count} candidates")
|
||||
return redirect("candidate_tier_management", slug=slug)
|
||||
# # Handle form submissions
|
||||
# if request.method == "POST":
|
||||
# # Update tier categorization
|
||||
# if "update_tiers" in request.POST:
|
||||
# tier1_count = int(request.POST.get("tier1_count", 100))
|
||||
# messages.success(request, f"Tier categorization updated. Tier 1: {tier1_count} candidates")
|
||||
# return redirect("candidate_tier_management", slug=slug)
|
||||
|
||||
# Update individual candidate stages
|
||||
elif "update_stage" in request.POST:
|
||||
candidate_id = request.POST.get("candidate_id")
|
||||
new_stage = request.POST.get("new_stage")
|
||||
candidate = get_object_or_404(Candidate, id=candidate_id, job=job)
|
||||
# # Update individual candidate stages
|
||||
# elif "update_stage" in request.POST:
|
||||
# candidate_id = request.POST.get("candidate_id")
|
||||
# new_stage = request.POST.get("new_stage")
|
||||
# candidate = get_object_or_404(Candidate, id=candidate_id, job=job)
|
||||
|
||||
if candidate.can_transition_to(new_stage):
|
||||
old_stage = candidate.stage
|
||||
candidate.stage = new_stage
|
||||
candidate.save()
|
||||
messages.success(request, f"Updated {candidate.name} from {old_stage} to {new_stage}")
|
||||
else:
|
||||
messages.error(request, f"Cannot transition {candidate.name} from {candidate.stage} to {new_stage}")
|
||||
# if candidate.can_transition_to(new_stage):
|
||||
# old_stage = candidate.stage
|
||||
# candidate.stage = new_stage
|
||||
# candidate.save()
|
||||
# messages.success(request, f"Updated {candidate.name} from {old_stage} to {new_stage}")
|
||||
# else:
|
||||
# messages.error(request, f"Cannot transition {candidate.name} from {candidate.stage} to {new_stage}")
|
||||
|
||||
# Update exam status
|
||||
elif "update_exam_status" in request.POST:
|
||||
candidate_id = request.POST.get("candidate_id")
|
||||
exam_status = request.POST.get("exam_status")
|
||||
exam_date = request.POST.get("exam_date")
|
||||
candidate = get_object_or_404(Candidate, id=candidate_id, job=job)
|
||||
# # Update exam status
|
||||
# elif "update_exam_status" in request.POST:
|
||||
# candidate_id = request.POST.get("candidate_id")
|
||||
# exam_status = request.POST.get("exam_status")
|
||||
# exam_date = request.POST.get("exam_date")
|
||||
# candidate = get_object_or_404(Candidate, id=candidate_id, job=job)
|
||||
|
||||
if candidate.stage == "Exam":
|
||||
candidate.exam_status = exam_status
|
||||
if exam_date:
|
||||
candidate.exam_date = exam_date
|
||||
candidate.save()
|
||||
messages.success(request, f"Updated exam status for {candidate.name}")
|
||||
else:
|
||||
messages.error(request, f"Can only update exam status for candidates in Exam stage")
|
||||
# if candidate.stage == "Exam":
|
||||
# candidate.exam_status = exam_status
|
||||
# if exam_date:
|
||||
# candidate.exam_date = exam_date
|
||||
# candidate.save()
|
||||
# messages.success(request, f"Updated exam status for {candidate.name}")
|
||||
# else:
|
||||
# messages.error(request, f"Can only update exam status for candidates in Exam stage")
|
||||
|
||||
# Bulk stage update
|
||||
elif "bulk_update_stage" in request.POST:
|
||||
selected_candidates = request.POST.getlist("selected_candidates")
|
||||
new_stage = request.POST.get("bulk_new_stage")
|
||||
updated_count = 0
|
||||
# # Bulk stage update
|
||||
# elif "bulk_update_stage" in request.POST:
|
||||
# selected_candidates = request.POST.getlist("selected_candidates")
|
||||
# new_stage = request.POST.get("bulk_new_stage")
|
||||
# updated_count = 0
|
||||
|
||||
for candidate_id in selected_candidates:
|
||||
candidate = get_object_or_404(Candidate, id=candidate_id, job=job)
|
||||
if candidate.can_transition_to(new_stage):
|
||||
candidate.stage = new_stage
|
||||
candidate.save()
|
||||
updated_count += 1
|
||||
# for candidate_id in selected_candidates:
|
||||
# candidate = get_object_or_404(Candidate, id=candidate_id, job=job)
|
||||
# if candidate.can_transition_to(new_stage):
|
||||
# candidate.stage = new_stage
|
||||
# candidate.save()
|
||||
# updated_count += 1
|
||||
|
||||
messages.success(request, f"Updated {updated_count} candidates to {new_stage} stage")
|
||||
# messages.success(request, f"Updated {updated_count} candidates to {new_stage} stage")
|
||||
|
||||
# Mark individual candidate as Candidate
|
||||
elif "mark_as_candidate" in request.POST:
|
||||
candidate_id = request.POST.get("candidate_id")
|
||||
candidate = get_object_or_404(Candidate, id=candidate_id, job=job)
|
||||
# # Mark individual candidate as Candidate
|
||||
# elif "mark_as_candidate" in request.POST:
|
||||
# candidate_id = request.POST.get("candidate_id")
|
||||
# candidate = get_object_or_404(Candidate, id=candidate_id, job=job)
|
||||
|
||||
if candidate.applicant_status == "Applicant":
|
||||
candidate.applicant_status = "Candidate"
|
||||
candidate.save()
|
||||
messages.success(request, f"Marked {candidate.name} as Candidate")
|
||||
else:
|
||||
messages.info(request, f"{candidate.name} is already marked as Candidate")
|
||||
# if candidate.applicant_status == "Applicant":
|
||||
# candidate.applicant_status = "Candidate"
|
||||
# candidate.save()
|
||||
# messages.success(request, f"Marked {candidate.name} as Candidate")
|
||||
# else:
|
||||
# messages.info(request, f"{candidate.name} is already marked as Candidate")
|
||||
|
||||
# Mark all Tier 1 candidates as Candidates
|
||||
elif "mark_as_candidates" in request.POST:
|
||||
updated_count = 0
|
||||
for candidate in tier1_candidates:
|
||||
if candidate.applicant_status == "Applicant":
|
||||
candidate.applicant_status = "Candidate"
|
||||
candidate.save()
|
||||
updated_count += 1
|
||||
# # Mark all Tier 1 candidates as Candidates
|
||||
# elif "mark_as_candidates" in request.POST:
|
||||
# updated_count = 0
|
||||
# for candidate in tier1_candidates:
|
||||
# if candidate.applicant_status == "Applicant":
|
||||
# candidate.applicant_status = "Candidate"
|
||||
# candidate.save()
|
||||
# updated_count += 1
|
||||
|
||||
if updated_count > 0:
|
||||
messages.success(request, f"Marked {updated_count} Tier 1 candidates as Candidates")
|
||||
else:
|
||||
messages.info(request, "All Tier 1 candidates are already marked as Candidates")
|
||||
# if updated_count > 0:
|
||||
# messages.success(request, f"Marked {updated_count} Tier 1 candidates as Candidates")
|
||||
# else:
|
||||
# messages.info(request, "All Tier 1 candidates are already marked as Candidates")
|
||||
|
||||
# Group candidates by current stage for display
|
||||
stage_groups = {
|
||||
@ -1333,17 +1334,75 @@ def candidate_tier_management_view(request, slug):
|
||||
|
||||
context = {
|
||||
"job": job,
|
||||
"tier1_candidates": tier1_candidates,
|
||||
"tier2_candidates": tier2_candidates,
|
||||
"tier3_candidates": tier3_candidates,
|
||||
"stage_groups": stage_groups,
|
||||
"tier1_count": tier1_count,
|
||||
"total_candidates": candidates.count(),
|
||||
"candidates": candidates,
|
||||
# "stage_groups": stage_groups,
|
||||
# "tier1_count": tier1_count,
|
||||
# "total_candidates": candidates.count(),
|
||||
}
|
||||
|
||||
return render(request, "recruitment/candidate_tier_management.html", context)
|
||||
|
||||
|
||||
def candidate_exam_view(request, slug):
|
||||
"""
|
||||
Manage candidate tiers and stage transitions
|
||||
"""
|
||||
job = get_object_or_404(JobPosting, slug=slug)
|
||||
candidates = job.candidates.filter(stage="Exam").order_by("-match_score")
|
||||
|
||||
return render(request, "recruitment/candidate_exam_view.html", {"job": job, "candidates": candidates})
|
||||
|
||||
def update_candidate_exam_status(request, slug):
|
||||
candidate = get_object_or_404(Candidate, slug=slug)
|
||||
if request.method == "POST":
|
||||
form = CandidateExamDateForm(request.POST, instance=candidate)
|
||||
if form.is_valid():
|
||||
form.save()
|
||||
return redirect("candidate_exam_view", slug=candidate.job.slug)
|
||||
else:
|
||||
form = CandidateExamDateForm(request.POST, instance=candidate)
|
||||
return render(request, "includes/candidate_exam_status_form.html", {"candidate": candidate,"form": form})
|
||||
def bulk_update_candidate_exam_status(request,slug):
|
||||
job = get_object_or_404(JobPosting, slug=slug)
|
||||
print(request.headers)
|
||||
status = request.headers.get('status')
|
||||
print(status)
|
||||
if status:
|
||||
for c in request.POST.items():
|
||||
try:
|
||||
candidate = Candidate.objects.get(pk=c[0])
|
||||
candidate.exam_status = "Passed" if status == "pass" else "Failed"
|
||||
candidate.stage = "Interview"
|
||||
candidate.save()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
messages.success(request, f"Updated exam status selected candidates")
|
||||
return redirect("candidate_exam_view", slug=job.slug)
|
||||
|
||||
def candidate_criteria_view_htmx(request, pk):
|
||||
candidate = get_object_or_404(Candidate, pk=pk)
|
||||
print(candidate)
|
||||
return render(request, "includes/candidate_modal_body.html", {"candidate": candidate})
|
||||
return render(request, "includes/candidate_modal_body.html", {"candidate": candidate})
|
||||
|
||||
|
||||
def candidate_set_exam_date(request, slug):
|
||||
candidate = get_object_or_404(Candidate, slug=slug)
|
||||
candidate.exam_date = timezone.now()
|
||||
candidate.save()
|
||||
messages.success(request, f"Set exam date for {candidate.name} to {candidate.exam_date}")
|
||||
return redirect("candidate_tier_management", slug=candidate.job.slug)
|
||||
def bulk_candidate_move_to_exam(request):
|
||||
for c in request.POST.items():
|
||||
try:
|
||||
candidate = Candidate.objects.get(pk=c[0])
|
||||
candidate.stage = "Exam"
|
||||
candidate.applicant_status = "Candidate"
|
||||
candidate.exam_date = timezone.now()
|
||||
candidate.save()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
messages.success(request, f"Moved {candidate.name} to Exam stage")
|
||||
return redirect("candidate_tier_management", slug=candidate.job.slug)
|
||||
# def response():
|
||||
# yield SSE.patch_elements("","")
|
||||
# yield SSE.execute_script("console.log('hello world');")
|
||||
# return DatastarResponse(response())
|
||||
@ -21,7 +21,7 @@
|
||||
--kaauh-light-bg: #f9fbfd;
|
||||
--kaauh-border: #eaeff3;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* === Top Bar === */
|
||||
.top-bar {
|
||||
@ -232,7 +232,7 @@
|
||||
</style>
|
||||
{% block customCSS %}{% endblock %}
|
||||
</head>
|
||||
<body class="d-flex flex-column min-vh-100">
|
||||
<body class="d-flex flex-column min-vh-100" hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
|
||||
|
||||
<div class="top-bar d-none d-md-block">
|
||||
<div class="container d-flex justify-content-between align-items-center gap-2">
|
||||
@ -327,7 +327,7 @@
|
||||
|
||||
{% trans "Form Templates" %}
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown ms-2">
|
||||
@ -357,9 +357,9 @@
|
||||
<span class="d-none d-lg-inline">{{ LANGUAGE_CODE|upper }}</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end" data-bs-popper="static">
|
||||
|
||||
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
|
||||
|
||||
<li>
|
||||
<form action="{% url 'set_language' %}" method="post" class="d-inline">{% csrf_token %}
|
||||
<input name="next" type="hidden" value="{{ request.get_full_path }}">
|
||||
@ -368,7 +368,7 @@
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<form action="{% url 'set_language' %}" method="post" class="d-inline">{% csrf_token %}
|
||||
<input name="next" type="hidden" value="{{ request.get_full_path }}">
|
||||
@ -443,13 +443,13 @@
|
||||
</li>
|
||||
</ul>
|
||||
{% else %}
|
||||
<i class="fab fa-linkedin text-primary me-1"></i>
|
||||
<i class="fab fa-linkedin text-primary me-1"></i>
|
||||
<span class="text-primary d-none d-lg-inline ms-auto me-3">
|
||||
{% trans "LinkedIn Connected" %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</a></li>
|
||||
|
||||
</a></li>
|
||||
|
||||
<li><hr class="dropdown-divider my-1"></li>
|
||||
<li>
|
||||
<form method="post" action="" class="d-inline">
|
||||
@ -543,7 +543,8 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.5/bundles/datastar.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.7/dist/htmx.min.js"></script>
|
||||
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.5/bundles/datastar.js"></script>
|
||||
|
||||
{% block customJS %}{% endblock %}
|
||||
|
||||
|
||||
7
templates/includes/candidate_exam_status_form.html
Normal file
7
templates/includes/candidate_exam_status_form.html
Normal file
@ -0,0 +1,7 @@
|
||||
{% load i18n %}
|
||||
{% url 'update_candidate_exam_status' slug=candidate.slug as url %}
|
||||
<form data-on-submit="@post('{{url}}', {contentType: 'form', headers: {'X-CSRFToken': '{{ csrf_token }}'}})">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-primary">{% trans "Update" %}</button>
|
||||
</form>
|
||||
@ -14,7 +14,11 @@
|
||||
{% for key, value in candidate.criteria_checklist.items %}
|
||||
<li class="list-group-item d-flex justify-content-between">
|
||||
<span>{{ key }}</span>
|
||||
<span class="badge bg-{{ value|yesno:"success,danger" }}">{{ value|yesno:"Yes,No" }}</span>
|
||||
{% if value == 'Met' %}
|
||||
<span class="badge bg-success">Yes</span>
|
||||
{% else %}
|
||||
<span class="badge bg-danger">Not Mentioned</span>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
363
templates/recruitment/candidate_exam_view.html
Normal file
363
templates/recruitment/candidate_exam_view.html
Normal file
@ -0,0 +1,363 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load static i18n %}
|
||||
|
||||
{% block title %}Candidate Tier Management - {{ job.title }} - ATS{% endblock %}
|
||||
|
||||
{% block customCSS %}
|
||||
<style>
|
||||
/* Minimal Tier Management Styles */
|
||||
.tier-controls {
|
||||
background-color: #f8f9fa;
|
||||
padding: 1rem;
|
||||
border-radius: 0.375rem;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
.tier-controls .form-row {
|
||||
display: flex;
|
||||
align-items: end;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
.tier-controls .form-group {
|
||||
flex: 1;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.bulk-update-controls {
|
||||
background-color: #f8f9fa;
|
||||
padding: 1rem;
|
||||
border-radius: 0.375rem;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
.stage-groups {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||
gap: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
.stage-group {
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 0.375rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
.stage-group .stage-header {
|
||||
background-color: #495057;
|
||||
color: white;
|
||||
padding: 0.5rem 0.75rem;
|
||||
font-weight: 500;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
.stage-group .stage-body {
|
||||
padding: 0.75rem;
|
||||
min-height: 80px;
|
||||
}
|
||||
.stage-candidate {
|
||||
padding: 0.375rem;
|
||||
border-bottom: 1px solid #f1f3f4;
|
||||
}
|
||||
.stage-candidate:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.match-score {
|
||||
font-weight: 600;
|
||||
color: #0056b3;
|
||||
}
|
||||
.btn-sm {
|
||||
font-size: 0.75rem;
|
||||
padding: 0.2rem 0.4rem;
|
||||
}
|
||||
|
||||
/* Tab Styles for Tiers */
|
||||
.nav-tabs {
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.nav-tabs .nav-link {
|
||||
border: none;
|
||||
color: #495057;
|
||||
font-weight: 500;
|
||||
padding: 0.5rem 1rem;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.nav-tabs .nav-link:hover {
|
||||
border: none;
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
.nav-tabs .nav-link.active {
|
||||
color: #495057;
|
||||
background-color: #fff;
|
||||
border: none;
|
||||
border-bottom: 2px solid #007bff;
|
||||
font-weight: 600;
|
||||
}
|
||||
.tier-1 .nav-link {
|
||||
color: #155724;
|
||||
}
|
||||
.tier-1 .nav-link.active {
|
||||
border-bottom-color: #28a745;
|
||||
}
|
||||
.tier-2 .nav-link {
|
||||
color: #856404;
|
||||
}
|
||||
.tier-2 .nav-link.active {
|
||||
border-bottom-color: #ffc107;
|
||||
}
|
||||
.tier-3 .nav-link {
|
||||
color: #721c24;
|
||||
}
|
||||
.tier-3 .nav-link.active {
|
||||
border-bottom-color: #dc3545;
|
||||
}
|
||||
|
||||
/* Candidate Table Styles */
|
||||
.candidate-table {
|
||||
width: 100%;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
background-color: white;
|
||||
border-radius: 0.375rem;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
||||
}
|
||||
.candidate-table thead {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
.candidate-table th {
|
||||
padding: 0.75rem;
|
||||
text-align: left;
|
||||
font-weight: 600;
|
||||
font-size: 0.875rem;
|
||||
color: #495057;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
.candidate-table td {
|
||||
padding: 0.75rem;
|
||||
border-bottom: 1px solid #f1f3f4;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.candidate-table tbody tr:hover {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
.candidate-table tbody tr:last-child td {
|
||||
border-bottom: none;
|
||||
}
|
||||
.candidate-name {
|
||||
font-weight: 600;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
.candidate-details {
|
||||
font-size: 0.8rem;
|
||||
color: #6c757d;
|
||||
}
|
||||
.candidate-table-responsive {
|
||||
overflow-x: auto;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.stage-badge {
|
||||
padding: 0.125rem 0.5rem;
|
||||
border-radius: 0.5rem;
|
||||
font-size: 0.7rem;
|
||||
font-weight: 600;
|
||||
margin-left: 0.375rem;
|
||||
}
|
||||
.stage-Applied {
|
||||
background-color: #e9ecef;
|
||||
color: #495057;
|
||||
}
|
||||
.stage-Exam {
|
||||
background-color: #cce5ff;
|
||||
color: #004085;
|
||||
}
|
||||
.stage-Interview {
|
||||
background-color: #d1ecf1;
|
||||
color: #0c5460;
|
||||
}
|
||||
.stage-Offer {
|
||||
background-color: #d4edda;
|
||||
color: #155724;
|
||||
}
|
||||
.exam-controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
margin-top: 0.375rem;
|
||||
}
|
||||
.exam-controls select,
|
||||
.exam-controls input {
|
||||
font-size: 0.75rem;
|
||||
padding: 0.125rem 0.25rem;
|
||||
}
|
||||
.tier-badge {
|
||||
font-size: 0.7rem;
|
||||
padding: 0.125rem 0.375rem;
|
||||
border-radius: 0.25rem;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
color: #495057;
|
||||
margin-left: 0.375rem;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container py-4">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h1 class="h3 mb-1">
|
||||
<i class="fas fa-layer-group me-2"></i>
|
||||
{% trans "Exam" %} - {{ job.title }}
|
||||
</h1>
|
||||
<p class="text-muted mb-0">
|
||||
Total Candidates: {{ total_candidates }}
|
||||
</p>
|
||||
</div>
|
||||
<a href="{% url 'job_detail' job.slug %}" class="btn btn-outline-secondary">
|
||||
<i class="fas fa-arrow-left me-1"></i> {% trans "Back to Job" %}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Tier Controls -->
|
||||
<div class="tier-controls">
|
||||
<form method="post" class="mb-0">
|
||||
{% csrf_token %}
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label for="tier1_count">{% trans "Number of candidates in Tier 1 (Top N)" %}</label>
|
||||
<input type="number" name="tier1_count" id="tier1_count" class="form-control"
|
||||
value="{{ tier1_count }}" min="1" max="{{ total_candidates }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" name="update_tiers" class="btn btn-primary">
|
||||
<i class="fas fa-sync-alt me-1"></i> {% trans "Update Tiers" %}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Tier Display -->
|
||||
<h2 class="h4 mb-3 mt-5">{% trans "Candidate Tiers" %}</h2>
|
||||
<div class="candidate-table-responsive" data-signals__ifmissing="{_fetching: false, selections: Array({{ candidates|length }}).fill(false)}">
|
||||
{% url "bulk_update_candidate_exam_status" job.slug as bulk_update_candidate_exam_status_url %}
|
||||
{% if candidates %}
|
||||
<button class="btn btn-primary"
|
||||
data-attr="{disabled: !$selections.filter(Boolean).length}"
|
||||
data-on-click="@post('{{bulk_update_candidate_exam_status_url}}',{
|
||||
contentType: 'form',
|
||||
selector: '#myform',
|
||||
headers: {'X-CSRFToken': '{{ csrf_token }}','status': 'pass'}
|
||||
})"
|
||||
>Mark as Pass and move to Interview</button>
|
||||
<button class="btn btn-danger"
|
||||
data-attr="{disabled: !$selections.filter(Boolean).length}"
|
||||
data-on-click="@post('{{bulk_update_candidate_exam_status_url}}',{
|
||||
contentType: 'form',
|
||||
selector: '#myform',
|
||||
headers: {'X-CSRFToken': '{{ csrf_token }}','status': 'fail'}
|
||||
})"
|
||||
>Mark as Failed</button>
|
||||
{% endif %}
|
||||
<form id="myform" action="{{move_to_exam_url}}" method="post">
|
||||
<table class="candidate-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
{% if candidates %}
|
||||
<div class="form-check">
|
||||
<input
|
||||
data-bind-_all
|
||||
data-on-change="$selections = Array({{ candidates|length }}).fill($_all)"
|
||||
data-effect="$selections; $_all = $selections.every(Boolean)"
|
||||
data-attr-disabled="$_fetching"
|
||||
type="checkbox" class="form-check-input" id="candidate-{{ candidate.id }}">
|
||||
</div>
|
||||
{% endif %}
|
||||
</th>
|
||||
<th>{% trans "Name" %}</th>
|
||||
<th>{% trans "Contact" %}</th>
|
||||
<th>{% trans "AI Score" %}</th>
|
||||
<th>{% trans "Exam Status" %}</th>
|
||||
<th>{% trans "Exam Date" %}</th>
|
||||
<th>{% trans "Actions" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for candidate in candidates %}
|
||||
<tr>
|
||||
<td>
|
||||
<div class="form-check">
|
||||
<input
|
||||
data-bind-selections
|
||||
data-attr-disabled="$_fetching"
|
||||
name="{{ candidate.id }}"
|
||||
|
||||
type="checkbox" class="form-check-input" id="candidate-{{ candidate.id }}">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="candidate-name">{{ candidate.name }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="candidate-details">
|
||||
Email: {{ candidate.email }}<br>
|
||||
Phone: {{ candidate.phone }}<br>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge bg-success">{{ candidate.match_score|default:"0" }}</span>
|
||||
</td>
|
||||
<td>
|
||||
{% if candidate.exam_status == "Passed" %}
|
||||
<span class="badge bg-success">{{ candidate.exam_status }}</span>
|
||||
{% elif candidate.exam_status == "Failed" %}
|
||||
<span class="badge bg-danger">{{ candidate.exam_status }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{candidate.exam_date|date:"M d, Y h:i A"}}</td>
|
||||
<td>
|
||||
<button class="btn btn-primary"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#candidateviewModal"
|
||||
hx-get="{% url 'candidate_criteria_view_htmx' candidate.pk %}"
|
||||
hx-target="#candidateviewModalBody"
|
||||
>
|
||||
{% include "icons/view.html" %}
|
||||
{% trans "View" %}</button>
|
||||
<button class="btn btn-primary"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#candidateviewModal"
|
||||
hx-get="{% url 'update_candidate_exam_status' candidate.slug %}"
|
||||
hx-target="#candidateviewModalBody"
|
||||
>
|
||||
{% include "icons/view.html" %}
|
||||
{% trans "Set Exam Date" %}</button>
|
||||
{% if candidate.stage != "Exam" %}
|
||||
<button hx-post="{% url 'candidate_set_exam_date' candidate.slug %}"
|
||||
hx-target=".candidate-table"
|
||||
hx-select=".candidate-table"
|
||||
hx-swap="outerHTML"
|
||||
class="btn btn-primary"> {% trans "Move to Exam" %} {% include "icons/right.html" %}</button>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<!-- Tab Content -->
|
||||
|
||||
<div class="modal fade modal-lg" id="candidateviewModal" tabindex="-1" aria-labelledby="candidateviewModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="candidateviewModalLabel">Form Settings</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div id="candidateviewModalBody" class="modal-body">
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@ -232,466 +232,106 @@
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Bulk Stage Update Controls -->
|
||||
<div class="bulk-update-controls">
|
||||
<h4 class="h5 mb-3">{% trans "Bulk Stage Update" %}</h4>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<div class="form-row align-items-end">
|
||||
<div class="form-group">
|
||||
<label for="bulk_new_stage">{% trans "Update Selected Candidates to" %}</label>
|
||||
<select name="bulk_new_stage" id="bulk_new_stage" class="form-control" required>
|
||||
<option value="">{% trans "Select Stage" %}</option>
|
||||
<option value="Exam">{% trans "Exam" %}</option>
|
||||
<option value="Interview">{% trans "Interview" %}</option>
|
||||
<option value="Offer">{% trans "Offer" %}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" name="bulk_update_stage" class="btn btn-success">
|
||||
<i class="fas fa-tasks me-1"></i> {% trans "Update Selected" %}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Stage Groups -->
|
||||
{% comment %} <div class="stage-groups">
|
||||
{% for stage_name, stage_candidates in stage_groups.items %}
|
||||
<div class="stage-group">
|
||||
<div class="stage-header">
|
||||
{{ stage_name }}
|
||||
<span class="badge badge-light">{{ stage_candidates.count }}</span>
|
||||
</div>
|
||||
<div class="stage-body">
|
||||
{% for candidate in stage_candidates %}
|
||||
<div class="stage-candidate">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" name="selected_candidates"
|
||||
value="{{ candidate.id }}" id="candidate_{{ candidate.id }}">
|
||||
<label class="form-check-label d-flex justify-content-between align-items-start"
|
||||
for="candidate_{{ candidate.id }}">
|
||||
<div>
|
||||
<div class="fw-medium">{{ candidate.name }}</div>
|
||||
<div class="text-muted small">
|
||||
Score: <span class="match-score">{{ candidate.match_score|default:"0" }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center">
|
||||
{% if candidate.stage == "Exam" and candidate.exam_status %}
|
||||
<span class="badge bg-info">{{ candidate.get_exam_status_display }}</span>
|
||||
{% endif %}
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-sm btn-outline-secondary dropdown-toggle"
|
||||
type="button" data-bs-toggle="dropdown">
|
||||
{% trans "Actions" %}
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
{% for next_stage in candidate.get_available_stages %}
|
||||
<li>
|
||||
<button type="submit" name="update_stage"
|
||||
class="dropdown-item btn-sm"
|
||||
formaction="?candidate_id={{ candidate.id }}&new_stage={{ next_stage }}">
|
||||
Move to {{ next_stage }}
|
||||
</button>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% if candidate.stage == "Exam" %}
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li>
|
||||
<button type="button" class="dropdown-item btn-sm"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#examModal{{ candidate.id }}">
|
||||
{% trans "Update Exam Status" %}
|
||||
</button>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<p class="text-muted text-center py-3">{% trans "No candidates in this stage" %}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div> {% endcomment %}
|
||||
|
||||
<!-- Tier Display -->
|
||||
<h2 class="h4 mb-3 mt-5">{% trans "Candidate Tiers" %}</h2>
|
||||
|
||||
<!-- Tabs for Candidate Tiers -->
|
||||
<ul class="nav nav-tabs tier-1" id="candidateTiersTabs" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="tier1-tab" data-bs-toggle="tab" data-bs-target="#tier1" type="button"
|
||||
role="tab" aria-controls="tier1" aria-selected="true">
|
||||
{% trans "Tier 1 - Top Candidates" %}
|
||||
<span class="tier-badge ms-1">{{ tier1_candidates|length }}</span>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="tier2-tab" data-bs-toggle="tab" data-bs-target="#tier2" type="button"
|
||||
role="tab" aria-controls="tier2" aria-selected="false">
|
||||
{% trans "Tier 2 - Good Candidates" %}
|
||||
<span class="tier-badge ms-1">{{ tier2_candidates|length }}</span>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="tier3-tab" data-bs-toggle="tab" data-bs-target="#tier3" type="button"
|
||||
role="tab" aria-controls="tier3" aria-selected="false">
|
||||
{% trans "Tier 3 - Other Candidates" %}
|
||||
<span class="tier-badge ms-1">{{ tier3_candidates|length }}</span>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Tab Content -->
|
||||
<div class="tab-content" id="candidateTiersTabContent">
|
||||
<!-- Tier 1 Tab -->
|
||||
<div class="tab-pane fade show active" id="tier1" role="tabpanel" aria-labelledby="tier1-tab">
|
||||
{% if tier1_candidates %}
|
||||
<div class="mb-3 d-flex justify-content-end">
|
||||
<button type="submit" name="mark_as_candidates"
|
||||
class="btn btn-sm btn-success"
|
||||
onclick="return confirm('Are you sure you want to mark all Tier 1 candidates as official candidates?')">
|
||||
<i class="fas fa-user-check me-1"></i> {% trans "Mark as Candidates" %}
|
||||
</button>
|
||||
</div>
|
||||
<div class="candidate-table-responsive">
|
||||
<table class="candidate-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "Name" %}</th>
|
||||
<th>{% trans "Contact" %}</th>
|
||||
<th>{% trans "AI Score" %}</th>
|
||||
<th>{% trans "Status" %}</th>
|
||||
<th>{% trans "Stage" %}</th>
|
||||
<th>{% trans "Actions" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for candidate in tier1_candidates %}
|
||||
<tr>
|
||||
<td>
|
||||
<div class="candidate-name">{{ candidate.name }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="candidate-details">
|
||||
Email: {{ candidate.email }}<br>
|
||||
Phone: {{ candidate.phone }}<br>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge bg-success">{{ candidate.match_score|default:"0" }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge {% if candidate.applicant_status == 'Candidate' %}bg-success{% else %}bg-secondary{% endif %}">
|
||||
{{ candidate.get_applicant_status_display }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="stage-badge stage-{{ candidate.stage }}">
|
||||
{{ candidate.get_stage_display }}
|
||||
</span>
|
||||
{% if candidate.stage == "Exam" and candidate.exam_status %}
|
||||
<br>
|
||||
<span class="badge bg-info">{{ candidate.get_exam_status_display }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<button class="btn btn-primary"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#candidateviewModal"
|
||||
hx-get="{% url 'candidate_criteria_view_htmx' candidate.pk %}"
|
||||
hx-target="#candidateviewModalBody"
|
||||
>
|
||||
{% include "icons/view.html" %}
|
||||
{% trans "View" %}</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="text-center text-muted py-3">{% trans "No candidates in Tier 1" %}</p>
|
||||
<h2 class="h4 mb-3 mt-5">{% trans "Candidate Tiers" %}</h2>
|
||||
<div class="candidate-table-responsive" data-signals__ifmissing="{_fetching: false, selections: Array({{ candidates|length }}).fill(false)}">
|
||||
{% url "bulk_candidate_move_to_exam" as move_to_exam_url %}
|
||||
{% if candidates %}
|
||||
<button class="btn btn-primary"
|
||||
data-attr="{disabled: !$selections.filter(Boolean).length}"
|
||||
data-on-click="@post('{{move_to_exam_url}}',{
|
||||
contentType: 'form',
|
||||
selector: '#myform',
|
||||
headers: {'X-CSRFToken': '{{ csrf_token }}'}})"
|
||||
>Bulk Move To Exam</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
<form id="myform" action="{{move_to_exam_url}}" method="post">
|
||||
<table class="candidate-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
{% if candidates %}
|
||||
<div class="form-check">
|
||||
<input
|
||||
data-bind-_all
|
||||
data-on-change="$selections = Array({{ candidates|length }}).fill($_all)"
|
||||
data-effect="$selections; $_all = $selections.every(Boolean)"
|
||||
data-attr-disabled="$_fetching"
|
||||
type="checkbox" class="form-check-input" id="candidate-{{ candidate.id }}">
|
||||
</div>
|
||||
{% endif %}
|
||||
</th>
|
||||
<th>{% trans "Name" %}</th>
|
||||
<th>{% trans "Contact" %}</th>
|
||||
<th>{% trans "AI Score" %}</th>
|
||||
<th>{% trans "Status" %}</th>
|
||||
<th>{% trans "Stage" %}</th>
|
||||
<th>{% trans "Actions" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for candidate in candidates %}
|
||||
<tr>
|
||||
<td>
|
||||
<div class="form-check">
|
||||
<input
|
||||
data-bind-selections
|
||||
data-attr-disabled="$_fetching"
|
||||
name="{{ candidate.id }}"
|
||||
|
||||
<!-- Tier 2 Tab -->
|
||||
<div class="tab-pane fade" id="tier2" role="tabpanel" aria-labelledby="tier2-tab">
|
||||
{% if tier2_candidates %}
|
||||
<div class="candidate-table-responsive">
|
||||
<table class="candidate-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "Name" %}</th>
|
||||
<th>{% trans "Contact" %}</th>
|
||||
<th>{% trans "AI Score" %}</th>
|
||||
<th>{% trans "Status" %}</th>
|
||||
<th>{% trans "Stage" %}</th>
|
||||
<th>{% trans "Actions" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for candidate in tier2_candidates %}
|
||||
<tr>
|
||||
<td>
|
||||
<div class="candidate-name">{{ candidate.name }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="candidate-details">
|
||||
Email: {{ candidate.email }}<br>
|
||||
Phone: {{ candidate.phone }}<br>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge bg-success">{{ candidate.match_score|default:"0" }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge {% if candidate.applicant_status == 'Candidate' %}bg-success{% else %}bg-secondary{% endif %}">
|
||||
{{ candidate.get_applicant_status_display }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="stage-badge stage-{{ candidate.stage }}">
|
||||
{{ candidate.get_stage_display }}
|
||||
</span>
|
||||
{% if candidate.stage == "Exam" and candidate.exam_status %}
|
||||
<br>
|
||||
<span class="badge bg-info">{{ candidate.get_exam_status_display }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<!-- Individual actions -->
|
||||
<div class="d-flex flex-wrap gap-1 mb-1">
|
||||
{% if candidate.applicant_status == 'Applicant' %}
|
||||
<button type="submit" name="mark_as_candidate"
|
||||
class="btn btn-sm btn-success"
|
||||
formaction="?candidate_id={{ candidate.id }}&action=mark_as_candidate"
|
||||
title="{% trans 'Mark as Candidate' %}">
|
||||
<i class="fas fa-user-check"></i>
|
||||
</button>
|
||||
type="checkbox" class="form-check-input" id="candidate-{{ candidate.id }}">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="candidate-name">{{ candidate.name }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="candidate-details">
|
||||
Email: {{ candidate.email }}<br>
|
||||
Phone: {{ candidate.phone }}<br>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge bg-success">{{ candidate.match_score|default:"0" }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge {% if candidate.applicant_status == 'Candidate' %}bg-success{% else %}bg-secondary{% endif %}">
|
||||
{{ candidate.get_applicant_status_display }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="stage-badge stage-{{ candidate.stage }}">
|
||||
{{ candidate.get_stage_display }}
|
||||
</span>
|
||||
{% if candidate.stage == "Exam" and candidate.exam_status %}
|
||||
<br>
|
||||
<span class="badge bg-info">{{ candidate.get_exam_status_display }}</span>
|
||||
{% endif %}
|
||||
{% for next_stage in candidate.get_available_stages %}
|
||||
<button type="submit" name="update_stage"
|
||||
class="btn btn-sm btn-outline-secondary"
|
||||
formaction="?candidate_id={{ candidate.id }}&new_stage={{ next_stage }}"
|
||||
title="{% trans 'Move to' %} {{ next_stage }}">
|
||||
{{ next_stage }}
|
||||
</button>
|
||||
{% endfor %}
|
||||
{% if candidate.stage == "Exam" %}
|
||||
<button type="button" class="btn btn-sm btn-outline-info"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#examModal{{ candidate.id }}"
|
||||
title="{% trans 'Update Exam Status' %}">
|
||||
<i class="fas fa-clipboard-check"></i>
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
<!-- Dropdown for additional actions -->
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button"
|
||||
data-bs-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
{% for next_stage in candidate.get_available_stages %}
|
||||
<li>
|
||||
<button type="submit" name="update_stage"
|
||||
class="dropdown-item btn-sm"
|
||||
formaction="?candidate_id={{ candidate.id }}&new_stage={{ next_stage }}">
|
||||
Move to {{ next_stage }}
|
||||
</button>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% if candidate.stage == "Exam" %}
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li>
|
||||
<button type="button" class="dropdown-item btn-sm"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#examModal{{ candidate.id }}">
|
||||
{% trans "Update Exam Status" %}
|
||||
</button>
|
||||
</li>
|
||||
</td>
|
||||
<td>
|
||||
<button class="btn btn-primary"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#candidateviewModal"
|
||||
hx-get="{% url 'candidate_criteria_view_htmx' candidate.pk %}"
|
||||
hx-target="#candidateviewModalBody"
|
||||
>
|
||||
{% include "icons/view.html" %}
|
||||
{% trans "View" %}</button>
|
||||
{% if candidate.stage != "Exam" %}
|
||||
<button hx-post="{% url 'candidate_move_to_exam' candidate.pk %}"
|
||||
hx-target=".candidate-table"
|
||||
hx-select=".candidate-table"
|
||||
hx-swap="outerHTML"
|
||||
class="btn btn-primary"> {% trans "Move to Exam" %} {% include "icons/right.html" %}</button>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="text-center text-muted py-3">{% trans "No candidates in Tier 2" %}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Tier 3 Tab -->
|
||||
<div class="tab-pane fade" id="tier3" role="tabpanel" aria-labelledby="tier3-tab">
|
||||
{% if tier3_candidates %}
|
||||
<div class="candidate-table-responsive">
|
||||
<table class="candidate-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "Name" %}</th>
|
||||
<th>{% trans "Contact" %}</th>
|
||||
<th>{% trans "AI Score" %}</th>
|
||||
<th>{% trans "Status" %}</th>
|
||||
<th>{% trans "Stage" %}</th>
|
||||
<th>{% trans "Actions" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for candidate in tier3_candidates %}
|
||||
<tr>
|
||||
<td>
|
||||
<div class="candidate-name">{{ candidate.name }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="candidate-details">
|
||||
Email: {{ candidate.email }}<br>
|
||||
Phone: {{ candidate.phone }}<br>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge bg-success">{{ candidate.match_score|default:"0" }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge {% if candidate.applicant_status == 'Candidate' %}bg-success{% else %}bg-secondary{% endif %}">
|
||||
{{ candidate.get_applicant_status_display }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="stage-badge stage-{{ candidate.stage }}">
|
||||
{{ candidate.get_stage_display }}
|
||||
</span>
|
||||
{% if candidate.stage == "Exam" and candidate.exam_status %}
|
||||
<br>
|
||||
<span class="badge bg-info">{{ candidate.get_exam_status_display }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<!-- Individual actions -->
|
||||
<div class="d-flex flex-wrap gap-1 mb-1">
|
||||
{% if candidate.applicant_status == 'Applicant' %}
|
||||
<button type="submit" name="mark_as_candidate"
|
||||
class="btn btn-sm btn-success"
|
||||
formaction="?candidate_id={{ candidate.id }}&action=mark_as_candidate"
|
||||
title="{% trans 'Mark as Candidate' %}">
|
||||
<i class="fas fa-user-check"></i>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% for next_stage in candidate.get_available_stages %}
|
||||
<button type="submit" name="update_stage"
|
||||
class="btn btn-sm btn-outline-secondary"
|
||||
formaction="?candidate_id={{ candidate.id }}&new_stage={{ next_stage }}"
|
||||
title="{% trans 'Move to' %} {{ next_stage }}">
|
||||
{{ next_stage }}
|
||||
</button>
|
||||
{% endfor %}
|
||||
{% if candidate.stage == "Exam" %}
|
||||
<button type="button" class="btn btn-sm btn-outline-info"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#examModal{{ candidate.id }}"
|
||||
title="{% trans 'Update Exam Status' %}">
|
||||
<i class="fas fa-clipboard-check"></i>
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
<!-- Dropdown for additional actions -->
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button"
|
||||
data-bs-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
{% for next_stage in candidate.get_available_stages %}
|
||||
<li>
|
||||
<button type="submit" name="update_stage"
|
||||
class="dropdown-item btn-sm"
|
||||
formaction="?candidate_id={{ candidate.id }}&new_stage={{ next_stage }}">
|
||||
Move to {{ next_stage }}
|
||||
</button>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% if candidate.stage == "Exam" %}
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li>
|
||||
<button type="button" class="dropdown-item btn-sm"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#examModal{{ candidate.id }}">
|
||||
{% trans "Update Exam Status" %}
|
||||
</button>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="text-center text-muted py-3">{% trans "No candidates in Tier 3" %}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Exam Status Update Modals -->
|
||||
{% for candidate in tier1_candidates|add:tier2_candidates|add:tier3_candidates %}
|
||||
{% if candidate.stage == "Exam" %}
|
||||
<div class="modal fade" id="examModal{{ candidate.id }}" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">{% trans "Update Exam Status" %} - {{ candidate.name }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="candidate_id" value="{{ candidate.id }}">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{% trans "Exam Status" %}</label>
|
||||
<select name="exam_status" class="form-select" required>
|
||||
<option value="">{% trans "Select Status" %}</option>
|
||||
<option value="Passed" {% if candidate.exam_status == "Passed" %}selected{% endif %}>
|
||||
{% trans "Passed" %}
|
||||
</option>
|
||||
<option value="Failed" {% if candidate.exam_status == "Failed" %}selected{% endif %}>
|
||||
{% trans "Failed" %}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{% trans "Exam Date" %}</label>
|
||||
<input type="date" name="exam_date" class="form-control"
|
||||
value="{{ candidate.exam_date|date:"Y-m-d" }}">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
|
||||
{% trans "Cancel" %}
|
||||
</button>
|
||||
<button type="submit" name="update_exam_status" class="btn btn-primary">
|
||||
{% trans "Update Status" %}
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<!-- Tab Content -->
|
||||
|
||||
<div class="modal fade modal-lg" id="candidateviewModal" tabindex="-1" aria-labelledby="candidateviewModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
@ -709,16 +349,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block customJS %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.7/dist/htmx.min.js"></script>
|
||||
<script>
|
||||
document.getElementById('tier1_count').addEventListener('change', function() {
|
||||
const max = {{ total_candidates }};
|
||||
if (this.value > max) {
|
||||
this.value = max;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock customJS %}
|
||||
{% endblock %}
|
||||
Loading…
x
Reference in New Issue
Block a user