{% extends "base.html" %} {% load static i18n humanize%} {% block title %}{{ application.name }} - {{ block.super }}{% endblock %} {% block customCSS %} {% endblock %} {% block content %}
{# LEFT COLUMN: MAIN application DETAILS AND TABS #}
{# HEADER SECTION #}

{{ application.name }}

{% trans "Stage:" %} {{ application.stage }}
{% trans "Applied for:" %} {{ application.job.title }}
{# Change Stage button #} {% if user.is_staff %} {% endif %}
{# LEFT TABS NAVIGATION #}
{# TAB 1 CONTENT: CONTACT & DATES #}
{% trans "Core Details" %}
{% trans "Email" %} {{ application.email }}
{% trans "Position Applied" %} {{ application.job.title }}
{% trans "Applied Date" %}
{{ application.created_at|date:"M d, Y H:i" }} {{ application.created_at|naturaltime }}
{# TAB 2 CONTENT: RESUME #} {# NEW TAB 3 CONTENT: CANDIDATE JOURNEY TIMELINE #}
{# ENHANCED: CANDIDATE JOURNEY TIMELINE CARD #}
{% trans "Application Journey" %}
{% trans "Current Stage" %}

{{ application.stage }}

{% trans "Latest status update:" %} {{ application.updated_at|date:"M d, Y" }}
{% trans "Historical Timeline" %}
{# Base Status: Application Submitted (Always required) #}

{% trans "Application Submitted" %}

{{ application.created_at|date:"M d, Y" }} | {{ application.created_at|date:"h:i A" }}
{% if application.exam_date %}

{% trans "Exam" %}

{{ application.exam_date|date:"M d, Y" }} | {{ application.exam_date|date:"h:i A" }}
{% endif %} {% if application.get_interview_date %}

{% trans "Interview" %}

{{ application.get_interview_date}} | {{ application.get_interview_time}}
{% endif %} {% if application.offer_date %}

{% trans "Offer" %}

{{ application.offer_date|date:"M d, Y" }}
{% endif %} {% if application.hired_date %}

{% trans "Offer" %}

{{ application.hired_date|date:"M d, Y" }}
{% endif %}
{# TAB 4 CONTENT: DOCUMENTS #}
{% with documents=application.documents %} {% include 'includes/document_list.html' %} {% endwith %}
{# TAB 5 CONTENT: PARSED SUMMARY #} {% if application.parsed_summary %}
{% trans "AI Generated Summary" %}
{% include 'includes/application_modal_body.html' %}
{% endif %} {# TAB 5 CONTENT: AI ANALYSIS #} {% if application.is_resume_parsed %}
{% trans "AI Analysis Report" %}
{% with analysis=application.ai_analysis_data %} {# Match Score Card #}
{% trans "Match Score" %}
{{ analysis.match_score }}%
{# Category & Job Fit #}
{% trans "Category" %}

{{ analysis.category }}

{% trans "Job Fit Narrative" %}

{{ analysis.job_fit_narrative }}

{# Strengths and Weaknesses #}
{% trans "Strengths" %}

{{ analysis.strengths }}

{% trans "Weaknesses" %}

{{ analysis.weaknesses }}

{# Recommendation #}
{% trans "Recommendation" %}

{{ analysis.recommendation }}

{# Top Keywords #}
{% trans "Top Keywords" %}
{% for keyword in analysis.top_3_keywords %} {{ keyword }} {% endfor %}
{# Professional Details #}
{% trans "Professional Details" %}

{% trans "Years of Experience:" %} {{ analysis.years_of_experience }}

{% trans "Most Recent Job Title:" %} {{ analysis.most_recent_job_title }}

{% trans "Experience Industry Match:" %} {{ analysis.experience_industry_match }}%

{% trans "Soft Skills Score:" %} {{ analysis.soft_skills_score }}%

{# Screening Status #}
{% trans "Screening Status" %}
{% trans "Minimum Requirements Met:" %} {% if analysis.min_req_met_bool %} {% trans "Yes" %} {% else %} {% trans "No" %} {% endif %}
{% trans "Screening Stage Rating:" %} {{ analysis.screening_stage_rating }}
{# Criteria Checklist #}
{% trans "Criteria Assessment" %}
{% for criterion, status in analysis.criteria_checklist.items %} {% endfor %}
{% trans "Criteria" %} {% trans "Status" %}
{{ criterion }} {% if status == "Met" %} {% trans "Met" %} {% elif status == "Not Met" %} {% trans "Not Met" %} {% else %} {{ status }} {% endif %}
{# Language Fluency #} {% if analysis.language_fluency %}
{% trans "Language Fluency" %}
{% for language in analysis.language_fluency %} {{ language }} {% endfor %}
{% endif %} {% endwith %}
{% else %}
{% trans "Loading..." %}
{% trans "Resume is being parsed" %}

{% trans "Our AI is analyzing the application's resume to generate insights. This may take a few moments." %}

{% endif %}
{# RIGHT COLUMN: ACTIONS AND CANDIDATE TIMELINE #}
{# ACTIONS CARD #}
{% trans "Management Actions" %}
{% comment %} {% trans "Edit Details" %} {% endcomment %} {% comment %} {% trans "Delete Candidate" %} {% endcomment %} {% trans "Back to List" %} {% if application.resume %} {% comment %} {% trans "View Actual Resume" %} {% endcomment %} {% trans "Download Resume" %} {% comment %} {% trans "View Resume AI Overview" %} {% endcomment %} {% endif %}
{% trans "Time to Hire:" %} {% with days=application.time_to_hire_days %} {% if days > 0 %} {{ days }} day{{ days|pluralize }} {% else %} 0 {% endif %} {% endwith %}
{% if application.is_resume_parsed %} {% include 'recruitment/application_resume_template.html' %} {% else %} {% if application.scoring_timeout %}
{% trans "Resume Analysis In Progress..." %}
{% else %}
{% endif %} {% endif %}
{# STAGE UPDATE MODAL INCLUDED FOR STAFF USERS #} {% if user.is_staff %} {% include "recruitment/partials/stage_update_modal.html" with application=application form=stage_form %} {% endif %} {% endblock %}