internal,static/frontend: update other major versions style
The other major versions snippet is updated based on mocks:
https://gallery.googleplex.com/files/c46280fcc23b4aae99948b265e5c07d0:
* "Other module versions" is changed to "Other major versions"
* The link is displayed as a regular link instead of a chip
* This snippet is placed above "Other packages in this module" if both
are present
For golang/go#47320
Change-Id: I50fc522de97c773b9fc1bc72bd3cd395f7d2bc7f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/341449
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
diff --git a/internal/frontend/search.go b/internal/frontend/search.go
index 1481819..b5bcbdf 100644
--- a/internal/frontend/search.go
+++ b/internal/frontend/search.go
@@ -112,7 +112,7 @@
// Say "other" instead of "lower" because at some point we may
// prefer to show a tagged, lower major version over an untagged
// higher major version.
- OtherMajor: modulePaths("Other module versions:", r.OtherMajor),
+ OtherMajor: modulePaths("Other major versions:", r.OtherMajor),
}
if searchSymbols {
sr.SymbolName = r.SymbolName
diff --git a/static/frontend/search/search.tmpl b/static/frontend/search/search.tmpl
index 833d687..1d1a8c8 100644
--- a/static/frontend/search/search.tmpl
+++ b/static/frontend/search/search.tmpl
@@ -123,10 +123,18 @@
{{$v.Synopsis}}
</p>
{{template "search_metadata" $v}}
+ {{with .OtherMajor}}
+ <div>
+ <span class="go-textSubtle">{{.Heading}}</span>
+ {{range $i, $v := .Links}}
+ <a href="/{{$v.Href}}" data-gtmc="search result lower major" data-gtmv="{{$i}}"><strong>{{$v.Body}}</strong></a>
+ {{end}}
+ </div>
+ {{end}}
{{with .SameModule}}
{{$m := .}}
<div class="SearchSnippet-sub go-textSubtle">
- <a href="{{$v.ModulePath}}#section-directories">{{.Heading}}</a>
+ <a href="{{$v.ModulePath}}#section-directories"><strong>{{.Heading}}</strong></a>
{{range $i, $v := .Links}}
{{if lt $i 5}}
<a class="go-Chip go-Chip--subtle"
@@ -147,15 +155,6 @@
{{end}}
</div>
{{end}}
- {{with .OtherMajor}}
- <div class="SearchSnippet-sub go-textSubtle">
- <span>{{.Heading}}</span>
- {{range $i, $v := .Links}}
- <a class="go-Chip go-Chip--subtle" href="/{{$v.Href}}"
- data-gtmc="search result lower major" data-gtmv="{{$i}}">{{$v.Body}}</a>
- {{end}}
- </div>
- {{end}}
</div> <!-- SearchSnippet -->
{{end}}
</div>