From 0da89f0e6c8e7cb267b1ecc59fb87226f85d2817 Mon Sep 17 00:00:00 2001 From: Brandon Dyck Date: Tue, 29 Sep 2020 20:25:02 -0600 Subject: [PATCH] Make admin fields read-only --- front/server.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/front/server.go b/front/server.go index a6ccaaf..329c041 100644 --- a/front/server.go +++ b/front/server.go @@ -371,11 +371,15 @@ func (h *handler) handleAdmin(w http.ResponseWriter, r *http.Request) { e.Input( a.Name(fieldNameEventName), a.Value(metadata.Name), + a.Disabled(true), ), e.Br(), e.Label(a.For(fieldNameDescription))(hm.Text("Description")), - e.Textarea(a.Name(fieldNameDescription))(hm.Text(metadata.Description)), + e.Textarea( + a.Name(fieldNameDescription), + a.Disabled(true), + )(hm.Text(metadata.Description)), e.Br(), e.Label(a.For(fieldNameEarliest))(hm.Text("Earliest date")), @@ -383,6 +387,7 @@ func (h *handler) handleAdmin(w http.ResponseWriter, r *http.Request) { a.Name(fieldNameEarliest), a.Type("date"), a.Value(metadata.Earliest.Format(formDateLayout)), + a.Disabled(true), ), e.Br(), @@ -391,10 +396,8 @@ func (h *handler) handleAdmin(w http.ResponseWriter, r *http.Request) { a.Name(fieldNameLatest), a.Type("date"), a.Value(metadata.Latest.Format(formDateLayout)), + a.Disabled(true), ), - e.Br(), - - e.Input(a.Type("submit")), ), e.H3()(hm.Text("Responses")), e.P()(hm.Text(strconv.Itoa(responses.TotalResponses))),