feat(results): qualifying place (TQ) next to final results and podium bands for the top three (1.74.0)
This commit is contained in:
1 parent
41043a990d
commit
fee9f8073d
12 files changed
+149
-38
No files matched your search
+11
-3
@@ -1,6 +1,14 @@
|
||||
// Gold / silver / bronze medal for places 1-3 in result tables; other places stay a plain number.
|
||||
// The medal still holds the number, so text, CSV and the print table decoration keep working.
|
||||
// Gold / silver / bronze medal for places 1-3 in result tables (also A1-A3 in the finals);
|
||||
// other places stay as they are. The medal still holds the text, so CSV, sorting and the print
|
||||
// table decoration keep working.
|
||||
export function medal(pos) {
|
||||
const value = String(pos ?? "").trim();
|
||||
return ["1", "2", "3"].includes(value) ? `<span class="medal medal-${value}">${value}</span>` : value;
|
||||
const place = /^A?([1-3])$/.exec(value)?.[1];
|
||||
return place ? `<span class="medal medal-${place}">${value}</span>` : value;
|
||||
}
|
||||
|
||||
// The driver's qualifying place next to a final result; the top qualifier gets a "TQ" badge.
|
||||
export function qualCell(qual, escapeHtml) {
|
||||
const value = String(qual || "").trim();
|
||||
return `<td class="qual-cell">${value === "TQ" ? '<span class="tq-badge">TQ</span>' : escapeHtml(value || "-")}</td>`;
|
||||
}
|
||||
Reference in new issue
Block a user