{% load static %}

<!DOCTYPE html>
<html
        dir="{% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}"
        xml:lang="{% firstof LANGUAGE_CODE 'en' %}"
        lang="{% firstof LANGUAGE_CODE 'en' %}">
<head>
    <title>{% block title %}{{page_title|striptags}}{% endblock %} | Rig Information Gathering System</title>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="theme-color" content="#3853a4">
    <meta name="color-scheme" content="light dark">

    <link rel="icon" type="image/png" href="{% static 'imgs/pyrigs-avatar.png' %}">
    <link rel="apple-touch-icon" href="{% static 'imgs/pyrigs-avatar.png' %}">

    <link rel="stylesheet" type="text/css" href="{% static 'css/screen.css' %}">
    {% block css %}
    {% endblock %}

    <script src="{% static 'js/jpop.js' %}"></script>
    {% block preload_js %}
    {% endblock %}

    {% block extra-head %}{% endblock %}
</head>

<body>
<a class="skip-link" href='#main'>Skip to content</a>
{% block navbar %}
{% if request.user.current_event %}
<div class="bg-primary d-flex justify-content-between align-items-center"><span class="ml-2">You are currently checked in to <a href="{{request.user.current_event.event.get_absolute_url}}" class="text-white">{{request.user.current_event.event}}</a></span><a href="{% url 'event_checkout'%}" class="btn btn-warning">Check Out</a></div>
{% endif %}
<nav class="navbar navbar-expand-lg navbar-dark bg-dark" role="navigation">
  <div class="container">
      <a class="navbar-brand" href="{% if request.user.is_authenticated %}https://rigs.nottinghamtec.co.uk{%else%}https://nottinghamtec.co.uk{%endif%}">
        <img src="{% static 'imgs/logo.webp' %}" class="mr-auto" style="max-height: 40px; position: absolute; left: 0.5em; top: 0;" alt="TEC's Logo: Serif 'TEC' vertically next to a blue box with the words 'PA and Lighting', surrounded by graduated rings" id="logo">
      </a>
      {% block titleheader %}
      {% endblock %}
      <button class="navbar-toggler ml-auto" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation" onclick="document.getElementById('logo').classList.toggle('d-none');">
      <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse justify-content-between" id="navbarSupportedContent">
        <ul class="navbar-nav">
            {% block titleelements %}
            {% endblock %}
        </ul>
        <ul class="navbar-nav align-self-end">
            {% block titleelements_right %}
            {% endblock %}
        </ul>
      </div>
  </div>
</nav>
{% endblock %}
<div class="container py-4" id="main">
    {% block content-header %}
        {% if error %}
            <div class="error">{{ error }}</div>{% endif %}
        {% if info %}
            <div class="info">{{ info }}</div>{% endif %}
        {% if messages %}
            {% for message in messages %}
                <div class="alert alert-{{ message.level_tag }} alert-dismissible" role="alert">
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    {{ message }}
                </div>
            {% endfor %}
        {% endif %}
    {% endblock %}
    {% if page_title and not request.is_ajax %}
    <h2>{{page_title|safe}}</h2>
    {% endif %}
    {% block content %}{% endblock %}
</div>

<div class="modal fade" id="modal" role="dialog" tabindex=-1></div>

<script src="{% static 'js/base.js' %}"></script>
{% include 'partials/dark_theme.html' %}

{% block js %}
{% endblock %}
</body>
</html>
