<!DOCTYPE html>
<html lang="en-US">
<head>
  {{ template "head" .Data }}

  {{ if gt (len .Data.Namespaces ) 1 }}
  <script src="static/js/filter.js" type="module"></script>
  {{ end }}
</head>

<body class="layoutSidebar">
  <header class="layoutSidebar__sidebar">
    {{ template "navigation" . }}
  </header>

  <div class="layoutSidebar__main">
    <main class="verticalRhythm">
      <h1>Namespaces</h1>

      {{ if lt (len .Data.Namespaces) 1 }}
      <p>No namespaces are labelled for use by Goldilocks. Try labelling one with <code class="language-shell">kubectl label ns NAMESPACE_NAME vpa.bit.admin.ch/enabled=true</code></p>
      {{ else }}
        {{ if gt (len .Data.Namespaces) 1 }}
          {{ template "filter" .Data.Namespaces }}
        {{ end }}

      <ul aria-live="off" class="namespaceList" id="js-filter-container" role="list">
        {{ range .Data.Namespaces }}
        <li data-filter="{{ .Name }}">
          <a class="buttonLink --withIcon" href="{{ $.BasePath }}dashboard/{{ .Name }}">
            {{ .Name }}
            <i aria-hidden="true" class="fas fa-fw fa-chevron-right"></i>
          </a>
        </li>
        {{ end }}
      </ul>
      {{end}}
    </main>

    <footer>
      {{ template "footer" . }}
    </footer>
  </div>
</body>
</html>
