From 5dbb80121d29174fd8dee26ccd278ca4372c1387 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sun, 4 May 2025 08:47:22 +0300 Subject: [PATCH] Feat: add error template --- components/error.html | 9 +++++++++ components/room.html | 3 ++- handlers/auth.go | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 components/error.html diff --git a/components/error.html b/components/error.html new file mode 100644 index 0000000..2fe8b70 --- /dev/null +++ b/components/error.html @@ -0,0 +1,9 @@ +{{define "error"}} + + + +{{end}} diff --git a/components/room.html b/components/room.html index 3117cff..c80210e 100644 --- a/components/room.html +++ b/components/room.html @@ -2,7 +2,8 @@
{{template "teampew" "blue"}} + {{template "cardtable" .}} - {{template "cardtable" "red"}} + {{template "teampew" "red"}}
{{end}} diff --git a/handlers/auth.go b/handlers/auth.go index c908b62..056851b 100644 --- a/handlers/auth.go +++ b/handlers/auth.go @@ -16,6 +16,7 @@ import ( ) func abortWithError(w http.ResponseWriter, msg string) { + w.WriteHeader(500) tmpl := template.Must(template.ParseGlob("components/*.html")) tmpl.ExecuteTemplate(w, "error", msg) }