Skip to content

Commit

Permalink
content: add text to versions tab when tagged version is missing
Browse files Browse the repository at this point in the history
When a series has tagged versions, but the current module version does
not, the versions tab will now display the message "No tagged versions in
this module." instead of displaying nothing.

For golang/go#41345

Change-Id: I2137187532bce18d1c60bc7aa138e14a6fb7e559
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/266141
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
  • Loading branch information
julieqiu committed Nov 4, 2020
1 parent 9ae2b0e commit 3d8acd9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions content/static/css/stylesheet.css
Expand Up @@ -1368,6 +1368,10 @@ pre {
font-weight: 400;
font-size: 1rem;
}
.Versions-message {
color: var(--gray-3);
margin-bottom: 2rem;
}
.Versions-modulePath {
color: var(--gray-3);
font-size: 1rem;
Expand Down
6 changes: 5 additions & 1 deletion content/static/html/helpers/_versions.tmpl
Expand Up @@ -29,7 +29,11 @@
{{if .OtherModules}}
<h2>Versions in this module</h2>
{{end}}
{{template "module_list" .ThisModule}}
{{if .ThisModule}}
{{template "module_list" .ThisModule}}
{{else}}
<p class="Versions-message">There are no tagged versions of this module.</p>
{{end}}
{{if .OtherModules}}
<h2>Other modules containing this package</h2>
{{template "module_list" .OtherModules}}
Expand Down

0 comments on commit 3d8acd9

Please sign in to comment.