-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathtodos.jade
82 lines (73 loc) · 1.92 KB
/
todos.jade
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
head
title Todos
body
#top-tag-filter
{{> tag_filter}}
#main-pane
{{> todos}}
#side-pane
{{> lists}}
template(name="lists")
h3 Todo Lists
#lists
{{#each lists}}
div(class="list {{selected}}")
{{#if editing}}
.edit
input(class="list-name-input", id="list-name-input", type="text", value="{{name}}")
{{else}}
.display
a(class="list-name {{name_class}}", href="/{{_id}}") {{name}}
{{/if}}
{{/each}}
#createList
input(type="text", id="new-list", placeholder="New list")
template(name="todos")
{{#if any_list_selected}}
#items-view
#new-todo-box
input(type="text", id="new-todo", placeholder="New item")
ul#item-list
{{#each todos}}
{{> todo_item}}
{{/each}}
{{/if}}
template(name="todo_item")
li(class="todo {{done_class}}")
{{#if editing}}
.edit
input(id="todo-input", type="text", value="{{text}}")
{{else}}
.destroy
.display
//
// /!\ We can not set an attribute like that, Jade will fail!
// input(class="check", name="markdone", type="checkbox", {{done_checkbox}})
//
{{#if done_checkbox}}
input(class="check", name="markdone", type="checkbox", checked="checked")
{{else}}
input(class="check", name="markdone", type="checkbox")
{{/if}}
.todo-text {{text}}
{{/if}}
.item-tags
{{#each tag_objs}}
.tag.removable_tag
.name {{tag}}
.remove
{{/each}}
{{#if adding_tag}}
.tag.edittag
input(type="text", id="edittag-input", value="")
{{else}}
.tag.addtag +tag
{{/if}}
template(name="tag_filter")
div(id="tag-filter", class="tag-list")
.label Show:
{{#each tags}}
div(class="tag {{selected}}")
{{tag_text}}
span.count ({{count}})
{{/each}}