aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-04-11 19:22:06 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-04-11 19:22:06 +0200
commit96f3f2ea79fcb1293039e051bcd67c88b26175b9 (patch)
tree91910ca776312f497f4b86d3e039d260c20833c5
parent9cd56d71a84c470aa92422144a76d42c8ff6d11d (diff)
dashboard/app: fix anchors for namespaces
The human readable caption is a bad value for anchor, also potentially changing over time. Restore the namespace name as anchor as it should be.
-rw-r--r--dashboard/app/main.go7
-rw-r--r--dashboard/app/main.html2
2 files changed, 6 insertions, 3 deletions
diff --git a/dashboard/app/main.go b/dashboard/app/main.go
index b612635ac..0f679ecf5 100644
--- a/dashboard/app/main.go
+++ b/dashboard/app/main.go
@@ -77,6 +77,7 @@ type uiBugPage struct {
}
type uiBugNamespace struct {
+ Name string
Caption string
CoverLink string
FixedLink string
@@ -422,9 +423,11 @@ func fetchNamespaceBugs(c context.Context, accessLevel AccessLevel, ns string,
if !onlyFixed {
fixedLink = fmt.Sprintf("?fixed=%v", ns)
}
+ cfg := config.Namespaces[ns]
uiNamespace := &uiBugNamespace{
- Caption: config.Namespaces[ns].DisplayTitle,
- CoverLink: config.Namespaces[ns].CoverLink,
+ Name: ns,
+ Caption: cfg.DisplayTitle,
+ CoverLink: cfg.CoverLink,
FixedCount: fixedCount,
FixedLink: fixedLink,
Groups: uiGroups,
diff --git a/dashboard/app/main.html b/dashboard/app/main.html
index d3f1b2638..d522444eb 100644
--- a/dashboard/app/main.html
+++ b/dashboard/app/main.html
@@ -111,7 +111,7 @@ Main page.
{{range $ns := $.BugNamespaces}}
<br>
- <h2 id="{{$ns.Caption}}">{{$ns.Caption}}</h2>
+ <h2 id="{{$ns.Name}}">{{$ns.Caption}}</h2>
{{if $ns.FixedLink}}
{{if $ns.CoverLink}}
<a href="{{$ns.CoverLink}}" target="_blank">source coverage</a> |