You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.5 KiB

{{define "content"}}
2 years ago
<section class="todoapp">
<header class="header">
<h1>todos</h1>
2 years ago
<form action="/todo" method="POST">
<input name="title" class="new-todo" placeholder="What needs to be done?" autofocus>
<button style="display: none;">Submit</button>
</form>
2 years ago
</header>
<!-- This section should be hidden by default and shown when there are todos -->
<section class="main">
<input id="toggle-all" class="toggle-all" type="checkbox">
<label for="toggle-all">Mark all as complete</label>
<ul class="todo-list">
{{range .Todos}}
{{template "_task.html" .}}
{{end}}
</ul>
</section>
<!-- This footer should be hidden by default and shown when there are todos -->
<footer class="footer">
<!-- This should be `0 items left` by default -->
2 years ago
<span class="todo-count"><strong>{{.Incomplete}}</strong> items left</span>
2 years ago
<!-- Remove this if you don't implement routing -->
<ul class="filters">
<li>
<a class="{{if eq .Only ""}}selected{{end}}" href="/">All</a>
2 years ago
</li>
<li>
<a class="{{if eq .Only "active"}}selected{{end}}" href="/?only=active">Active</a>
2 years ago
</li>
<li>
<a class="{{if eq .Only "completed"}}selected{{end}}" href="/?only=completed">Completed</a>
2 years ago
</li>
</ul>
<!-- Hidden if no completed items are left ↓ -->
2 years ago
<form action="/clear" method="POST">
<button class="clear-completed">Clear completed</button>
</form>
2 years ago
</footer>
</section>
{{end}}