Show respondent names on admin page

This commit is contained in:
2020-10-04 14:54:41 -06:00
parent 235b826dbb
commit 3ad9b2955f
4 changed files with 56 additions and 35 deletions

View File

@ -365,6 +365,12 @@ func (h *handler) handleAdmin(w http.ResponseWriter, r *http.Request) {
return
}
// Build the respondents list
respondentsList := e.Ul()()
for _, r := range summary.RespondentNames {
respondentsList.Children = append(respondentsList.Children, e.Li()(hm.Text(r)))
}
// Build the counts table
dateSpan := metadata.Latest.Sub(metadata.Earliest)
var dates []date.Date
@ -426,8 +432,9 @@ func (h *handler) handleAdmin(w http.ResponseWriter, r *http.Request) {
a.Disabled(true),
),
),
e.H3()(hm.Text("Responses")),
e.P()(hm.Text(strconv.Itoa(summary.TotalResponses))),
e.H3()(hm.Text("Respondents")),
respondentsList,
e.H3()(hm.Text("Results")),
countsTable,
}
_ = h.writePage(w, "Edit your event", body)