rename to datastar-ep-1 and cp datastar-ep-2

This commit is contained in:
2025-12-09 02:47:45 +01:00
parent 5a43abbdc7
commit a42bb627a0
14 changed files with 277 additions and 0 deletions
@@ -0,0 +1,12 @@
<li id="new-todo-row">
<form data-on-submit="@post('/todo')">
<input
type="text"
name="name"
data-bind-newtodo
placeholder="Nueva tarea..."
autofocus
/>
<button type="submit">enviar</button>
</form>
</li>
@@ -0,0 +1,15 @@
<li id="todo-{{ .ID }}">
<button
{{
if
.Completed
}}
disabled
{{
end
}}
data-on-click="@patch('/todo/{{.ID}}/completed')"
>
{{ .ID }} {{ .Name }} - {{ .Completed }}
</button>
</li>
@@ -0,0 +1,9 @@
<div id="todo-container">
<h2>Listado de tareas</h2>
<button data-on-click="@get('/todo/new')">Nueva tarea</button>
<ol id="todo-list-body">
{{ range .TodoList }} {{ template "fragments/todo-row" . }} {{ end }}
</ol>
</div>