{% extends "base.html" %} {% load static i18n %} {% block title %}{% trans "Scheduled Interviews List" %} - {{ block.super }}{% endblock %} {% block customCSS %} {# (Your existing CSS is kept here, as it is perfect for the theme) #} {% endblock %} {% block content %} {{interviews}}

{% trans "Scheduled Interviews" %}

{# FIX: Using safe anchor href="#" to prevent the NoReverseMatch crash. #} {# Replace '#' with {% url 'create_scheduled_interview' %} once the URL name is defined in urls.py #} {% trans "Schedule Interview" %}
{# Search field #}
{# Filter by Status #}
{# Filter by Interview Type (ONSITE/REMOTE) - This list now correctly populated #}
{% if status_filter or search_query or type_filter %} {# Assuming 'interview_list' is the URL name for this view #} {% trans "Clear" %} {% endif %}
{{meetings}} {# Using 'meetings' based on the context_object_name provided #} {% if meetings %}
{# View Switcher (kept the name for simplicity) #} {% include "includes/_list_view_switcher.html" with list_id="meetings-list" %} {# Card View #}
{% for interview in meetings %}
{{ interview.candidate.name }}
{{ interview.status|title }}

{% trans "Job" %}: {{ interview.job.title }}
{# --- Remote/Onsite Logic - Handles both cases safely --- #} {% trans "Type" %}: {{ interview.schedule.get_interview_type_display }} {% if interview.schedule.interview_type == 'Remote' %}
{# CRITICAL FIX: Safe access to zoom_meeting details #} {% trans "Zoom ID" %}: {{ interview.zoom_meeting.meeting_id|default:"N/A" }} {% else %}
{% trans "Location" %}: {{ interview.schedule.location }} {% endif %}
{% trans "Date" %}: {{ interview.interview_date|date:"M d, Y" }}
{% trans "Time" %}: {{ interview.interview_time|time:"H:i" }}
{% trans "Duration" %}: {{ interview.schedule.interview_duration }} minutes

{% trans "View" %} {# CRITICAL FIX: Safe access to join URL #} {% if interview.schedule.interview_type == 'Remote' and interview.zoom_meeting and interview.zoom_meeting.join_url %} {% trans "Join" %} {% endif %}
{% endfor %}
{# Table View (Logic is identical, safe access applied) #}
{% for interview in meetings %} {% endfor %}
{% trans "Candidate" %} {% trans "Job" %} {% trans "Type" %} {% trans "Date/Time" %} {% trans "Duration" %} {% trans "Status" %} {% trans "Actions" %}
{{ interview.candidate.name }} {{ interview.job.title }} {{ interview.schedule.get_interview_type_display }} {{ interview.interview_date|date:"M d, Y" }}
({{ interview.interview_time|time:"H:i" }})
{{ interview.schedule.interview_duration }} min {% if interview.status == 'confirmed' %} {% endif %} {{ interview.status|title }}
{# CRITICAL FIX: Safe access to join URL #} {% if interview.schedule.interview_type == 'Remote' and interview.zoom_meeting and interview.zoom_meeting.join_url %} {% endif %}
{# Pagination #} {% if is_paginated %} {% endif %} {% else %}

{% trans "No Interviews found" %}

{% trans "Schedule your first interview or adjust your filters." %}

{# FIX: Using safe anchor href="#" to prevent the NoReverseMatch crash. #} {% trans "Schedule an Interview" %}
{% endif %}
{% endblock %}