<!--
SPDX-FileCopyrightText: 2017-present Tobias Kunze
SPDX-License-Identifier: AGPL-3.0-only WITH LicenseRef-Pretalx-AGPL-3.0-Terms
-->

{% extends "common/base.html" %}

{% load event_tags %}
{% load i18n %}
{% load rules %}
{% load safelink %}
{% load static %}

{% block stylesheets %}
    <link rel="stylesheet" type="text/css" href="{% static "agenda/css/base.css" %}" />
    {% block agenda_stylesheets %}{% endblock agenda_stylesheets %}
{% endblock stylesheets %}

{% block custom_header %}
    {% block alternate_link %}
        <link rel="alternate" type="application/atom+xml" title="{{ request.event.name }} Schedule Versions" href="{{ request.event.urls.feed }}" />
        <link rel="alternate" type="application/json" title="{{ request.event.name }} API" href="{{ request.event.api_urls.base.full }}" />
    {% endblock alternate_link %}
    {% block agenda_custom_header %}{% endblock agenda_custom_header %}
{% endblock custom_header %}

{% block nav_link %}
    {% has_perm "schedule.list_schedule" request.user request.event as can_view_schedule %}
    {% if can_view_schedule %}
        {{ request.event.urls.schedule }}
    {% else %}
        {{ request.event.urls.base }}
    {% endif %}
{% endblock nav_link %}

{% block header_tabs %}
    {% if schedule or request.event.current_schedule %}
        <a href="{{ request.event.urls.schedule }}" class="header-tab {% if "/schedule/" in request.path %}active{% endif %}">
            <i class="fa fa-calendar"></i> {{ phrases.schedule.schedule }}
        </a>
    {% endif %}
    {% if request.event.display_settings.schedule_display != "list" %}
        <a href="{{ request.event.urls.talks }}" class="header-tab {% if "/talk/" in request.path %} active{% endif %}">
            <i class="fa fa-comments-o"></i> {{ phrases.schedule.sessions }}
        </a>
    {% endif %}
    {% if schedule or request.event.current_schedule %}
        <a href="{{ request.event.urls.speakers }}" class="header-tab {% if "/speaker/" in request.path %} active{% endif %}">
            <i class="fa fa-group"></i> {{ phrases.schedule.speakers }}
        </a>
    {% endif %}
    {% for link in header_links %}
        <a href="{% safelink link.url %}" target="_blank" rel="noopener" class="header-tab">
            <i class="fa fa-link"></i> {{ link.label }}
        </a>
    {% endfor %}
{% endblock header_tabs %}

{% block content %}
    {% if not request.event|get_feature_flag:"show_schedule" and not request.user.is_anonymous and not hide_visibility_warning %}
        <div id="event-nonpublic" class="d-print-none">
            <i class="fa fa-user-secret"></i>
            {% blocktranslate trimmed %}
                This schedule-related page is non-public. Only organisers can see it.
            {% endblocktranslate %}
        </div>
    {% endif %}
    {% block agenda_content %}{% endblock agenda_content %}
{% endblock content %}
