Michael Thomson 3d29dadaf3
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
update: service, handlers, and db separation
2024-06-14 17:49:56 -04:00

21 lines
571 B
Plaintext

package pages
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"
templ Home(todos []db.Todo) {
@shared.Page("Todos") {
<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">
for _, todo := range todos {
@partials.Todo(todo)
}
</div>
}
}