Skip to content

Commit 7ca486c

Browse files
committed
web: tweak check count rendering
In the patch list S/W/F column, only render the worst severity as a colored pill. The other counts are shown as plain text so that the eye is drawn to the most important signal. Signed-off-by: Robin Jarry <rjarry@redhat.com>
1 parent 17633f7 commit 7ca486c

1 file changed

Lines changed: 25 additions & 13 deletions

File tree

‎pkg/web/patches.templ‎

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -248,22 +248,34 @@ templ tagCounts(abbrevs []string, tags map[string]int) {
248248
}
249249

250250
templ checkCounts(counts [4]int) {
251-
if counts[1] > 0 {
252-
<check-ok>{ intStr(counts[1]) }</check-ok>
253-
} else {
254-
{ "-" }
255-
}
256-
{ "/" }
257-
if counts[2] > 0 {
258-
<check-warn>{ intStr(counts[2]) }</check-warn>
259-
} else {
260-
{ "-" }
261-
}
262-
{ "/" }
263251
if counts[3] > 0 {
252+
if counts[1] > 0 {
253+
{ intStr(counts[1]) }
254+
} else {
255+
{ "-" }
256+
}
257+
{ "/" }
258+
if counts[2] > 0 {
259+
{ intStr(counts[2]) }
260+
} else {
261+
{ "-" }
262+
}
263+
{ "/" }
264264
<check-fail>{ intStr(counts[3]) }</check-fail>
265+
} else if counts[2] > 0 {
266+
if counts[1] > 0 {
267+
{ intStr(counts[1]) }
268+
} else {
269+
{ "-" }
270+
}
271+
{ "/" }
272+
<check-warn>{ intStr(counts[2]) }</check-warn>
273+
{ "/-" }
274+
} else if counts[1] > 0 {
275+
<check-ok>{ intStr(counts[1]) }</check-ok>
276+
{ "/-/-" }
265277
} else {
266-
{ "-" }
278+
{ "-/-/-" }
267279
}
268280
}
269281

0 commit comments

Comments
 (0)