home · contact · privacy
404ac1c496e32e3fdff533ccb634b2973029a1f6
[misc] / todo_templates / todo.html
1 {% extends 'base.html' %}
2
3 {% block css %}
4 th.toplevel { padding-right: 1em; }
5 input[type="submit"].delete { background-color: #ff7777; }
6 div.delete { float: right; }
7 td.center { text-align: center; }
8 {% endblock %}
9
10 {% block content %}
11 <h3>edit todo</h3>
12
13 <form id="form_to_watch" action="todo" method="POST">
14 <input type="hidden" name="todo_id" value="{{todo.id_}}" />
15 <input type="hidden" name="return_to" value="{{return_to}}" />
16 <table>
17
18 <tr>
19 <th class="toplevel">task</th>
20 <td><a href="task?id={{ todo.task.id_ }}">{{ todo.task.title.then|e }}</a></td>
21 </tr>
22
23 <tr>
24 <th class="toplevel">default effort</th>
25 <td>{{ todo.default_effort }}</td>
26 </tr>
27
28 <tr>
29 <th class="toplevel">efforts</th>
30 <td>
31 <table>
32 <tr><th>date</th><th>effort</th><th>delete</th></tr>
33 {% for date, effort in todo.efforts.items() %}
34 <tr>
35 <td>
36 <input name="effort_date" size=10 value="{{date}}" {% if todo.children and effort %}disabled{% endif %}>
37 </td>
38 <td>
39 <input type="number" name="effort" step=0.1 size=8 value="{{effort}}" placeholder="{{todo.default_effort}}" {% if todo.children and effort %}disabled{% endif %} />
40 </td>
41 <td>
42 {% if not (todo.children and effort) %}<input type="checkbox" name="delete_effort" value="{{date}}" />{% endif %}
43 </td>
44 </tr>
45 {% endfor %}
46 <tr>
47 <td>
48 <input name="effort_date" size=10 value="">
49 </td>
50 <td>
51 <input type="number" name="effort" step=0.1 size=8 value="" {% if todo.children %} disabled {% else %} placeholder="{{todo.default_effort}}" {% endif %} />
52 </td>
53 </tr>
54 </table>
55 </td>
56 </tr>
57
58 <tr>
59 <th class="toplevel">total effort</th>
60 <td>{{todo.all_days_effort}}</td>
61 </tr>
62
63 <tr>
64 <th class="toplevel">importance</th>
65 <td class="input">
66 <input type="number" name="importance" step=0.1 size=8 value="{{ todo.importance }}" />
67 </td>
68 </tr>
69
70 <tr>
71 <th class="toplevel">comment</th>
72 <td class="input">
73 <textarea name="comment" rows=3 cols=100>{{todo.comment|e}}</textarea>
74 </td>
75 </tr>
76
77 <tr>
78 <th>done</th>
79 <td class="input">
80 {% if todo.children %}✓{% else %}<input type="checkbox" name="done" {% if todo.done %}checked{% endif %}/>{% endif %}
81 </td>
82 </tr>
83
84 <tr>
85 <th class="toplevel">day tags</th>
86 <td>
87 {% for tag in tags | sort %}
88 {% if tag in todo.task.tags.now %}
89 &nbsp;✓
90 {% else %}
91 <input type="checkbox" name="day_tag_{{tag|e}}"{% if tag in todo.day_tags %} checked{% endif %}/>
92 {% endif %} {{ tag }}
93 <br />
94 {% endfor %}
95 add: <input name="joined_day_tags" value="" size=100 >
96 </td>
97 </tr>
98
99 <tr>
100 <th class="toplevel">parents</th>
101 <td>
102 <ul>
103 {% for parent in todo.parents %}
104 <li><a href="todo?id={{parent.id_}}">{{parent.title}}</a>
105 {% endfor %}
106 </ul>
107 </td>
108 </tr>
109
110 <tr>
111 <th class="toplevel">children</th>
112 <td>
113 <table class="alternating">
114 <tr>
115 <th>adopt</th><th>effort</th><th>title</th><th>comments</th>
116 </tr>
117 {% for todo in child_todos %}
118 <tr>
119 <td class="center"><input name="adopt_child" type="checkbox" value="{{todo.id_}}" checked/></td>
120 <td class="number">{{ '{:2.1f}'.format(todo.all_days_effort) }} {% if todo.done %}✓{% else %}&nbsp;{% endif %}</td>
121 <td><a href="todo?id={{todo.id_}}">{{todo.day.date}} {{todo.title}}</a></td>
122 </tr>
123 {% endfor %}
124 <tr>
125 <th colspan=4>--------</th>
126 </tr>
127 {% for todo in filtered_todos %}
128 <tr>
129 <td class="center"><input name="adopt_child" type="checkbox" value="{{todo.id_}}" /></td>
130 <td class="number">{{ '{:2.1f}'.format(todo.all_days_effort) }} {% if todo.done %}✓{% else %}&nbsp;{% endif %}</td>
131 <td><a href="todo?id={{todo.id_}}">{{todo.day.date}} {{todo.title}}</a></td>
132 </tr>
133 {% endfor %}
134 </table>
135 </td>
136 </tr>
137
138 </table>
139 <input class="update" name="update" type="submit" value="update" />
140 <div class="delete">
141 <input class="delete" type="submit" name="delete" value="delete" />
142 </div>
143
144 <hr />
145 {% include 'tagfilters.html' %}
146 <br />
147 from: <input name="start" {% if start_date %}value="{{ start_date }}"{% endif %} placeholder="yesterday" />
148 to: <input name="end" {% if end_date %}value="{{ end_date }}"{% endif %} placeholder="2030-12-31" />
149 search: <input name="search" value="{{search|e}}" />
150 <input type="submit" name="filter" value="filter" />
151
152 </form>
153 {% include 'watch_form.html' %}
154 <script>
155 mere_filter_inputs = mere_filter_inputs.concat(['search', 'start', 'end']);
156 </script> 
157 {% endblock %}