<!DOCTYPE html>
<html lang="en">
<head>
  {% macro facebook_like(url) %}
  {% if site.facebook_app_id %}
  <div class="fb-like" data-href="{{ settings.SERVER_URL }}{{ url }}" data-width="10" data-layout="button_count" data-action="like" data-size="small" data-show-faces="true" data-share="true"></div>
  {% endif %}
  {% endmacro %}
{% block head %}
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<title>{{ settings.SITE_NAME }}: {% block title %}{{ site.title }}{% endblock title %}</title>

<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link href="/static/style/bootstrap.css" rel="stylesheet" type="text/css" />
<!--link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous"-->
<!--link rel='stylesheet' type='text/css' href='/static/style/fm.css' -->
<!-- jquery -->
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
      <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
      <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
{% if settings.GOOGLE_SITE_VERIFICATION %}
<meta name="google-site-verification" content="{{ settings.GOOGLE_SITE_VERIFICATION }}" />
{% endif %}
{% if settings.GOOGLE_ANALYTICS_ACCOUNT %}
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', '{{ settings.GOOGLE_ANALYTICS_ACCOUNT }}']);
  _gaq.push(['_trackPageview']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
{% endif %}
<script type="text/javascript">
$(function () {
  $.datepicker.setDefaults({ dateFormat: 'yy-mm-dd' });
  $(".date_picker").datepicker();
});
</script>
<script type="text/javascript" async
  src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
  tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>

<style>
h2 {
  color: #f7872a
}
h1, h3 {
  color: #007bff
}
.paper {
  color: #f7872a
}
.person {
  color: #007bff
}
a.admin {
 background-color: yellow;
}
</style>

{% endblock head %}
<!-- site_parameters.header_injection START -->
<!-- see /admin/main/siteparameters/ -->
{{ site.header_injection|safe }}
<!-- site_parameters.header_injection END -->
</head>


<body>
{% if site.facebook_app_id %}
  <div id="fb-root"></div>
  <script>(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.9&appId={{ site.facebook_app_id }}";
    fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
  </script>
{% endif %}
  <div class="container px-0" style="background-color: #e8f8e8">
    {% if site.title_banner %}
    <div class="row">
      <div class="col text-center" style="background-color: #fff">
        <img class="noborder" style="max-width: 100%" src="{{ site.title_banner.url }}" alt="{{ site.title }}" />
      </div>
    </div>
    {% endif %}
    <div class="row">
      <div class="col">
        <nav class="navbar navbar-dark navbar-expand-lg bg-secondary mb-2 rounded-top">
          {% if 0 %}
          <a class="navbar-brand" href="{{ root_url }}">
                {{ site.title }}
          </a>
          {% endif %}
{% block top_menu %}
          <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
          </button>
          <div class="collapse navbar-collapse" id="navbarNav">
            <ul class="top navbar-nav">
              <li class="nav-item"><a class="nav-link{% if request.path == '/' %} active{% endif %}" href='{{ root_url }}'>home</a></li>
              <li class="nav-item"><a class="nav-link{% if request.path == '/mail/' %} active{% endif %}"  href='{{ root_url }}mail/'>mail</a></li>
    {% if settings.PAPERS_ENABLED %}
              <li class="nav-item"><a class="nav-link{% if request.path == '/papers/' %} active{% endif %}"  href='{{ root_url }}papers/'>papers</a></li>
              <li class="nav-item"><a class="nav-link{% if request.path == '/persons/' %} active{% endif %}"  href='{{ root_url }}persons/'>authors</a></li>
    {% else %}
              <li class="nav-item"><a class="nav-link{% if request.path == '/persons/' %} active{% endif %}"  href='{{ root_url }}persons/'>people</a></li>
    {% endif %}
              <li class="nav-item"><a class="nav-link{% if request.path == '/newss/' %} active{% endif %}"  href='{{ root_url }}newss/'>news</a></li>
              <li class="nav-item"><a class="nav-link{% if request.path == '/seminars/' %} active{% endif %}"  href='{{ root_url }}seminars/'>seminars</a></li>
              <li class="nav-item"><a class="nav-link{% if request.path == '/events/' %} active{% endif %}"  href='{{ root_url }}events/'>events</a></li>
              <li class="nav-item"><a class="nav-link{% if request.path == '/positions/' %} active{% endif %}"  href='{{ root_url }}positions/'>open&nbsp;positions</a></li>
    {% if user and user.is_authenticated %}
      {% if person_requests %}
              <li class="nav-item"><a class="nav-link{% if request.path == '/person_requests/' %} active{% endif %}"  class="alert" href='{{ root_url }}person_requests/'>requests ({{ person_requests }})</a></li>
      {% endif %}
      {% if user.is_staff or user.is_superuser %}
              <li class="nav-item"><a class="nav-link{% if request.path == '/logs/' %} active{% endif %}"  href='{{ root_url }}logs/'><b>log</b></a></li>
              <li class="nav-item"><a class="nav-link{% if request.path == '/users/' %} active{% endif %}"  href='{{ root_url }}users/'><b>users</b></a></li>
      {% endif %}
      {% if user.person %}
              <li class="nav-item"><a class="nav-link{% if request.path == user.person.url %} active{% endif %}"  href='{{ user.person.url() }}'><b>{{ user.username }}</b></a></li>
      {% endif %}
              <li class="nav-item"><a class="nav-link"  href='{{ root_url }}logout/'><b>logout</b></a></li>
    {% else %}
              <li class="nav-item"><a class="nav-link"  href='{{ root_url}}login/{% if request %}?next={{ request.path|urlencode() }}'{% endif %}>login</a></li>
    {% endif %}
  {% endblock top_menu %}
            </ul>
{{ facebook_like('/') }}
          </div>
  {% block search %}
    {% if site.google_custom_search_id %}
          <div class="ml-auto">
            <div class="gcse-search"></div>
          </div>
    {% endif %}
  {% endblock search %}
        </nav>
      </div>
    </div>

{% block messages %}
    <div class="row">
      <div class="col">
  {% for message in messages %}
        <div class="card mb-2 ">
          <div class="card-body rounded text-dark {% if message.tags %} {{ message.tags }}{% endif %}">
            {{ message }}
          </div>
        </div>
  {% endfor %}
      </div>
    </div>
{% endblock messages %}

    <div class="row">
      <div class="col-12 col-lg-6">
{% block headers %}
{% endblock headers %}
      </div>
      
      <div class="col-6 col-lg-3">
{% block years %}
  {% if years %}
        <p>
    {% for y in years %}
      {% if y == year %}
        <b>{{ y }}</b>
      {% else %}
        <a href='?year={{ y }}'>{{ y }}</a>
      {% endif %}
    {% endfor %}
        </p>
  {% endif %}
{% endblock years %}
      </div>

      <div class="col-6 col-lg-3">
{% block info %}
  {% if info %}
        <p>
    {% for item in info %}
        <b>{{ item.field }}:</b> {{ item.value }} <br>
    {% endfor %}
        </p>
  {% endif %}
{% endblock info %}
      </div>
    </div>
    <div class="row">
      <div class="col">
        {% block content %}
        Work in progress...
        {% endblock content %}
      </div>
    </div>
    <div class="row">
      <div class="col">
        {% block bottom_menu %}
        <nav class="navbar navbar-dark navbar-expand-lg bg-secondary mb-2 rounded-bottom">
          <ul class="top navbar-nav">
            <li class="nav-item">
              <a class="nav-link"
                href="https://bitbucket.org/paolini/piprints/src/master/">
                piprints {{ settings.VERSION }} 
              </a>
            </li>
            <li class="nav-item">
                <a class="nav-link{% if request.path == '{{ root_url }}credits/' %} active{% endif %}" 
                  href="{{ root_url }}credits/">Credits</a> 
            </li>
            <li class="nav-item">
                <a class="nav-link{% if request.path == '{{ root_url }}cookies/' %} active{% endif %}" 
                  href="{{ root_url }}cookies/">Cookie policy</a>
            </li>
          </ul>
          {% if settings.CONTACT_EMAIL %}
          <ul class="navbar-nav ml-auto">
            <li class="nav-item">
                <a class="nav-link" 
                  href="mailto:{{ settings.CONTACT_EMAIL }}">Contact: {{ settings.CONTACT_EMAIL }}</a>
            </li>
          </ul>
          {% endif %}
            <!--li class="nav-item">
                <a class="nav-link" 
                  href="https://validator.w3.org/check?uri=referer">HTML 5</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" 
                  href="https://jigsaw.w3.org/css-validator/check/referer">CSS 2.1</a>
            </li-->
          </ul>
        </nav>  
        {% endblock bottom_menu %}
      </div>
    </div>
  </div> 

  {% if settings.COOKIES_ALERT_ENABLED == 'True' %}
<!-- Cookie information -->
<script src="/static/js/cookiechoices.js"></script>
<script>
  document.addEventListener('DOMContentLoaded', function(event) {
    cookieChoices.showCookieConsentBar('This website uses cookies to offer you the best experience. By using our website, you agree to our use of cookies in accordance to our cookie policy.',
      'OK, I agree', 'Learn more', '{{ root_url }}cookies/');
  });
</script>
{% endif %}

{% if settings.PIWIK_URL %}
<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  if (!cookieChoices.cookiesEnabled()) {
    _paq.push(['disableCookies']);
  }
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://{{ settings.PIWIK_URL }}";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', {{ settings.PIWIK_SITE_ID }}]);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript';
    g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
  })();
</script>
<noscript><p><img src="https://{{ settings.PIWIK_URL }}piwik.php?idsite={{ settings.PIWIK_SITE_ID }}" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->
{% endif %}

<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<!--script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

<!-- site_parameters.footer_injection START -->
<!-- see /admin/main/siteparameters/ -->
{{ site.footer_injection|safe }}
<!-- site_parameters.footer_injection END -->

</body>
</html>
