HTML-Seiten modularer aufgebaut und table.html hinzugefügt
This commit is contained in:
@ -8,16 +8,22 @@ import (
|
||||
"streifling.com/jason/sicherheitsunterweisung/packages/types"
|
||||
)
|
||||
|
||||
func DisplayTable(bs *[]types.Briefing) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
template.Must(template.ParseFiles("templates/index.html", "templates/table.html")).Execute(w, bs)
|
||||
}
|
||||
}
|
||||
|
||||
func DisplayForm(i *int64) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
template.Must(template.ParseFiles("templates/form.html")).Execute(w, i)
|
||||
template.Must(template.ParseFiles("templates/index.html", "templates/form.html")).Execute(w, i)
|
||||
}
|
||||
}
|
||||
|
||||
func AddParticipant(i *int64) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
*i++
|
||||
template.Must(template.ParseFiles("templates/form.html", "templates/participant.html")).ExecuteTemplate(w, "participant", i)
|
||||
template.Must(template.ParseFiles("templates/form.html")).ExecuteTemplate(w, "participant", i)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user