From a446a7ddf00a700079960e73a9b82f46d22c6ce4 Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 7 May 2021 22:20:44 +0200 Subject: Added battle name to view page --- derelict.go | 5 +++-- view.tmpl | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/derelict.go b/derelict.go index 1c93399..1d49636 100644 --- a/derelict.go +++ b/derelict.go @@ -84,6 +84,7 @@ func handleRecent(w http.ResponseWriter, r *http.Request) { } func handleView(w http.ResponseWriter, r *http.Request) { - id := mux.Vars(r)["id"] - templates.ExecuteTemplate(w, "view", id) + battle := Battle{Id: mux.Vars(r)["id"]} + storage.LoadBattle(&battle) + templates.ExecuteTemplate(w, "view", &battle) } diff --git a/view.tmpl b/view.tmpl index ddb88a0..035509c 100644 --- a/view.tmpl +++ b/view.tmpl @@ -4,7 +4,7 @@ -{{.}} - Derelict +{{.Name}} - Derelict
-- cgit v1.1