<!--
  Copyright 2023 The Go Authors. All rights reserved.
  Use of this source code is governed by a BSD-style
  license that can be found in the LICENSE file.
-->

{{template "base" .}}

{{define "title"}}Go Telemetry / {{index .Charts.DateRange 1}}{{end}}

{{define "content"}}
<link rel="stylesheet" href="/static/charts.min.css">

<main id="main">
  <div class="Container">
    <div class="Content">
      <h1>Go Telemetry / {{index .Charts.DateRange 1}}</h1>
      <p>These charts were generated with data from {{.Charts.NumReports}} reports.</p>

      <section class="Index">
        <h2 id="index">Index</h2>
        <ul>
          <li>
            <a href="#charts">Charts</a>
            <ul>
              {{range .Charts.Programs}}
              <li>
                <a href="#{{.ID}}">{{.Name}}</a>
                <ul>
                  {{range .Charts}}
                  {{with .}}
                  <li>
                    <a href="#{{.ID}}">{{.Name}}</a>
                  </li>
                  {{end}}
                  {{end}}
                </ul>
              </li>
              {{end}}
            </ul>
          </li>
        </ul>
      </section>

      <section class="Charts">
        <h2 id="charts">Charts</h2>
        {{range .Charts.Programs}}
        <div class="Chart">
          <h3 id="{{.ID}}">
            {{.Name}}
          </h3>
          {{range .Charts}}
          {{with .}}
          <div>
            <h4 id="{{.ID}}">
              {{.Name}}
            </h4>
            <div data-chart-id="{{.ID}}"></div>
          </div>
          {{end}}
          {{end}}
        </div>
        {{end}}
      </section>
    </div>
  </div>
</main>

<script>
  window.Page = {{.}};
</script>
<script src="/static/charts.min.js"></script>
{{end}}