db, handlers, and interfaces
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/dryrun Pipeline was successful
ci/woodpecker/push/publish-tag Pipeline was successful
ci/woodpecker/push/publish-latest Pipeline was successful

This commit is contained in:
2024-06-15 21:33:14 -04:00
parent 3d29dadaf3
commit 09a957ca4b
12 changed files with 160 additions and 95 deletions

View File

@@ -11,10 +11,10 @@ import "io"
import "bytes"
import "michaelthomson.dev/mthomson/go-todos-app/templates/shared"
import "michaelthomson.dev/mthomson/go-todos-app/db"
import "michaelthomson.dev/mthomson/go-todos-app/templates/partials"
import "michaelthomson.dev/mthomson/go-todos-app/models"
func Home(todos []db.Todo) templ.Component {
func Home(todos []models.Todo) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
@@ -33,7 +33,7 @@ func Home(todos []db.Todo) templ.Component {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"text-xl\">Todos</div><form hx-post=\"/todos\" hx-target=\"#todos\" hx-swap=\"beforeend\"><input name=\"name\" type=\"text\"> <button type=\"submit\">Submit</button></form><div id=\"todos\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"flex content-center items-center flex-col\"><h1 class=\"text-3xl\">Todos</h1><form hx-post=\"/todos\" hx-target=\"#todos\" hx-swap=\"beforeend\"><input name=\"name\" type=\"text\" class=\"border border-black\"> <button type=\"submit\">Submit</button></form><div id=\"todos\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -43,7 +43,7 @@ func Home(todos []db.Todo) templ.Component {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}