Refactor html templates
This commit entirely refactors the use of html templates. Instead of inheriting from a shared template, we insert the results into a base template.
This commit is contained in:
parent
6ede99d7c6
commit
d235ee4e5c
59 changed files with 869 additions and 777 deletions
|
|
@ -5,6 +5,8 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
|
||||
_ "embed"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/httpx/field"
|
||||
"github.com/gorilla/csrf"
|
||||
)
|
||||
|
|
@ -173,3 +175,9 @@ func (form *Form[D]) renderSuccess(data D, values map[string]string, w http.Resp
|
|||
}
|
||||
form.renderForm(err, values, w, r)
|
||||
}
|
||||
|
||||
//go:embed "form.html"
|
||||
var formBytes []byte
|
||||
|
||||
// FormTeplate is a template to embed a form
|
||||
var FormTemplate = template.Must(template.New("form.html").Parse(string(formBytes)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue