{% load staticfiles %}
{% load avatar_tags %}
{% load tags %}
{% load compress %}

<!DOCTYPE html>
<html lang="en" ng-app>
  <head>
    <meta charset="utf-8">
    <title>SatNOGS DB{% block title %}{% endblock title %}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    {% compress css %}
      <link rel="stylesheet" href="{% static 'lib/bootstrap/dist/css/bootstrap.min.css' %}">
      <link rel="stylesheet" href="{% static 'css/app.css' %}">
      {% block css %}{% endblock %}
    {% endcompress %}

    <link rel="shortcut icon" href="{% static 'favicon.ico' %}">

  </head>

  <body>
    {{ stage_notice }}

    <div class="container">
      <nav class="navbar navbar-default" role="navigation" id="main-navbar">
        <div class="container-fluid">
          <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
              <span class="sr-only">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 'home' %}">
              <img id="navbar-logo" src="{% static 'img/satnogs_db.png' %}" alt="SatNOGS net">
            </a>
          </div>

          <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
              <li class="{% active request 'home' %}"><a href="{% url 'home' %}">Home</a></li>
              <li class="{% active request 'about' %}"><a href="{% url 'about' %}">About</a></li>
              <li class="{% active request 'stats' %}"><a href="{% url 'stats' %}">Statistics</a></li>
              <li class="{% active request 'faq' %}"><a href="{% url 'faq' %}">FAQ</a></li>
              <li><a href="https://community.libre.space/c/satnogs/" target="_blank">Community</a></li>
              <li><a href="https://wiki.satnogs.org/" target="_blank">Wiki</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
              <li><a href="https://www.timeanddate.com/worldclock" target="_blank" class="hidden-sm"><span id="current_utc">--:-- UTC</span></a></li>
              {% if request.user.is_authenticated %}
              <li class="dropdown">
                <a href="#"
                   class="dropdown-toggle"
                   data-toggle="dropdown">{% avatar request.user 35 %} {{ request.user.username }}
                   <span class="caret"></span>
                </a>
                <ul class="dropdown-menu" role="menu">
                  <li><a href="{% url 'users_edit' %}">Settings</a></li>
                  {{ logout_block }}
                </ul>
              </li>
              {% else %}
                {{ auth_block }}
              {% endif %}
            </ul>
          </div>
        </div>
      </nav>
    </div>

    <div class="container">

      {% if messages %}
        <div class="row messages">
          <div class="col-md-12">
            {% for notification in messages %}
              <div class="alert alert-{{ notification.tags }}" role="alert">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                  <span aria-hidden="true">&times;</span>
                </button>
                {{ notification.message }}
              </div>
            {% endfor %}
          </div>
        </div>
      {% endif %}

      {% block top %}{% endblock %}

      {% block content %}{% endblock content %}

    </div>

    <footer>
      <div class="container">
        <hr>
        <div class="row">
          <div class="col-md-6">
            <span class="glyphicon glyphicon-copyright-mark" aria-hidden="true"></span> 2014<span id="copy"></span>
            <a href="http://librespacefoundation.org/" target="_blank">Libre Space Foundation</a>.<br>
            <span class="glyphicon glyphicon-cloud" aria-hidden="true"></span>
            Transmitter data are freely distributed under the
            <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank">CC BY-SA</a> license.
          </div>
          <div class="col-md-6 text-right footer-options">
            <a href="https://satnogs.org/" target="_blank">SatNOGS</a> |
            <a href="#top">Back to top</a>
            <p>
              {{ version }}
              <br>
              {{ decoders_version }}
            </p>
          </div>
        </div>
      </div>
    </footer>

    {% compress js %}
      <script src="{% static 'lib/jquery/dist/jquery.min.js' %}"></script>
      <script src="{% static 'lib/bootstrap/dist/js/bootstrap.min.js' %}"></script>
      <script src="{% static 'js/app.js' %}"></script>
      <script src="{% static 'js/current_utc.js'%}"></script>
      {% block javascript %}{% endblock javascript %}
      {{ analytics_code }}
    {% endcompress %}
</body>
</html>
