question.html erstellt

This commit is contained in:
Jason Streifling 2023-10-10 18:43:48 +02:00
parent 2b119f6752
commit 82870e100f
3 changed files with 16 additions and 2 deletions

View File

@ -23,7 +23,7 @@ func main() {
mux.HandleFunc("/search/", server.DisplayResults(db))
mux.HandleFunc("/new-briefing/", server.DisplayForm(&i))
mux.HandleFunc("/add-participant/", server.AddParticipant(&i))
mux.HandleFunc("/submit/", server.SubmitForm(db, &i, &j))
mux.HandleFunc("/submit-form/", server.SubmitForm(db, &i, &j))
log.Fatalln(http.ListenAndServe(":8080", mux))
}

View File

@ -49,7 +49,7 @@
{{ template "participant" . }}
</div>
<button type="submit" hx-post="/submit/" hx-target="#content" hx-swap="innerHTML">
<button type="submit" hx-post="/submit-form/" hx-target="#content" hx-swap="innerHTML">
Senden
</button>
</form>

14
templates/question.html Normal file
View File

@ -0,0 +1,14 @@
{{ define "question" }}
<div id="question-{{ .QuestionNumber }}">
<h2>Frage {{ .QuestionNumber }}
<p>{{ .Question }}</p
<label for="participant-first-input-{{ . }}">Vorname</label>
<input type="text" name="participant-first-{{ . }}" id="participant-first-input-{{ . }}" />
<label for="participant-last-input-{{ . }}">Nachname</label>
<input type="text" name="participant-last-{{ . }}" id="participant-last-input-{{ . }}" />
<label for="participant-company-input-{{ . }}">Firma</label>
<input type="text" name="participant-company-{{ . }}" id="participant-company-input-{{ . }}" />
</div>
{{ end }}