{% extends 'backoffice/base.html.twig' %}

{% block title %}{{ parent() }}{{ season.name }}{% endblock %}

{% block breadcrumbs %}
    <nav aria-label="breadcrumb" class="mb-3">
        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="{{ path('tvdt_backoffice_index') }}">{{ 'Home'|trans }}</a></li>
            <li class="breadcrumb-item"><a href="{{ path('tvdt_backoffice_season', {seasonCode: season.seasonCode}) }}">{{ season.name }}</a></li>
            <li class="breadcrumb-item active" aria-current="page">{{ quiz.name }}</li>
        </ol>
    </nav>
{% endblock %}

{% block body %}
    {% set tabs = [
        {id: 'overview', label: 'Overview'|trans, route: 'tvdt_backoffice_quiz_overview'},
        {id: 'candidates', label: 'Candidates'|trans, route: 'tvdt_backoffice_quiz_candidates_tab'},
        {id: 'result', label: 'Results & Elimination'|trans, route: 'tvdt_backoffice_quiz_result'},
        {id: 'answers', label: 'Answer Mapping'|trans, route: 'tvdt_backoffice_quiz_candidates'},
    ] %}

    <h2 class="mb-3">{{ 'Quiz'|trans }}: {{ season.name }} - {{ quiz.name }}</h2>
    <ul class="nav nav-tabs mb-3">
        {% for tab in tabs %}
            <li class="nav-item">
                <a class="nav-link{{ activeTab == tab.id ? ' active' }}" href="{{ path(tab.route, {seasonCode: season.seasonCode, quiz: quiz.id}) }}">
                    {{ tab.label }}
                </a>
            </li>
        {% endfor %}
    </ul>
    <div class="pt-3">
        {{ include(template) }}
    </div>
{% endblock %}
