blob: 08e714e42a4455d5c89626e2da4d720b84398da5 [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 "main-styles"}}
<link href="/static/frontend/unit/importedby/importedby.css?version={{.AppVersionLabel}}" rel="stylesheet">
{{end}}
{{define "main-header"}}
{{template "unit-header" .}}
{{end}}
{{define "main-content"}}
{{block "importedby" .Details}}{{end}}
{{end}}
{{define "importedby"}}
<div class="ImportedBy">
{{if .ImportedBy}}
<div class="ImportedBy-heading">
<strong>Known {{pluralize .Total "importer"}}:</strong> {{.NumImportedByDisplay}}
</div>
{{template "sections" .ImportedBy}}
{{else}}
{{template "gopher-airplane" "No known importers for this package!"}}
{{end}}
</div>
{{end}}
{{define "sections"}}
<ul class="ImportedBy-list">
{{range .}}
{{template "section" .}}
{{end}}
</ul>
{{end}}
{{define "section"}}
{{if .Subs}}
<details class="ImportedBy-details">
<summary>{{.Prefix}} ({{.NumLines}})</summary>
<div class="ImportedBy-detailsContent">
{{template "sections" .Subs}}
</div>
</details>
{{else}}
<li class="ImportedBy-detailsIndent"><a class="u-breakWord" href="/{{.Prefix}}">{{.Prefix}}</a></li>
{{end}}
{{end}}