chore: click to edit
This commit is contained in:
parent
c22ab0a793
commit
e6b99f5420
|
@ -17,6 +17,7 @@ var demoUser user = user{
|
|||
|
||||
func Handlers(prefix string, mux *http.ServeMux) {
|
||||
mux.HandleFunc(prefix+"/", index)
|
||||
mux.HandleFunc(prefix, index)
|
||||
mux.HandleFunc(prefix+"/contact/1", putUser)
|
||||
mux.HandleFunc(prefix+"/contact/1/edit", editForm)
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ templ Form(u user) {
|
|||
</div>
|
||||
<div class="field is-grouped">
|
||||
<div class="control"><button class="button is-black">Submit</button></div>
|
||||
<div class="control"><button class="button" hx-get="/click-to-edit/contact/1">Cancel</button></div>
|
||||
<div class="control"><button class="button" hx-get="/click-to-edit">Cancel</button></div>
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
|
|
|
@ -572,7 +572,7 @@ func Form(u user) templ.Component {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = templBuffer.WriteString(" hx-get=\"/click-to-edit/contact/1\"")
|
||||
_, err = templBuffer.WriteString(" hx-get=\"/click-to-edit\"")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ templ Layout(title string) {
|
|||
</style>
|
||||
}
|
||||
</head>
|
||||
<body hx-boost="true">
|
||||
<body>
|
||||
@Nav()
|
||||
<div id="content" class="container p-5 content">
|
||||
{ children... }
|
||||
|
|
|
@ -169,16 +169,7 @@ if err != nil {
|
|||
return err
|
||||
}
|
||||
// Element (standard)
|
||||
_, err = templBuffer.WriteString("<body")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Element Attributes
|
||||
_, err = templBuffer.WriteString(" hx-boost=\"true\"")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = templBuffer.WriteString(">")
|
||||
_, err = templBuffer.WriteString("<body>")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue