{% comment %}
Copyright (C) 2015-2019  The Software Heritage developers
See the AUTHORS file at the top-level directory of this distribution
License: GNU Affero General Public License version 3, or any later version
See top-level LICENSE file for more information
{% endcomment %}

<!DOCTYPE html>

{% load js_reverse %}
{% load static %}
{% load render_bundle from webpack_loader %}
{% load swh_templatetags %}

<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>{% block title %}{% endblock %}</title>

    {% render_bundle 'vendors' %}
    {% render_bundle 'webapp' %}

    <script>
/*
@licstart  The following is the entire license notice for the JavaScript code in this page.

Copyright (C) 2015-2019  The Software Heritage developers

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

@licend  The above is the entire license notice for the JavaScript code in this page.
*/
    </script>

    <script>
      SWH_CONFIG = {{swh_client_config|jsonify}};
      swh.webapp.sentryInit(SWH_CONFIG.sentry_dsn);
    </script>

    <script src="{% url 'js_reverse' %}" type="text/javascript"></script>

    <script>
      swh.webapp.setSwhObjectIcons({{ swh_object_icons|jsonify }});
    </script>

    {% block header %}{% endblock %}

    <link rel="icon" href="{% static 'img/icons/swh-logo-32x32.png' %}" sizes="32x32" />
    <link rel="icon" href="{% static 'img/icons/swh-logo-archive-192x192.png' %}" sizes="192x192" />
    <link rel="apple-touch-icon-precomposed" href="{% static 'img/icons/swh-logo-archive-180x180.png' %}" />
    <link rel="search" type="application/opensearchdescription+xml" title="Software Heritage archive of public source code" href="{% static 'xml/swh-opensearch.xml' %}">
    <meta name="msapplication-TileImage" content="{% static 'img/icons/swh-logo-archive-270x270.png' %}" />

  </head>

  <body class="hold-transition layout-fixed sidebar-mini">
    <a id="top"></a>
    <div class="wrapper">
      <div class="swh-top-bar">
        <ul>
          <li>
            <a href="https://www.softwareheritage.org">Home</a>
          </li>
          <li>
            <a href="https://forge.softwareheritage.org/">Development</a>
          </li>
          <li>
              <a href="https://docs.softwareheritage.org/devel/">Documentation</a>
          </li>
          <li class="swh-position-right">
            {% if user.is_authenticated and user.is_staff %}
              Logged in as <strong>{{ user.username }}</strong>,
              <a href="{% url 'logout' %}">logout</a>
            {% else %}
              <a class="swh-donate-link" href="https://www.softwareheritage.org/donate">Donate</a>
            {% endif %}
          </li>
        </ul>
      </div>
      <nav class="main-header navbar navbar-expand-lg navbar-light navbar-static-top" id="swh-navbar">
        <div class="navbar-header">
          <a class="nav-link swh-push-menu" data-widget="pushmenu" href="#"><i class="fa fa-bars"></i></a>
        </div>
        <div class="navbar" style="width: 94%;">
          <div class="swh-navbar-content">
            {% block navbar-content %}{% endblock %}
          </div>
        </div>
      </nav>
    </div>

    <aside class="swh-sidebar main-sidebar sidebar-light-primary elevation-4">
      <a href="{% url 'swh-web-homepage' %}" class="brand-link">
        <img class="brand-image" src="{% static 'img/swh-logo.png' %}">
        <div class="brand-text sitename" href="{% url 'swh-web-homepage' %}">
          <span class="first-word">Software</span> <span class="second-word">Heritage</span>
        </div>
      </a>

      <a href="/" class="swh-words-logo">
        <div class="swh-words-logo-swh">
          <span class="first-word">Software</span>
          <span class="second-word">Heritage</span>
        </div>
        <span>Archive</span>
      </a>

      <div class="sidebar">
        <nav class="mt-2">
          <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
            <li class="nav-header">Archive Access</li>
            <li class="nav-item swh-browse-item" title="Explore the archive using a dedicated web interface">
              <a href="{% url 'browse-search' %}" class="nav-link swh-browse-link">
                <img class="nav-icon" src="{% static 'img/swh-browse.png' %}"/>
                <p>Browse</p>
              </a>
            </li>
            <li class="nav-item swh-api-1-item" title="Query the archive programmatically using a RESTful API">
              <a href="{% url 'api-1-homepage' %}" class="nav-link swh-api-1-link">
                <img class="nav-icon" src="{% static 'img/swh-api.png' %}"/>
                <p>Web API</p>
              </a>
            </li>
            <li class="nav-header">Features</li>
            <li class="nav-item swh-search-item" title="Search archived software">
              <a href="{% url 'browse-search' %}" class="nav-link swh-search-link">
                <i style="color: #e20026;" class="nav-icon fa fa-search"></i>
                <p>Search</p>
              </a>
            </li>
            <li class="nav-item swh-vault-item" title="Download archived software from the Vault">
              <a href="{% url 'browse-vault' %}" class="nav-link swh-vault-link">
                <img class="nav-icon" src="{% static 'img/swh-vault.png' %}"/>
                <p>Vault</p>
              </a>
            </li>
            <li class="nav-item swh-origin-save-item" title="Request the saving of a software origin into the archive">
              <a href="{% url 'origin-save' %}" class="nav-link swh-origin-save-link">
                <i style="color: #e20026;" class="nav-icon fa fa-download"></i>
                <p>Save code now</p>
              </a>
            </li>
            <li class="nav-header">Miscellaneous</li>
            <li class="nav-item swh-help-item" title="How to browse the archive ?">
              <a href="{% url 'browse-help' %}" class="nav-link swh-help-link">
                <i style="color: #e20026;" class="nav-icon fa fa-question"></i>
                <p>Help</p>
              </a>
            </li>
            {% if user.is_authenticated %}
              <li class="nav-header">Administration</li>
              <li class="nav-item swh-origin-save-admin-item" title="Save code now administration">
                <a href="{% url 'admin-origin-save' %}" class="nav-link swh-origin-save-admin-link">
                  <i style="color: #fecd1b;" class="nav-icon fa fa-download"></i>
                  <p>Save code now</p>
                </a>
              </li>
              <li class="nav-item swh-deposit-admin-item" title="Deposit administration">
                <a href="{% url 'admin-deposit' %}" class="nav-link swh-deposit-admin-link">
                  <i style="color: #fecd1b;" class="nav-icon fa fa-download"></i>
                  <p>Deposit</p>
                </a>
              </li>
            {% endif %}
          </ul>
        </nav>
      </div>
    </aside>

    <div class="content-wrapper">
      <section class="content">
        <div class="container">
          {% block content %}{% endblock %}
        </div>
      </section>
    </div>

    {% include "includes/global-modals.html" %}

    <footer class="footer">
      <div class="container text-center">
        <a href="https://www.softwareheritage.org">Software Heritage</a> &mdash;
        Copyright (C) 2015&ndash;{% now "Y" %}, The Software Heritage developers.
        License: <a href="https://www.gnu.org/licenses/agpl.html">GNU
        AGPLv3+</a>. <br /> The source code of Software Heritage <em>itself</em>
        is available on
        our <a href="https://forge.softwareheritage.org/">development
        forge</a>. <br /> The source code files <em>archived</em> by Software
        Heritage are available under their own copyright and licenses. <br />
        <span class="link-color">Terms of use: </span>
        <a href="https://www.softwareheritage.org/legal/bulk-access-terms-of-use/">Archive access</a>,
        <a href="https://www.softwareheritage.org/legal/api-1-terms-of-use/">API</a>-
        <a href="https://www.softwareheritage.org/contact/">Contact</a>-
        <a href="{% url 'jslicenses' %}" rel="jslicense">JavaScript license information</a>
      </div>
    </footer>
    <div id="back-to-top">
      <a href="#top"><img alt="back to top" src="{% static 'img/arrow-up-small.png' %}" /></a>
    </div>
  </body>

</html>
