Michael Thomson 6f7bcc9503
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
postgres and such
2024-06-17 23:37:43 -04:00

23 lines
661 B
Plaintext

package pages
import "michaelthomson.dev/mthomson/go-todos-app/templates/shared"
import "michaelthomson.dev/mthomson/go-todos-app/templates/partials"
import "michaelthomson.dev/mthomson/go-todos-app/models"
templ Home(todos []models.Todo) {
@shared.Page("Todos") {
<div class="flex 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">
for _, todo := range todos {
@partials.Todo(todo)
}
</div>
</div>
}
}