<!DOCTYPE html>
<html>
<head>
  <title>{{ title }}</title>
  <meta charset="utf-8">
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/hint.css@2.6.0/hint.min.css" integrity="sha256-UMhOZKeAbUSd/AoZKm+rlqzsBhzI7dTOYf2Euns4Es8=" crossorigin="anonymous">
  <meta name="referrer" content="no-referrer">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <style type="text/css">
    a {
      color: inherit;
    }
    a:hover {
      text-decoration: none;
    }
    .navbar-toggler {
      cursor: pointer;
    }
    @media screen and (max-width: 767px) {
      .hint--medium--xs:after {
        white-space: normal;
        line-height: 1.4em;
        word-wrap: break-word;
      }
    }
  </style>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-light bg-light sticky-top">
  <a href="" class="navbar-brand">{{ title }}</a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="main-nav" aria-controls="main-nav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>

  <div id="main-nav" class="collapse navbar-collapse">
    <ul class="navbar-nav mr-auto">
      {% for sid, _ in servers %}
        <li class="nav-item">
          <a class="nav-link" href="#sid{{ sid }}">Server {{ sid }}</a>
        </li>
      {% endfor %}
    </ul>
    {% if debug %}
    <span class="navbar-text" style="color: red">debug mode</span>
    {% endif %}
  </div>
</nav>

<div class="container-fluid">
  {% for server in servers %}
    <h1 class="display-4" id="sid{{ server.sid }}">
      <a href="#sid{{ server.sid }}">Server {{ server.sid }}</a>
    </h1>
    {% include 'stats.jinja2' %}
  {% endfor %}
  <small>Generated by <a href="https://github.com/Thor77/TeamspeakStats" rel="noopener">TeamspeakStats</a> at {{ creation_time|frmttime }}</small>
</div>

<script type="text/javascript">
  (function() {
    var collapseTogglers = document.querySelectorAll('[data-toggle="collapse"]');
    var toggleTarget;
    Array.prototype.forEach.call(collapseTogglers, function(toggler) {
      toggler.addEventListener('click', function(event) {
        toggleTarget = document.getElementById(toggler.dataset.target);
        if (toggler.getAttribute('aria-expanded') === 'true') {
          toggleTarget.classList.add('collapse');
          toggler.setAttribute('aria-expanded', false);
        } else {
          toggleTarget.classList.remove('collapse');
          toggler.setAttribute('aria-expanded', true);
        }
      });
    });
  })();
</script>
</body>
</html>
