blob: 9671c93afe8c06b2e918a249e3bfba6c9620ec0e [file] [log] [blame]
<!--
Copyright 2020 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.
-->
{{define "robots"}}
<meta name="robots" content="noindex">
{{end}}
{{define "main-styles"}}
<link href="/static/frontend/unit/versions/versions.min.css?version={{.AppVersionLabel}}" rel="stylesheet">
{{end}}
{{define "main-header"}}
{{template "unit-header" .}}
{{end}}
{{define "main-content"}}
{{block "versions" .Details}}{{end}}
{{end}}
{{define "main-scripts"}}
<script>
loadScript("/static/frontend/unit/versions/versions.js")
</script>
{{end}}
{{/* . is internal/frontend.VersionsDetails */}}
{{define "versions"}}
<div class="Versions" data-test-id="UnitVersions">
<div class="Versions-title">
<h2 class="go-textTitle">Versions in this module</h2>
<div class="Versions-titleButtonGroup js-buttonGroup">
<button class="go-Button go-Button--inline js-versionsExpand" data-gtmc="versions button"
aria-label="Expand All Versions">
Expand all
</button>
<button class="go-Button go-Button--inline js-versionsCollapse" data-gtmc="versions button"
aria-label="Collapse All Versions">
Collapse all
</button>
</div>
</div>
{{template "version-list" .ThisModule}}
{{if .IncompatibleModules}}
<h2 class="Versions-modulesTitle">Incompatible versions in this module</h2>
{{template "version-list" .IncompatibleModules}}
{{end}}
{{if .OtherModules}}
<h2 class="Versions-modulesTitle">Other modules containing this package</h2>
{{range .OtherModules}}
<div><a href="/{{.}}">{{.}}</a></div>
{{end}}
{{end}}
</div>
{{end}}
{{/* . is []*internal/frontend.VersionList */}}
{{define "version-list"}}
<div class="Versions-list">
{{range $major := .}}
{{range $i, $v := $major.Versions}}
<div class="Version-major">
{{if and (eq $i 0) (not $major.Incompatible)}}
<strong>{{$major.Major}}</strong>
{{if $major.Deprecated}}<div><span class="go-Chip go-Chip--inverted">deprecated</span></div>{{end}}
{{end}}
</div>
<div class="Version-tag">
<a class="js-versionLink" href="{{$v.Link}}">{{$v.Version}}</a>
</div>
<div class="Version-dot{{if and $v.IsMinor (not $major.Incompatible)}} Version-dot--minor{{end}}"></div>
{{if and $v.Symbols (not $major.Incompatible)}}
{{template "symbol-history" $v}}
{{else}}
<div class="Version-commitTime">
{{$v.CommitTime}}{{if $v.Retracted}}<div><span class="go-Chip go-Chip--inverted">retracted</span></div>{{end}}
{{range $v.Vulns}}<div>{{template "vuln" .}}</div>{{end}}
</div>
{{end}}
{{end}}
{{end}}
</div>
{{end}}
{{define "symbol-history"}}
<details class="Version-details js-versionDetails">
<summary class="Version-summary">
{{.CommitTime}}{{if .Retracted}}<div><span class="go-Chip go-Chip--inverted">retracted</span></div>{{end}}
{{range .Vulns}}{{template "vuln" .}}{{end}}
</summary>
<div class="Versions-symbols">
<div class="Versions-symbolsHeader">Changes in this version</div>
{{range .Symbols}}
<div class="Versions-symbolSection">
{{range .}}
{{if eq .Kind "Type"}}
<div class="Versions-symbolType">
{{template "symbol" .}}
{{range .Children}}
<div class="Versions-symbolChild">{{template "symbol" .}}</div>
{{end}}
</div>
{{else}}
<div>{{template "symbol" .}}</div>
{{end}}
{{end}}
</div>
{{end}}
</div>
</details>
{{end}}
{{define "symbol"}}
<div>
{{if .New}}
<span class="Versions-symbolBulletNew">+</span>
<a class="Versions-symbolSynopsis" href="{{.Link}}">{{.Synopsis}}</a>
{{else}}
<span class="Versions-symbolOld Versions-symbolSynopsis">{{.Synopsis}}</span>
{{end}}
{{if .Builds}}
<span class="Versions-symbolBuildsDash"></span>
<span class="Versions-symbolBuilds">
{{range $i, $b := .Builds}}{{if $i}}, {{end}}{{$b}}{{end}}
</span>
{{end}}
</div>
{{end}}