home · contact · privacy
fea931ab83ddf57536ab375ce3773a3f656204ce
[plomtask] / templates / todo.html
1 {% extends '_base.html' %}
2 {% import '_macros.html' as macros %}
3
4
5
6 {% block css %}
7 select{ font-size: 0.5em; margin: 0; padding: 0; }
8 {% endblock %}
9
10
11
12 {% macro draw_tree_row(item, parent_todo, indent=0) %}
13 <tr>
14 <td>
15 {% if item.todo %}
16 {% if not item.process %}+{% else %}&nbsp;{% endif %}<input type="checkbox" name="adopt" value="{{item.todo.id_}}" checked {% if indent > 0 %}disabled{% endif %}/>
17 {% endif %}
18 </td>
19 <td>
20 {% for i in range(indent-1) %}&nbsp;&nbsp;{%endfor %}{% if indent > 0 %}·{% endif %}
21 {% if item.todo %}
22 <a href="todo?id={{item.todo.id_}}">{{item.todo.title_then|e}}</a>
23 {% else %}
24 {{item.process.title.newest|e}}
25 {% if indent == 0 %}
26 · fill: <select name="fill_for_{{item.id_}}">
27 <option value="ignore">--</option>
28 <option value="make_empty_{{item.process.id_}}">make empty</option>
29 <option value="make_full_{{item.process.id_}}">make full</option>
30 {% for adoptable in adoption_candidates_for[item.process.id_] %}
31 <option value="{{adoptable.id_}}">adopt #{{adoptable.id_}}{% if adoptable.comment %} / {{adoptable.comment}}{% endif %}</option>
32 {% endfor %}
33 </select>
34 {% endif %}
35 {% endif %}
36 </td>
37 </tr>
38 {% for child in item.children %}
39 {{ draw_tree_row(child, item, indent+1) }}
40 {% endfor %}
41 {% endmacro %}
42
43
44
45 {% block content %}
46 <h3>Todo: {{todo.title_then|e}}</h3>
47 <form action="todo?id={{todo.id_}}" method="POST">
48
49 <table class="edit_table">
50 <tr>
51 <th>day</th>
52 <td><a href="day?date={{todo.date}}">{{todo.date}}</a></td>
53 </tr>
54 <tr>
55 <th>process</th>
56 <td><a href="process?id={{todo.process.id_}}">{{todo.process.title.newest|e}}</a></td>
57 </tr>
58 <tr>
59 <th>done</th>
60 <td><input type="checkbox" name="done" {% if todo.is_done %}checked {% endif %} {% if not todo.is_doable %}disabled {% endif %}/>
61 {% if not todo.is_doable and todo.is_done %}<input type="hidden" name="done" value="1" />{% endif %}
62 </td>
63 </tr>
64 <tr>
65 <th>effort</th>
66 <td><input type="number" name="effort" step=0.1 placeholder={{todo.effort_then}} value={{todo.effort}} /></td>
67 </tr>
68 <tr>
69 <th>comment</th>
70 <td><input name="comment" type="text" value="{{todo.comment|e}}"/></td>
71 </tr>
72 <tr>
73 <th>calendarize</th>
74 <td><input type="checkbox" name="calendarize" {% if todo.calendarize %}checked {% endif %}</td>
75 </tr>
76 <tr>
77 <th>conditions</th>
78 <td>{{ macros.simple_checkbox_table("conditions", todo.conditions, "condition", "condition_candidates") }}</td>
79 </tr>
80 <tr>
81 <th>blockers</th>
82 <td>{{ macros.simple_checkbox_table("blockers", todo.blockers, "condition", "condition_candidates") }}</td>
83 </tr>
84 <tr>
85 <th>enables</th>
86 <td>{{ macros.simple_checkbox_table("enables", todo.enables, "condition", "condition_candidates") }}</td>
87 </tr>
88 <tr>
89 <th>disables</th>
90 <td>{{ macros.simple_checkbox_table("disables", todo.disables, "condition", "condition_candidates") }}</td>
91 </tr>
92 <tr>
93 <th>parents</th>
94 <td>
95 {% for parent in todo.parents %}
96 <a href="todo?id={{parent.id_}}">{{parent.title_then|e}}</a><br />
97 {% endfor %}
98 </td>
99 </tr>
100 <tr>
101 <th>descendants</th>
102 <td>
103 {% if steps_todo_to_process|length > 0 %}
104 <table>
105 {% for step in steps_todo_to_process %}
106 {{ draw_tree_row(step, todo) }}
107 {% endfor %}
108 </table>
109 {% endif %}
110 adopt: <input type="text" name="adopt" list="todo_candidates" autocomplete="off" /><br />
111 make empty: <input type="text" name="make_empty" list="process_candidates" autocomplete="off" /><br />
112 make full: <input type="text" name="make_full" list="process_candidates" autocomplete="off" />
113 </td>
114 </tr>
115 </table>
116
117 {{ macros.edit_buttons() }}
118 </form>
119 {{ macros.datalist_of_titles("condition_candidates", condition_candidates) }}
120 {{ macros.datalist_of_titles("process_candidates", process_candidates) }}
121 {{ macros.datalist_of_titles("todo_candidates", todo_candidates, historical=true, with_comments=true) }}
122 {% endblock %}