{% load compress %}
{% load i18n %}
{% load rules %}
{% load static %}
<!DOCTYPE html>
<html{% if request.LANGUAGE_CODE %} lang="{{ request.LANGUAGE_CODE }}"{% endif %}>
<head>
    <meta charset="utf-8">
    <title>{% block title %}{% if request.event %}{{ request.event.name }}{% endif %}{% endblock %} :: pretalx</title>
    <meta name="title" content="{% block meta_title %}{% endblock %} {% if request.event %} - {{ request.event.name }} {% endif %}pretalx">
    <meta name="description" content="{% block meta_description %}{% if request.event %}Schedule, talks and talk submissions for {{ reqeuest.event.name }}{% else %}Talks and talk submissions by pretalx{% endif %}{% endblock %}">
    <meta name="application-name" content="pretalx">
    <meta name="generator" content="pretalx">
    <meta name="keywords" content="{% if request.event %}{{ request.event.name }}, {{ request.event.slug }}, {% if request.event.date_from %}{{ request.event.date_from.year }}, {% endif %}{% endif %}schedule, talks, cfp, call for papers, conference, submissions, organizer">
    <meta name="referrer" content="origin-when-crossorigin">
    <meta name="robots" content="nofollow">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="theme-color" content="#1c4a3b">
    <meta name="HandheldFriendly" content="True"/>
    {% if request.event and request.event.logo %}<meta property="thumbnail" content="{{ request.event.urls.logo.full }}">{% endif %}

    <link rel="icon" type="image/png" sizes="32x32" href="{% static "common/img/favicon-32x32.png" %}">
    <link rel="icon" type="image/png" sizes="16x16" href="{% static "common/img/favicon-16x16.png" %}">

    <link rel="stylesheet" type="text/css" href="{% static "common/scss/uncompressed.css" %}" />
    {% compress css %}
    <link rel="stylesheet" type="text/css" href="{% static "vendored/typeahead.css" %}"/>
    <link rel="stylesheet" type="text/css" href="{% static "vendored/fullcalendar/fullcalendar.min.css" %}"/>
    <link rel="stylesheet" type="text/x-scss" href="{% static "orga/scss/main.scss" %}"/>
    {% endcompress %}
    {% block stylesheets %}{% endblock %}
    {% compress js %}
        <script defer src="{% static "vendored/jquery-3.1.1.js" %}"></script>
        <script defer src="{% static "vendored/tether/tether.min.js" %}"></script>
        <script defer src="{% static "vendored/bootstrap/dist/js/bootstrap.bundle.min.js" %}"></script>
        <script defer src="{% static "orga/js/main.js" %}"></script>
        <script defer src="{% static "orga/js/typeahead.js" %}"></script>
    {% endcompress %}
    {% block scripts %}{% endblock %}
