home · contact · privacy
5ffa354e172a83aec7bd016cff07a4917c954200
[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_{{item.process.id_}}">make</option>
29 {% for adoptable in adoption_candidates_for[item.process.id_] %}
30 <option value="{{adoptable.id_}}">adopt #{{adoptable.id_}}{% if adoptable.comment %} / {{adoptable.comment}}{% endif %}</option>
31 {% endfor %}
32 </select>
33 {% endif %}
34 {% endif %}
35 </td>
36 </tr>
37 {% for child in item.children %}
38 {{ draw_tree_row(child, item, indent+1) }}
39 {% endfor %}
40 {% endmacro %}
41
42
43
44 {% block content %}
45 <h3>Todo: {{todo.title_then|e}}</h3>
46 <form action="todo?id={{todo.id_}}" method="POST">
47
48 <table class="edit_table">
49 <tr>
50 <th>day</th>
51 <td><a href="day?date={{todo.date}}">{{todo.date}}</a></td>
52 </tr>
53 <tr>
54 <th>process</th>
55 <td><a href="process?id={{todo.process.id_}}">{{todo.process.title.newest|e}}</a></td>
56 </tr>
57 <tr>
58 <th>done</th>
59 <td><input type="checkbox" name="done" {% if todo.is_done %}checked {% endif %} {% if not todo.is_doable %}disabled {% endif %}/>
60 {% if not todo.is_doable and todo.is_done %}<input type="hidden" name="done" value="1" />{% endif %}
61 </td>
62 </tr>
63 <tr>
64 <th>effort</th>
65 <td><input type="number" name="effort" step=0.1 placeholder={{todo.effort_then}} value={{todo.effort}} /></td>
66 </tr>
67 <tr>
68 <th>comment</th>
69 <td><input name="comment" type="text" value="{{todo.comment|e}}"/></td>
70 </tr>
71 <tr>
72 <th>calendarize</th>
73 <td><input type="checkbox" name="calendarize" {% if todo.calendarize %}checked {% endif %}</td>
74 </tr>
75 <tr>
76 <th>conditions</th>
77 <td>{{ macros.simple_checkbox_table("condition", todo.conditions, "condition", "condition_candidates") }}</td>
78 </tr>
79 <tr>
80 <th>blockers</th>
81 <td>{{ macros.simple_checkbox_table("blocker", todo.blockers, "condition", "condition_candidates") }}</td>
82 </tr>
83 <tr>
84 <th>enables</th>
85 <td>{{ macros.simple_checkbox_table("enables", todo.enables, "condition", "condition_candidates") }}</td>
86 </tr>
87 <tr>
88 <th>disables</th>
89 <td>{{ macros.simple_checkbox_table("disables", todo.disables, "condition", "condition_candidates") }}</td>
90 </tr>
91 <tr>
92 <th>parents</th>
93 <td>
94 {% for parent in todo.parents %}
95 <a href="todo?id={{parent.id_}}">{{parent.title_then|e}}</a><br />
96 {% endfor %}
97 </td>
98 </tr>
99 <tr>
100 <th>descendants</th>
101 <td>
102 {% if steps_todo_to_process|length > 0 %}
103 <table>
104 {% for step in steps_todo_to_process %}
105 {{ draw_tree_row(step, todo) }}
106 {% endfor %}
107 </table>
108 {% endif %}
109 adopt: <input type="text" name="adopt" list="todo_candidates" autocomplete="off" /><br />
110 make: <input type="text" name="make" list="process_candidates" autocomplete="off" />
111 </td>
112 </tr>
113 </table>
114
115 {{ macros.edit_buttons() }}
116 </form>
117 {{ macros.datalist_of_titles("condition_candidates", condition_candidates) }}
118 {{ macros.datalist_of_titles("process_candidates", process_candidates) }}
119 {{ macros.datalist_of_titles("todo_candidates", todo_candidates, historical=true, with_comments=true) }}
120 {% endblock %}