carlos / todomvc-bakeoff Public

Clone
git clone https://amadan.net/carlos/todomvc-bakeoff

Plain git — no account needed to clone.

Download

Download this file

1<!doctype html>
2<html lang="en">
3 <head>
4 <meta charset="utf-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1">
6 <title>TodoMVC</title>
7 <link rel="stylesheet" href="/static/base.css?v={{.Version}}">
8 <link rel="stylesheet" href="/static/index.css?v={{.Version}}">
9 <link rel="stylesheet" href="/static/app.css?v={{.Version}}">
10 <noscript><link rel="stylesheet" href="/static/nojs.css?v={{.Version}}"></noscript>
11 <script type="module" src="/static/app.js?v={{.Version}}"></script>
12 </head>
13 <body>
14 <section class="todoapp">
15 <header class="header">
16 <h1>todos</h1>
17 <form class="inline" method="post" action="/todos">
18 <input type="hidden" name="filter" value="{{.Filter}}">
19 <input class="new-todo" name="title" placeholder="What needs to be done?" autocomplete="off"{{if not .EditID}} autofocus{{end}}>
20 </form>
21 </header>
22{{template "list" .}}
23 </section>
24 <footer class="info">
25 <p>Double-click to edit a todo</p>
26 <p>Created by <a href="https://bakeoff.bfj.oncarlos.com">the CARLOS bakeoff</a> · Go</p>
27 <p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
28 </footer>
29 </body>
30</html>
31{{define "list"}}{{if .Total}}
32 <section class="main">
33 <form class="inline" method="post" action="/todos/toggle-all">
34 <input type="hidden" name="filter" value="{{.Filter}}">
35 <input id="toggle-all" class="toggle-all" type="checkbox"{{if not .Active}} checked{{end}}>
36 <label for="toggle-all">Mark all as complete</label>
37 <button class="toggle-all-submit" data-action="toggle-all" title="{{if .Active}}Mark all as complete{{else}}Mark all as active{{end}}"></button>
38 </form>
39 <ul class="todo-list">
40{{- range .Items}}
41 <li{{if .Completed}} class="completed{{if eq .ID $.EditID}} editing{{end}}"{{else if eq .ID $.EditID}} class="editing"{{end}} data-id="{{.ID}}">
42 <div class="view">
43 <form class="inline" method="post" action="/todos/{{.ID}}/toggle">
44 <input type="hidden" name="filter" value="{{$.Filter}}">
45 <input class="toggle" type="checkbox"{{if .Completed}} checked{{end}}>
46 <label>{{.Title}}</label>
47 <button class="toggle-submit" data-action="toggle" title="{{if .Completed}}Mark as active{{else}}Mark as complete{{end}}"></button>
48 </form>
49 <a class="edit-link" data-action="edit" href="{{$.Path}}?edit={{.ID}}">edit</a>
50 <form class="inline" method="post" action="/todos/{{.ID}}/destroy">
51 <input type="hidden" name="filter" value="{{$.Filter}}">
52 <button class="destroy" aria-label="Delete"></button>
53 </form>
54 </div>
55 <form class="inline" method="post" action="/todos/{{.ID}}/edit">
56 <input type="hidden" name="filter" value="{{$.Filter}}">
57 <input class="edit" name="title" value="{{.Title}}" aria-label="Edit todo"{{if eq .ID $.EditID}} autofocus{{end}}>
58 </form>
59 </li>
60{{- end}}
61 </ul>
62 </section>
63 <footer class="footer">
64 <span class="todo-count"><strong>{{.Active}}</strong> {{if eq .Active 1}}item{{else}}items{{end}} left</span>
65 <ul class="filters">
66 <li>
67 <a{{if eq .Filter "all"}} class="selected"{{end}} href="/">All</a>
68 </li>
69 <li>
70 <a{{if eq .Filter "active"}} class="selected"{{end}} href="/active">Active</a>
71 </li>
72 <li>
73 <a{{if eq .Filter "completed"}} class="selected"{{end}} href="/completed">Completed</a>
74 </li>
75 </ul>
76{{- if .Completed}}
77 <form class="inline" method="post" action="/todos/clear-completed">
78 <input type="hidden" name="filter" value="{{.Filter}}">
79 <button class="clear-completed">Clear completed</button>
80 </form>
81{{- end}}
82 </footer>
83{{- end}}{{end}}
84