{% load compress %}
{% load staticfiles %}
{% load i18n %}
{% load rules %}
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <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.org{% endif %}{% endblock %}">
    {% if request.event and request.event.logo %}<meta property="thumbnail" content="{{ request.event.urls.logo.full }}">{% endif %}
    {% if request.event and request.event.logo %}<meta property="og:image" content="{{ request.event.urls.logo.full }}">{% endif %}
    <meta name="og:title" content="{% block social_title %}{% endblock %} {% if request.event %}{{ request.event.name }} {% endif %}">
    <meta name="og:description" content="{% block social_description %}{% if request.event %}Schedule, talks and talk submissions for {{ request.event.name }}{% else %}Talks and talk submissions by pretalx.org{% endif %}{% endblock %}">
    <meta name="og:url" content="{{ request.build_absolute_uri }}">
    <meta name="twitter:card" content="summary">

    <meta name="keywords" content="{% if request.event %}{{ request.event.name }}, {{ request.event.slug }}, {% endif %}schedule, talks, cfp, call for papers">
    <meta name="generator" content="pretalx.org">
    <meta name="robots" content="index,follow">
    <meta name="referrer" content="no-referrer-when-downgrade">
    <meta name="theme-color" content="{% if request.event and request.event.primary_color %}{{ request.event.primary_color }}{% else %}#1C4A3B{% endif %}">
    <meta name="HandheldFriendly" content="True"/>

    <title>{% block title %}{% endblock %} {% if request.event %}:: {{ request.event.name }} {% endif %}:: pretalx</title>

    <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 "vendored/fullcalendar/fullcalendar.min.css" %}"/>
    {% if request.event and request.event.settings.cfp_css_file %}
        <link rel="stylesheet" type="text/css" href="{{ request.event.settings.cfp_css_file }}"/>
    {% else %}
        {% compress css %}
            <link rel="stylesheet" type="text/x-scss" href="{% static "cfp/scss/main.scss" %}"/>
            <link type="text/x-scss" rel="stylesheet" href="{% static "agenda/scss/main.scss" %}" />
        {% endcompress %}
    {% endif %}
    {% compress js %}
        <script type="text/javascript" src="{% static "vendored/jquery-3.1.1.js" %}"></script>
        <script type="text/javascript" src="{% static "vendored/popper.js" %}"></script>
        <script type="text/javascript" src="{% static "vendored/tether/tether.min.js" %}"></script>
        <script type="text/javascript" src="{% static "vendored/bootstrap/dist/js/bootstrap.js" %}"></script>

        <script type="text/javascript" src="{% static "vendored/moment-with-locales.js" %}"></script>
        <script type="text/javascript" src="{% static "vendored/moment-timezone-with-data-2012-2022.js" %}"></script>
        <script type="text/javascript" src="{% static "vendored/fullcalendar/fullcalendar.min.js" %}"></script>
        <script type="text/javascript" src="{% static "common/js/availabilities.js" %}"></script>
    {% endcompress %}
    {% block custom_header %}
    {% endblock %}
    {% if request.event and request.event.custom_css %}
        <link rel="stylesheet" type="text/css" href="{{ request.event.custom_css.url }}"/>
    {% endif %}
</head>
<body>
<div id="wrapper">
    <div id="top-bg" class="bg-primary">
        {% if request.event and not request.event.is_public and not is_html_export %}
            <div class="event-nonpublic">
                <span class="fa fa-user-secret"></span>
                {% blocktrans trimmed %}
                    This event is currently non-public. Only the orga team can see it.
                {% endblocktrans %}
            </div>
        {% endif %}
    </div>
    <div class="container" id="main-container">
        <header>
            <h1>
                <a href="{% block nav_link %}{% endblock %}">
                    {% if request.event and request.event.logo %}
                        <img src="{{ request.event.logo.url }}" id="event-logo"></img>
                    {% elif request.event %}
                        {{ request.event }}
                    {% endif %}
                </a>
            </h1>
            {% if request.event and request.event.locales|length > 1 %}
                <div class="locales">
                    {% for l, name in request.event.named_locales %}
                        <a href="{% url "cfp:locale.set" event=request.event.slug %}?locale={{ l }}&next={{ request.path }}%3F{{ request.META.QUERY_STRING|urlencode }}"
                                class="{% if l == request.LANGUAGE_CODE %}active{% endif %}">{{ name }}</a>
                    {% endfor %}
                    {% if request.user.is_anonymous %}
                    • <a href="{{ request.event.urls.login }}">login</a>
                    {% endif %}
                </div>
            {% endif %}
        </header>
        <section class="card" id="main">
            {% if request.event and request.user.is_authenticated and not is_html_export %}
                <div class="user-row">
                    <div class="pull-right">
                        {% has_perm 'orga.view_orga_area' request.user request.event as can_see_orga_area %}
                        {% if can_see_orga_area %}
                        <a href="{{ request.event.orga_urls.base }}">{% trans "Orga area" %}</a> &middot;
                        {% endif %}
                        <a href="{% url "cfp:event.user.submissions" event=request.event.slug %}">
                            {% trans "My submissions" %}
                        </a> &middot;
                        <a href="{% url "cfp:event.logout" event=request.event.slug %}">{% trans "Logout" %}</a>
                    </div>
                    {% url "cfp:event.user.view" event=request.event.slug as userurl %}
                    {% blocktrans trimmed with nick=request.user.nick attr="href='"|add:userurl|add:"'"|safe %}
                        You are logged in as <a {{ attr }}>{{ nick }}</a>.
                    {% endblocktrans %}
                </div>
            {% endif %}
            <div class="content">
                {% if messages %}
                    {% for message in messages %}
                        <div class="alert alert-{{ message.tags }}">
                            {{ message }}
                        </div>
                    {% endfor %}
                {% endif %}

                {% block content %}
                {% endblock %}
            </div>
        </section>
        <footer>
            {% if is_html_export %}
            <div id="exporttimestamp" class="text-muted">
                {% now "Y-m-d H:i T" as timestamp %}
                {% blocktrans trimmed %}
                    This is a static export generated at {{ timestamp }}
                {% endblocktrans %}
            </div>
            {% endif %}
            <a href="http://pretalx.org" target="_blank" rel="noopener">
                <img src="{% static "common/img/logo.svg" %}">
            </a>
            {% if request.event %}
                &middot;
                <a href="mailto:{{ request.event.email }}">{% trans "Contact us" %}</a>
            {% endif %}
        </footer>
    </div>
</div>
</body>
</html>

