cmd/coordinator: consistently dim columns for builders with known issue

Now that both "ok" and "fail" cells have a link to the build log,
their presentation has become more similar than dissimilar.
Combine their previously-distinct presentation into one large block
with nested if statements to show "ok" vs "fail" states appropriately.

Always include a paragraph about a known builder issue, if any,
in all the cells that are dimmed out.

While here, apply the same change to the golang.org/x repo section,
bringing them to feature parity. (Previously, builders with a known
issue weren't dimmed out down there.)

Fixes golang/go#42405.
Fixes golang/go#42063.

Change-Id: I601fcfdc1aa67ad43665624b6894f213cf5b251b
Reviewed-on: https://go-review.googlesource.com/c/build/+/370334
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
diff --git a/cmd/coordinator/internal/legacydash/static/style.css b/cmd/coordinator/internal/legacydash/static/style.css
index 6705935..b6b8a6f 100644
--- a/cmd/coordinator/internal/legacydash/static/style.css
+++ b/cmd/coordinator/internal/legacydash/static/style.css
@@ -227,11 +227,12 @@
   overflow: hidden;
   word-wrap: none;
 }
- 
-.good   { text-decoration: none; color: #000000; border: 2px solid #00E700}
-.bad    { text-decoration: none; text-shadow: 1px 1px 0 #000000; color: #FFFFFF; background: #E70000;}
-.noise  { text-decoration: none; color: #888; }
-.fail   { color: #C00; }
+
+.build .good   { text-decoration: none; color: #000000; border: 2px solid #00E700}
+.build .bad    { text-decoration: none; text-shadow: 1px 1px 0 #000000; color: #FFFFFF; background: #E70000;}
+.build .fail   { color: #C00; }
+.build .noise,
+.build a.noise { text-decoration: none; color: #888; }
 
 /* pagination */
  
diff --git a/cmd/coordinator/internal/legacydash/ui.html b/cmd/coordinator/internal/legacydash/ui.html
index 6532be3..0eef321 100644
--- a/cmd/coordinator/internal/legacydash/ui.html
+++ b/cmd/coordinator/internal/legacydash/ui.html
@@ -92,7 +92,10 @@
         <th></th>
         <th></th>
     {{range $.Builders}}
-        <th class="result arch{{if (unsupported .)}} unsupported{{end}}{{if knownIssue .}} noise{{end}}" title="{{.}}">{{builderSubheading .}}</th>
+        {{$ki := knownIssue .}}
+        <th class="result arch{{if (unsupported .)}} unsupported{{end}}{{if $ki}} noise{{end}}" title="{{.}}
+          {{- with $ki}}{{"\n\n"}}This builder has a known issue. See go.dev/issue/{{.}}.{{end}}"
+        >{{builderSubheading .}}</th>
     {{end}}
       </tr>
 
@@ -102,7 +105,10 @@
         <th></th>
         <th></th>
     {{range $.Builders}}
-        <th class="result arch{{if (unsupported .)}} unsupported{{end}}{{if knownIssue .}} noise{{end}}" title="{{.}}">{{builderSubheading2 .}}</th>
+        {{$ki := knownIssue .}}
+        <th class="result arch{{if (unsupported .)}} unsupported{{end}}{{if $ki}} noise{{end}}" title="{{.}}
+          {{- with $ki}}{{"\n\n"}}This builder has a known issue. See go.dev/issue/{{.}}.{{end}}"
+        >{{builderSubheading2 .}}</th>
     {{end}}
       </tr>
 
@@ -130,15 +136,16 @@
             <td class="result{{if (unsupported .)}} unsupported{{end}}">
             {{if and (eq $.Repo "go") (isUntested $builderName "go" $.Branch "")}}•{{else}}
               {{with $c.Result $builderName $h}}
+                {{$ki := knownIssue $builderName}}
                 {{if .BuildingURL}}
-                  <a href="{{.BuildingURL}}"><img src="https://golang.org/favicon.ico" height=16 width=16 border=0></a>
-                {{else if .OK}}
-                  <a href="/log/{{.LogHash}}" class="ok{{if knownIssue $builderName}} noise{{end}}"
-                    title="Build log of {{$builderName}} on commit {{shortHash $c.Hash}}{{with $h}} (using Go commit {{shortHash .}}){{end}}.">ok</a>
-                {{else if knownIssue $builderName}}
-                  <a href="/log/{{.LogHash}}" class="noise" title="Builder {{$builderName}} has a known issue. See golang.org/issue/{{knownIssue $builderName}}.">fail</a>
+                  <a href="{{.BuildingURL}}"><img src="https://go.dev/favicon.ico" height=16 width=16 border=0></a>
                 {{else}}
-                  <a href="/log/{{.LogHash}}" class="fail">fail</a>
+                  <a href="/log/{{.LogHash}}"
+                    class="{{if .OK}}ok{{else}}fail{{end}}
+                      {{- if $ki}} noise{{end}}"
+                    title="Build log of {{$builderName}} on commit {{shortHash $c.Hash}}{{with $h}} (using Go commit {{shortHash .}}){{end}}.
+                      {{- with $ki}}{{"\n\n"}}This builder has a known issue. See go.dev/issue/{{.}}.{{end}}"
+                  >{{if .OK}}ok{{else}}fail{{end}}</a>
                 {{end}}
               {{else}}
                 &nbsp;
@@ -204,7 +211,10 @@
         <th></th>
         <th></th>
         {{range $builders}}
-          <th class="result arch{{if (unsupported .)}} unsupported{{end}}" title="{{.}}">{{builderSubheading .}}</th>
+          {{$ki := knownIssue .}}
+          <th class="result arch{{if (unsupported .)}} unsupported{{end}}{{if $ki}} noise{{end}}" title="{{.}}
+            {{- with $ki}}{{"\n\n"}}This builder has a known issue. See go.dev/issue/{{.}}.{{end}}"
+          >{{builderSubheading .}}</th>
         {{end}}
       </tr>
       <tr class="subheading2">
@@ -214,7 +224,10 @@
         <th></th>
         <th></th>
         {{range $builders}}
-          <th class="result arch{{if (unsupported .)}} unsupported{{end}}" title="{{.}}">{{builderSubheading2 .}}</th>
+          {{$ki := knownIssue .}}
+          <th class="result arch{{if (unsupported .)}} unsupported{{end}}{{if $ki}} noise{{end}}" title="{{.}}
+            {{- with $ki}}{{"\n\n"}}This builder has a known issue. See go.dev/issue/{{.}}.{{end}}"
+          >{{builderSubheading2 .}}</th>
         {{end}}
       </tr>
     {{range $pkg := .Packages}}
@@ -235,13 +248,16 @@

             {{else}}
               {{with $pkg.Commit.Result $builderName $goHash}}
+                {{$ki := knownIssue $builderName}}
                 {{if .BuildingURL}}
-                  <a href="{{.BuildingURL}}"><img src="https://golang.org/favicon.ico" height=16 width=16 border=0></a>
-                {{else if .OK}}
-                  <a href="/log/{{.LogHash}}" class="ok"
-                    title="Build log of {{$builderName}} on commit {{shortHash $h}} (using Go commit {{shortHash $goHash}}).">ok</a>
+                  <a href="{{.BuildingURL}}"><img src="https://go.dev/favicon.ico" height=16 width=16 border=0></a>
                 {{else}}
-                  <a href="/log/{{.LogHash}}" class="fail">fail</a>
+                  <a href="/log/{{.LogHash}}"
+                    class="{{if .OK}}ok{{else}}fail{{end}}
+                      {{- if $ki}} noise{{end}}"
+                    title="Build log of {{$builderName}} on commit {{shortHash $h}} (using Go commit {{shortHash $goHash}}).
+                      {{- with $ki}}{{"\n\n"}}This builder has a known issue. See go.dev/issue/{{.}}.{{end}}"
+                  >{{if .OK}}ok{{else}}fail{{end}}</a>
                 {{end}}
               {{else}}
                 &nbsp;