</head>
<body data-datetimeformat="{{ js_datetime_format }}" data-dateformat="{{ js_date_format }}" data-datetimelocale="{{ js_locale }}">
    <nav class="navbar navbar-expand-lg fixed-top">
        <ul class="navbar-nav d-block d-lg-none">
            <li class="nav-item">
                <a class="nav-link" data-toggle="sidebar" href="#">
                    <i class="fa fa-bars fa-lg"></i>
                </a>
            </li>
        </ul>
        <a class="navbar-brand d-none d-md-block" href="/orga/">
            <img src="{% static "common/img/icon.svg" %}" alt="{% trans "The pretalx logo" %}"> pretalx
        </a>
        <div class="navbar-collapse event-dropdown" id="navbartoggle">
            <ul class="navbar-nav mr-auto">
                <li class="nav-item dropdown active" id="event-navigation">
                    {% if request.orga_events.count > 1 %}
                        <a class="nav-link dropdown-toggle" id="eventDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            <i class="fa fa-calendar"></i>
                            <div class="event-text">
                                {% if request.event %}
                                <span class="event-name">{{ request.event.name }}</span>
                                <span class="event-date">{{ request.event.get_date_range_display }}</span>
                                {% else %}
                                    {% trans "Events" %}
                                {% endif %}
                            </div>
                        </a>
                        <ul class="dropdown-menu event-dropdown" role="menu" data-event-typeahead aria-labelledby="eventDropdown" data-source="{% url "orga:event.typeahead" %}">
                            <li class="query-holder">
                                <div class="form-box">
                                    <input type="text" class="form-control"
                                            placeholder="{% trans "Search for events" %}"
                                            data-typeahead-query>
                                </div>
                            </li>
                        </ul>
                    {% elif request.event %}
                        <a id="eventDropdown" class="nav-link">
                            <i class="fa fa-calendar"></i>
                            <div class="event-text">
                                {% if request.event %}
                                <span class="event-name">{{ request.event.name }}</span>
                                <span class="event-date">{{ request.event.get_date_range_display }}</span>
                                {% else %}
                                    {% trans "Events" %}
                                {% endif %}
                            </div>
                        </a>
                    {% endif %}
                </li>
                {% if request.event %}
                    <li class="nav-item">
                    {% if request.event.settings.custom_domain and not request.event.is_public %}
                        <form action="{{ request.event.urls.auth.full }}" method="post"
                                target="_blank" class="mobile-navbar-view-form visible-xs-block">
                            <input type="hidden" value="{{ new_session }}" name="session">
                            <input type="hidden" value="{{ go_to_target }}" name="target">
                            <button type="submit" class="btn btn-link navbar-toggle">
                                <i class="fa fa-eye"></i>
                            </button>
                        </form>
                    {% else %}
                    <a
                        class="nav-link" target="_blank" rel="noopener"
                        href="{% if go_to_target == 'schedule' %}{{ request.event.urls.schedule }}{% else %}{{ request.event.cfp.urls.public }}{% endif %}"
                    >
                            <i class="fa fa-eye"></i>
                    </a>
                    {% endif %}
                    </li>
                {% endif %}
            </ul>
        </div>
        <ul class="navbar-nav">
            {% if request.event %}
            <li class="nav-item">
                <input type="text" class="form-control mr-sm-2 mt-auto mb-auto" id="navigate" title="{% trans 'Navigate' %}" placeholder="{% trans 'Navigate' %}" />
            </li>
            {% endif %}
            <li class="nav-item">
                <a class="nav-link active" href="{% url "orga:user.view" %}">
                    <i class="fa fa-user"></i>
                    {{ request.user.get_display_name }}
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link active" href="{% url "orga:logout" %}">
                    <i class="fa fa-sign-out"></i>
                </a>
            </li>
        </ul>
    </nav>
    {% if request.user.is_superuser %}
        <div class="superuser-warning">
            <i class="fa fa-exclamation-triangle"></i>
            {% blocktrans with link=link trimmed %}
                You're using pretalx as a superuser. This is not recommended.
            {% endblocktrans %}
            <a href="{% url "orga:user.subuser" %}?next={{ request.path|urlencode }}">
                {% trans "Please click here to switch to an administrator account." %}
            </a>
        </div>
    {% endif %}
    <div id="page-wrapper">
        <aside class="nav flex-column sidebar">
        {% has_perm 'orga.view_organisers' request.user request as can_see_organisers %}
        {% if request.event %}
            {% has_perm 'orga.view_orga_area' request.user request.event as can_see_orga_area %}
            {% has_perm 'orga.change_submissions' request.user request.event as can_see_orga_exclusive %}
            {% has_perm 'orga.change_teams' request.user request.event as can_change_teams %}
            {% has_perm 'orga.change_settings' request.user request.event as can_change_settings %}
    {% has_perm 'orga.view_speakers' request.user request.event as can_view_speakers %}
            {% if can_see_orga_area %}
                <a class="nav-link {% if url_name == "event.dashboard" %}active{% endif %}" href="{{ request.event.orga_urls.base }}">
                    <i class="fa fa-tachometer"></i>
                    <span class="sidebar-text">{% trans "Dashboard" %}</span>
                </a>
            {% endif %}
            {% if can_see_orga_exclusive %}
                {% if can_change_settings %}
                <div class="nav-fold">
                    <span class="has-children">
                        <a href="{{ request.event.orga_urls.settings }}" class="nav-link nav-link-inner">
                            <i class="fa fa-wrench"></i>
                            <span class="sidebar-text">{% trans "Settings" %}</span>
                        </a>
                        <a class="arrow nav-link" data-toggle="collapse" href="#collapseSettings" aria-controls="collapseSettings">
                            <i class="fa fa-angle-down"></i>
                        </a>
                    </span>
                    <div class="collapse in{% if "settings." in url_name %} show{% endif %}" aria-expand="true" id="collapseSettings">
                        <a href="{{ request.event.orga_urls.settings }}" class="nav-link nav-link-second-level{% if "settings.event." in url_name %} active{% endif %}">
                            <span>{% trans "General" %}</span>
                        </a>
                        {% if can_change_teams %}
                        <a href="{{ request.event.organiser.orga_urls.base }}" class="nav-link nav-link-second-level{% if "settings.team." in url_name %} active{% endif %}">
                            <span>{% trans "Teams" %}</span>
                        </a>
                        {% endif %}
                        <a href="{{ request.event.orga_urls.review_settings }}" class="nav-link nav-link-second-level{% if "settings.review." in url_name %} active{% endif %}">
                            <span>{% trans "Review" %}</span>
                        </a>
                        <a href="{{ request.event.orga_urls.mail_settings }}" class="nav-link nav-link-second-level{% if "settings.mail." in url_name %} active{% endif %}">
                            <span>{% trans "E-mail" %}</span>
                        </a>
                        {% if request.user.is_administrator %}
                        <a href="{{ request.event.orga_urls.plugins }}" class="nav-link nav-link-second-level{% if "settings.plugins.select" in url_name %} active{% endif %}">
                            <span>{% trans "Select Plugins" %}</span>
                        </a>
                        {% endif %}
                        {% for plugin_setting in nav_settings %}
                        <a href="{{ plugin_setting.url }}" class="nav-link nav-link-second-level{% if plugin_setting.active %} active{% endif %}">
                            <span>{{ plugin_setting.label }}</span>
                        </a>
                        {% endfor %}
                    </div>
                </div>
                {% endif %}
                <div class="nav-fold">
                    <span class="has-children">
                        <a class="nav-link nav-link-inner" href="{{ request.event.cfp.urls.text }}">
                            <i class="fa fa-bullhorn"></i>
                            <span class="sidebar-text">{% trans "CfP" %}</span>
                        </a>
                        <a class="arrow nav-link" data-toggle="collapse" href="#collapseCfP" aria-controls="collapseCfP">
                            <i class="fa fa-angle-down"></i>
                        </a>
                    </span>
                    <div class="collapse in{% if "cfp." in url_name %} show{% endif %}" aria-expand="true" id="collapseCfP">
                        <a href="{{ request.event.cfp.urls.text }}" class="nav-link nav-link-second-level{% if "cfp.text" in url_name %} active{% endif %}">
                            <span>{% trans "Content" %}</span>
                        </a>
                        <a href="{{ request.event.cfp.urls.questions }}" class="nav-link nav-link-second-level{% if "cfp.question" in url_name %} active{% endif %}">
                            <span>{% trans "Questions" %}</span>
                        </a>
                        {% if request.event.settings.use_tracks %}
                        <a href="{{ request.event.cfp.urls.tracks }}" class="nav-link nav-link-second-level{% if "cfp.tracks" in url_name %} active{% endif %}">
                            <span>{% trans "Tracks" %}</span>
                        </a>
                        {% endif %}
                        <a href="{{ request.event.cfp.urls.types }}" class="nav-link nav-link-second-level{% if "cfp.types" in url_name %} active{% endif %}">
                            <span>{% trans "Submission Types" %}</span>
                        </a>
                    </div>
                </div>
            {% endif %}
            {% if can_see_orga_area %}
                <div class="nav-fold">
                    <span class="has-children">
                        <a class="nav-link nav-link-inner" href="{{ request.event.orga_urls.submissions }}">
                            <i class="fa fa-sticky-note-o"></i>
                            <span class="sidebar-text">{% trans "Submissions" %}</span>
                        </a>
                        <a class="arrow nav-link" data-toggle="collapse" href="#collapseSubmissions" aria-controls="collapseSubmissions">
                            <i class="fa fa-angle-down"></i>
                        </a>
                    </span>
                    <div class="collapse in{% if "submissions." in url_name|slice:":13" %} show{% endif %}" aria-expand="true" id="collapseSubmissions">
                        <a href="{{ request.event.orga_urls.submissions }}" class="nav-link nav-link-second-level{% if "submissions." in url_name and "submissions.statistics" not in url_name %} active{% endif %}">
                            <span>{% trans "Submissions" %}</span>
                        </a>
                        <a href="{{ request.event.orga_urls.stats }}" class="nav-link nav-link-second-level{% if "submissions.statistics" in url_name %} active{% endif %}">
                            <span>{% trans "Statistics" %}</span>
                        </a>
                    </div>
                </div>
                <a class="nav-link {% if "reviews." in url_name %}active{% endif %}" href="{% url "orga:reviews.dashboard" event=request.event.slug %}">
                    <i class="fa fa-eye"></i>
                    <span class="sidebar-text">{% trans "Review" %}</span>
                </a>
                {% if can_view_speakers %}
                <div class="nav-fold">
                    <span class="has-children">
                        <a class="nav-link nav-link-inner" href="{{ request.event.orga_urls.speakers }}">
                            <i class="fa fa-address-card-o"></i>
                            <span class="sidebar-text">{% trans "Speakers" %}</span>
                        </a>
                        <a class="arrow nav-link" data-toggle="collapse" href="#collapseSpeakers" aria-controls="collapseSpeakers">
                            <i class="fa fa-angle-down"></i>
                        </a>
                    </span>
                    <div class="collapse in{% if "speakers." in url_name|slice:":9" %} show{% endif %}" aria-expand="true" id="collapseSpeakers">
                        <a href="{{ request.event.orga_urls.speakers }}" class="nav-link nav-link-second-level{% if "speakers.list" in url_name or "speakers.view" in url_name %} active{% endif %}">
                            <span>{% trans "Speakers" %}</span>
                        </a>
                        {% if can_see_orga_exclusive %}
                        <a href="{{ request.event.orga_urls.information }}" class="nav-link nav-link-second-level{% if "speakers.information" in url_name %} active{% endif %}">
                            <span>{% trans "Speaker Information" %}</span>
                        </a>
                        {% endif %}
                    </div>
                    {% endif %}
                </div>
            {% endif %}
            {% if can_see_orga_exclusive %}

                <div class="nav-fold">
                    <span class="has-children">
                        <a class="nav-link nav-link-inner" href="{{ request.event.orga_urls.schedule }}">
                            <i class="fa fa-calendar-o"></i>
                            <span class="sidebar-text">{% trans "Schedule" %}</span>
                        </a>
                        <a class="arrow nav-link" data-toggle="collapse" href="#collapseSchedule" aria-controls="collapseSchedule">
                            <i class="fa fa-angle-down"></i>
                        </a>
                    </span>
                    <div class="collapse in{% if "schedule." in url_name %} show{% endif %}" aria-expand="true" id="collapseSchedule">
                        <a href="{{ request.event.orga_urls.schedule }}" class="nav-link nav-link-second-level{% if "schedule.main" in url_name %} active{% endif %}">
                            <span>{% trans "Editor" %}</span>
                        </a>
                        <a href="{{ request.event.orga_urls.room_settings }}" class="nav-link nav-link-second-level{% if "schedule.rooms." in url_name %} active{% endif %}">
                            <span>{% trans "Rooms" %}</span>
                        </a>
                        <a href="{{ request.event.orga_urls.schedule_export }}" class="nav-link nav-link-second-level{% if "schedule.export" in url_name %} active{% endif %}">
                            <span>{% trans "Export" %}</span>
                        </a>
                        <a href="{{ request.event.orga_urls.schedule_import }}" class="nav-link nav-link-second-level{% if "schedule.import" in url_name %} active{% endif %}">
                            <span>{% trans "Import" %}</span>
                        </a>
                    </div>
                </div>

                <div class="nav-fold">
                    <span class="has-children">
                        <a class="nav-link nav-link-inner" href="{{ request.event.orga_urls.outbox }}">
                            <i class="fa fa-envelope"></i>
                            <span class="sidebar-text">
                                {% trans "Mails" %}
                                {% if request.event.pending_mails %}<span class="pending-mails">{{ request.event.pending_mails }}</span>{% endif %}
                            </span>
                        </a>
                        <a class="arrow nav-link" data-toggle="collapse" href="#collapseMails" aria-controls="collapseMails">
                            <i class="fa fa-angle-down"></i>
                        </a>
                    </span>
                    <div class="collapse in{% if "mails." in url_name %} show{% endif %}" aria-expand="true" id="collapseMails">
                        <a href="{{ request.event.orga_urls.outbox }}" class="nav-link nav-link-second-level{% if "mails.outbox" in url_name %} active{% endif %}">
                            <span>{% trans "Outbox" %}</span>
                        </a>
                        <a href="{{ request.event.orga_urls.mail_templates }}" class="nav-link nav-link-second-level{% if "mails.templates" in url_name %} active{% endif %}">
                            <span>{% trans "Templates" %}</span>
                        </a>
                        <a href="{{ request.event.orga_urls.compose_mails }}" class="nav-link nav-link-second-level{% if "mails.compose" in url_name %} active{% endif %}">
                            <span>{% trans "Compose E-mails" %}</span>
                        </a>
                        <a href="{{ request.event.orga_urls.sent_mails }}" class="nav-link nav-link-second-level{% if "mails.sent" in url_name %} active{% endif %}">
                            <span>{% trans "Sent E-mails" %}</span>
                        </a>
                    </div>
                </div>
                {% for nav_element in nav_event %}
                    <a class="nav-link {% if nav_element.active %} active{% endif %}" href="{{ nav_element.url }}">
                        {% if nav_element.icon and "." in nav_element.icon %}
                        <img src="{% static nav_element.icon %}" class="fa-img" alt="{{ nav_element.label }}">
                        {% elif nav_element.icon %}
                            <i class="fa fa-{{ nav_element.icon }}"></i>
                        {% endif %}
                        <span class="sidebar-text">{{ nav_element.label }}</span>
                    </a>
                {% endfor %}
            {% endif %}
            {% else %}  {# if request.event #}
                <a class="nav-link {% if request.path == "/orga/event/" %} active{% endif %}" href="/orga/">
                    <i class="fa fa-calendar-o"></i>
                    <span>{% trans "Events" %}</span>
                </a>
                {% if can_see_organisers %}
                <a class="nav-link {% if "/orga/organiser/" in request.path %} active{% endif %}" href="/orga/organiser/">
                    <i class="fa fa-users"></i>
                    <span>{% trans "Organisers" %}</span>
                </a>
                {% endif %}
                {% if request.user.is_administrator %}
                <a class="nav-link {% if "/orga/admin/" in request.path %} active{% endif %}" href="/orga/admin/">
                    <i class="fa fa-users"></i>
                    <span>{% trans "Admin information" %}</span>
                </a>
                {% endif %}
                {% for nav_element in nav_global %}
                    <a class="nav-link {% if nav_element.active %} active{% endif %}" href="{{ nav_element.url }}">
                        {% if nav_element.icon and "." in nav_element.icon %}
                        <img src="{% static nav_element.icon %}" class="fa-img" alt="{{ nav_element.label }}">
                        {% elif nav_element.icon %}
                            <i class="fa fa-{{ nav_element.icon }}"></i>
                        {% endif %}
                        <span class="sidebar-text">{{ nav_element.label }}</span>
                    </a>
                {% endfor %}
            {% endif %}  {# if request.event #}
        </aside>
        <div id="page-content">
            <main>
                {% if messages %}
                    {% for message in messages %}
                        <div class="alert alert-{{ message.tags }}">
                            {{ message }}
                        </div>
                    {% endfor %}
                {% endif %}

                {% block content %}
                {% endblock %}
            </main>
            <footer>
                {% with "href='http://pretalx.com'" as a_attr %}
                    {% blocktrans trimmed %}
                        powered by <a {{ a_attr }}>pretalx</a>
                    {% endblocktrans %}
                {% endwith %}
                {% if development_warning %}
                    <span class="text-warning">&middot; {% trans "running in development mode" %}</span>
                {% endif %}
                {% if pretalx_version %}
                    <span>&middot;
                        {% if development_warning %}<a href="https://github.com/pretalx/pretalx/tree/{{ pretalx_version }}/">{{ pretalx_version }}</a>
                        {% else %}v{{ pretalx_version }}{% endif %}
                    </span>
                {% endif %}
            </footer>
        </div>
    </div>
    <span id="navigateUrl" data-remoteUrl="{{ request.event.orga_urls.url_list }}?search=%QUERY"></span>
    {% compress js %}
        <script defer src="{% static "orga/js/load_late.js" %}"></script>
        <script defer src="{% static "vendored/typeahead.bundle.min.js" %}"></script>
    {% endcompress %}
    {% if request.event %}
        {% compress js %}
            <script defer src="{% static "orga/js/navigate.js" %}"></script>
        {% endcompress %}
    {% endif %}
</body>
</html>
