blob: 7a252ccf2f7a4da9fcd20d49016fb08b506f8e98 [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 .IsGoProject .DepsDevURL .Details.ReadmeLinks .Details.DocLinks .Details.ModuleReadmeLinks}}
<h2 class="go-textLabel">Links</h2>
<ul class="UnitMeta-links">
{{if .IsGoProject}}
<li>
<a href="https://go.dev/security/policy"
title="Report security issues in the Go standard library and sub-repositories">
<img class="go-Icon" height="24" width="24" src="/static/shared/icon/security_grey_24dp.svg" alt="">
Report a Vulnerability
</a>
</li>
{{end}}
{{with .DepsDevURL}}
<li>
<a href="{{.}}" title="View this module on Open Source Insights"
target="_blank" rel="noopener" data-test-id="meta-link-depsdev">
<img class="depsdev-Icon" src="/static/shared/icon/depsdev-logo.svg"
alt="Open Source Insights Logo" />
Open Source Insights
</a>
</li>
{{end}}
{{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" data-gtmc="meta link">Learn more about best practices</a>
</li>
</ul>
{{end}}