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