{% load static %}
{% load compress %}
{% load i18n %}
<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE }}">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, user-scalable=no">
    <title>{% trans 'c3nav map editor' %}</title>
    {% if favicon %}
        <link href="{% static favicon %}" rel="icon">
    {% endif %}
    {% if favicon_package %}
        <link rel="apple-touch-icon" sizes="180x180" href="{% static 'favicon_package/apple-touch-icon.png' %}">
        <link rel="manifest" href="{% static 'favicon_package/site.webmanifest' %}">
        <link rel="mask-icon" href="{% static 'favicon_package/safari-pinned-tab.svg' %}" color="{{ primary_color }}">
        <meta name="apple-mobile-web-app-title" content="c3nav">
        <meta name="application-name" content="c3nav">
        <meta name="msapplication-TileColor" content="{{ primary_color }}">
        <meta name="msapplication-config" content="{% static 'favicon_package/browserconfig.xml' %}">
    {% endif %}
    <meta name="theme-color" media="(prefers-color-scheme: light)" content="{{ active_theme.theme_color_light }}" />
    <meta name="theme-color" media="(prefers-color-scheme: dark)" content="{{ active_theme.theme_color_dark }}" />
    {% if randomize_primary_color %}
        <style id="c3nav-theme-randomized-primary-color">
            :root {
                --color-primary: {{ primary_color }}
            }
        </style>
    {% endif %}
    <style>{{ active_theme.css_vars | striptags | safe }}</style>
    {% compress css %}
        <link href="{% static 'fonts/fonts.css' %}" rel="stylesheet">
        <link href="{% static 'bootstrap/css/bootstrap.css' %}" rel="stylesheet">
        <link href="{% static 'leaflet/leaflet.css' %}" rel="stylesheet">
        <link href="{% static 'editor/css/editor.scss' %}" rel="stylesheet" type="text/x-scss">
    {% endcompress %}
  <style>{{ active_theme.css_extra | striptags | safe }}</style>
  </head>
  <body{% if request.mobileclient %} data-user-data="{{ user_data_json }}" data-count-display="{{ request.changeset.count_display }}"{% if request.changeset.pk%} data-has-changeset{% endif %}{% if request.changeset.direct_editing%} data-direct-editing{% endif %}{% endif %}>

    {% if not request.mobileclient %}
    <nav class="navbar navbar-static-top navbar-default">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false">
                    <span class="sr-only">{% trans 'Toggle navigation' %}</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="{% url 'editor.index' %}">
                    {% if header_logo %}<img src="{% static header_logo %}">{% else %}c3nav{% endif %}
                    {% trans 'map editor' %}
                </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar-collapse">
                {% block addnav %}
                {% endblock %}
            </div>
        </div>
    </nav>
    {% endif %}

    {% block subheader %}
    {% endblock %}

    <div id="main">
    {% block content %}
    {% endblock %}
    </div>

    <div class="scancollector form-control empty">
        <p>
            <a class="btn btn-xs btn-primary start">{% trans 'Start scanning' %}</a>
            <a class="btn btn-xs btn-default stop">{% trans 'Stop scanning' %}</a>
            <a class="btn btn-xs btn-danger reset">{% trans 'Reset scan results' %}</a>
        </p>
        <p class="nomobileclient"><em>
            {% trans 'mobileclient not found. Please install the c3nav app for wifi scanning support.' %}
        </em></p>
        <p><span class="count-line"><span class="wifi-count">0</span> WiFi scans</span></p>
        <table class="wifi-table">
            <thead><tr><th>BSSID</th><th>SSID</th><th>Match</th><th>RSSI</th></tr></thead>
            <tbody></tbody>
        </table>
        <p><span class="count-line"><span class="ibeacon-count">0</span> iBeacon scans</span></p>
        <table class="ibeacon-table">
            <thead><tr><th>Major</th><th>Minor</th><th>Match</th><th>Dist</th></tr></thead>
            <tbody></tbody>
        </table>
    </div>

    <div class="theme-editor-filter">
        <div class="btn-group" role="group">
          <button type="button" class="btn btn-default active" data-all>{% trans 'All' %}</button>
          <button type="button" class="btn btn-default" data-base-theme>{% trans 'In base theme' %}</button>
          <button type="button" class="btn btn-default" data-any-theme>{% trans 'In any theme' %}</button>
        </div>
    </div>
    <span class="theme-color-info">{% trans 'Other theme colors' %}</span>

    {% include 'site/fragment_fakemobileclient.html' %}
    {% compress js %}
        <script type="text/javascript" src="{% static 'jquery/jquery.js' %}"></script>
        <script type="text/javascript" src="{% static 'bootstrap/js/bootstrap.js' %}"></script>
        <script type="text/javascript" src="{% static 'leaflet/leaflet.js' %}"></script>
        <script type="text/javascript" src="{% static 'leaflet/leaflet.editable.js' %}"></script>
        <script type="text/javascript" src="{% static 'c3nav/js/api.js' %}"></script>
        <script type="text/javascript" src="{% static 'editor/js/editor.js' %}"></script>
    {% endcompress %}
  </body>
</html>
