{% extends 'base.html' %} {% load static i18n %} {% load widget_tweaks %} {% block customCSS %} {% endblock %} {% block content %}
{# --- TOP BAR / BACK BUTTON & ACTIONS (EDIT/DELETE) --- #}
{# Back Button #} {% trans "Back to Meetings" %} {# Edit and Delete Buttons #}
{% trans "Edit Meeting" %} {# Send Candidate Invitation Button #}
{% csrf_token %}
{# DELETE MEETING FORM #}
{% csrf_token %}
{# ========================================================= #} {# --- MAIN TITLE AT TOP --- #} {# ========================================================= #}

{{ meeting.topic|default:"[Meeting Topic N/A]" }} {{ meeting.status|title|default:'N/A' }}

{# ========================================================= #} {# --- SECTION 1: INTERVIEW & CONNECTION CARDS SIDE BY SIDE --- #} {# ========================================================= #}
{# --- LEFT HALF: INTERVIEW DETAIL CARD --- #}

{% trans "Interview Detail" %}

{% trans "Job Title" %}:
{{ meeting.get_job.title|default:"N/A" }}
{% trans "Job Type" %}:
{{ meeting.get_job.job_type|default:"N/A" }}
{% if meeting.get_candidate.belong_to_agency %} {% endif %}
{# --- RIGHT HALF: CONNECTION DETAILS CARD --- #}

{% trans "Connection Details" %}

{% trans "Date & Time" %}:
{{ meeting.start_time|date:"M d, Y H:i"|default:"N/A" }}
{% trans "Duration" %}:
{{ meeting.duration|default:"N/A" }} {% trans "minutes" %}
{% trans "Meeting ID" %}:
{{ meeting.meeting_id|default:"N/A" }}
{% trans "Host Email" %}:
{{ meeting.host_email|default:"N/A" }}
{% if meeting.join_url %}
{% trans "Copied!" %}
{% trans "Join URL" %}: {{ meeting.join_url }}
{% endif %}
{# ========================================================= #} {# --- SECTION 2: PERSONNEL TABLES --- #} {# ========================================================= #}
{# --- PARTICIPANTS TABLE --- #} {% comment %}

{% trans "Assigned Participants" %}

{# Send Participants Invitation Button #}
{% csrf_token %}
{% for participant in meeting.get_participants %} {% endfor %} {% for user in meeting.get_users %} {% endfor %}
{% trans "Name" %} {% trans "Role/Designation" %} {% trans "Email" %} {% trans "Phone Number" %} {% trans "Source Type" %}
{{participant.name}} {{participant.designation}} {{participant.email}} {{participant.phone}} {% trans "External Participants" %}
{{user.get_full_name}} Admin {{user.email}} {{user.phone}} {% trans "System User" %}
{% endcomment %}
{# ========================================================= #} {# --- SECTION 3: COMMENTS (CORRECTED) --- #} {# ========================================================= #}
{% comment %}
{% trans "Comments" %} ({% if meeting.comments %}{{ meeting.comments.count }}{% else %}0{% endif %})
{# 1. COMMENT DISPLAY & IN-PAGE EDIT FORMS #}
{% if meeting.comments.all %} {% for comment in meeting.comments.all|dictsortreversed:"created_at" %}
{# Read-Only Comment View #}
{% if comment.author == user or user.is_staff %}
{# Edit Button: Toggles the hidden form #} {# Delete Form: Submits a POST request #}
{% csrf_token %}
{% endif %}

{{ comment.content|linebreaksbr }}

{# Hidden Edit Form #}
{% endfor %} {% else %}

{% trans "No comments yet. Be the first to comment!" %}

{% endif %}

{# 2. NEW COMMENT SUBMISSION (Remains the same) #}
{% trans "Add a New Comment" %}
{% if user.is_authenticated %}
{% csrf_token %} {% if comment_form %} {{ comment_form.as_p }} {% else %}
{% endif %}
{% else %}

{% trans "You must be logged in to add a comment." %}

{% endif %}
{% endcomment %}
{% endblock %} {% block customJS %} {% endblock %}