+
+
+
+{% macro draw_todo(todo) %}<a href="?id={{todo.id_}}">{{todo.title}}</a>{% if todo.comment %}({{todo.comment|e}}){% endif %}{% endmacro %}
+
+
+
+{% macro task_with_deps(task, indent) %}
+{% for i in range(indent) %} {% endfor %}+
+({{task.title.then}})<br />
+{% for t in task.deps %}
+{{ task_with_deps(t, indent+1) }}
+{% endfor %}
+{% endmacro %}
+
+
+
+{% macro todo_with_deps(todo, indent) %}
+{% for i in range(indent) %} {% endfor %}{{ macros.doneness_string(todo) }} {{ draw_todo(todo) }}<br />
+{% for dep in todo.deps %}
+{% if dep.been_observed %}
+{% for i in range(indent+1) %} {% endfor %}{{ macros.doneness_string(dep) }} ({{ draw_todo(dep) }})<br />
+{% else %}
+{{ todo_with_deps(dep, indent+1) }}
+{% endif %}
+{% endfor %}
+{{ todo.observe() }}
+{% endmacro %}
+
+
+
+{% macro draw_deps(deps) %}
+{% for t in deps %}
+<tr class="lowlevel">
+<td><input name="adopt_dep" type="checkbox" value="{{t.id_}}" checked/></td>
+<td>{{ macros.doneness_string(t) }}</td>
+<td>
+{% if t.deps and not t.been_observed %}
+<details>
+<summary>{{ draw_todo(t) }}</summary>
+{% for dep in t.deps %}
+{{ todo_with_deps(dep, 0) }}
+{% endfor %}
+</details>
+{% else %}
+{{ draw_todo(t) }}
+{% endif %}
+</td>
+{{ t.observe() }}
+</tr>
+{% endfor %}
+{% endmacro %}
+
+
+