From 7a84c81a705548189c064facd589e221d46374ad Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Tue, 24 Feb 2026 16:22:33 +0000 Subject: [PATCH] Show upload details on upload section --- html/func.go | 14 ++++++++++ html/template/sync/pool-by-id.html | 41 +++++++++++------------------- sync/routes.go | 2 +- sync/upload.go | 2 +- 4 files changed, 31 insertions(+), 28 deletions(-) diff --git a/html/func.go b/html/func.go index 89986841..63995c9e 100644 --- a/html/func.go +++ b/html/func.go @@ -27,6 +27,7 @@ func addFuncMap(t *template.Template) { "duration": duration, "hasPassed": hasPassed, "html": unescapeHTML, + "iconUploadStatus": iconUploadStatus, "json": unescapeJS, "GISStatement": gisStatement, "latLngDisplay": latLngDisplay, @@ -140,6 +141,19 @@ func hasPassed(t time.Time) bool { return t.Before(time.Now()) } +func iconUploadStatus(s string) string { + switch s { + case "error": + return "bi-exclamation" + case "parsed": + return "bi-check-circle" + case "uploaded": + return "bi-arrow-clockwise" + default: + return "bi-question" + } +} + // FormatTimeDuration returns a human-readable string representing a time.Duration // as "X units early" or "X units late" func timeDelta(d time.Duration) string { diff --git a/html/template/sync/pool-by-id.html b/html/template/sync/pool-by-id.html index f7bd5a15..382a0649 100644 --- a/html/template/sync/pool-by-id.html +++ b/html/template/sync/pool-by-id.html @@ -8,7 +8,7 @@ >