blob: 3767ade95a8e89935feecc8a23d48ccaaf9c4b57 [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 "unit-meta"}}
<div class="UnitMeta">
<h2 class="go-textLabel">Details</h2>
{{template "unit-meta-details" .}}
<h2 class="go-textLabel">Repository</h2>
<div class="UnitMeta-repo">
{{if .Details.RepositoryURL}}
<a href="{{.Details.RepositoryURL}}" title="{{.Details.RepositoryURL}}" target="_blank" rel="noopener">
{{stripscheme .Details.RepositoryURL}}
</a>
{{else}}
Repository URL not available.
{{end}}
</div>
{{if or .Details.ReadmeLinks .Details.DocLinks .Details.ModuleReadmeLinks}}
<h2 class="go-textLabel">Links</h2>
<ul class="UnitMeta-links">
{{template "unit-meta-links" .Details.ReadmeLinks}}
{{template "unit-meta-links" .Details.DocLinks}}
{{template "unit-meta-links" .Details.ModuleReadmeLinks}}
</ul>
{{end}}
</div>
{{end}}
{{define "unit-meta-links"}}
{{range .}}
<li>
<a href="{{.Href}}" title="{{.Href}}" target="_blank" rel="noopener"
data-test-id="meta-link-{{.Body}}">{{.Body}}</a>
</li>
{{end}}
{{end}}
{{define "unit-meta-details-check"}}
<img class="go-Icon{{if .}} go-Icon--accented{{end}}"
{{- if . -}}
src="/static/shared/icon/check_circle_gm_grey_24dp.svg" alt="checked"
{{- else -}}
src="/static/shared/icon/cancel_gm_grey_24dp.svg" alt="unchecked"
{{- end -}}
height="24" width="24">
{{end}}
{{define "unit-meta-details"}}
<ul class="UnitMeta-details">
<li>
<details class="go-Tooltip js-tooltip" data-gtmc="tooltip">
<summary class="go-textSubtle">
{{template "unit-meta-details-check" .Unit.HasGoMod}}
Valid {{if .Unit.HasGoMod}}<a href="{{.Details.ModFileURL}}" target="_blank" rel="noopener">{{end}}go.mod{{if .Unit.HasGoMod}}</a>{{end}} file
<img class="go-Icon" src="/static/shared/icon/help_gm_grey_24dp.svg" alt="" height="24" width="24">
</summary>
<p>
The Go module system was introduced in Go 1.11 and is the official dependency management
solution for Go.
</p>
</details>
</li>
<li>
<details class="go-Tooltip js-tooltip" data-gtmc="tooltip">
<summary class="go-textSubtle">
{{template "unit-meta-details-check" .Unit.IsRedistributable}}
Redistributable license
<img class="go-Icon" src="/static/shared/icon/help_gm_grey_24dp.svg" alt="" height="24" width="24">
</summary>
<p>
Redistributable licenses place minimal restrictions on how software can be used,
modified, and redistributed.
</p>
</details>
</li>
<li>
<details class="go-Tooltip js-tooltip" data-gtmc="tooltip">
<summary class="go-textSubtle">
{{template "unit-meta-details-check" .Details.IsTaggedVersion}}
Tagged version
<img class="go-Icon" src="/static/shared/icon/help_gm_grey_24dp.svg" alt="" height="24" width="24">
</summary>
<p>Modules with tagged versions give importers more predictable builds.</p>
</details>
</li>
<li>
<details class="go-Tooltip js-tooltip" data-gtmc="tooltip">
<summary class="go-textSubtle">
{{template "unit-meta-details-check" .Details.IsStableVersion}}
Stable version
<img class="go-Icon" src="/static/shared/icon/help_gm_grey_24dp.svg" alt="" height="24" width="24">
</summary>
<p>When a project reaches major version v1 it is considered stable.</p>
</details>
</li>
<li class="UnitMeta-detailsLearn">
<a href="/about#best-practices-h2" data-gtmc="meta link">Learn more</a>
</li>
</ul>
{{end}}