rm datastar-ep-2 bc too complex
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user