-{% macro todo_with_children(todo, indent) %}
-<li>{% for i in range(indent) %}+{% endfor %} [{% if todo.is_done %}x{% else %} {% endif %}] <a href="todo?id={{todo.id_}}">{{todo.process.title.newest|e}}</a>
-{% for child in todo.children %}
-{{ todo_with_children(child, indent+1) }}
+
+{% macro show_node(node, indent) %}
+{% if node.is_todo %}
+{% for i in range(indent) %} {% endfor %} +
+{% if node.seen %}({% else %}{% endif %}<a href="todo?id={{node.item.id_}}">{{node.item.process.title.newest|e}}</a>{% if node.seen %}){% else %}{% endif %}
+{% else %}
+{% for i in range(indent) %} {% endfor %} +
+{% if node.seen %}({% else %}{% endif %}<a href="condition?id={{node.item.id_}}">{{node.item.title.newest|e}}</a>{% if node.seen %}){% else %}{% endif %}
+{% endif %}
+{% endmacro %}
+
+
+{% macro undone_with_children(node, indent) %}
+{% if not node.hide %}
+<tr>
+<td>
+{% if node.is_todo %}
+<input name="done" value="{{node.item.id_}}" type="checkbox" {% if node.seen or not node.item.is_doable %}disabled{% endif %} {% if node.item.is_done %} checked {% endif %} />
+{% endif %}
+</td>
+<td>
+{{ show_node(node, indent) }}
+</td>
+</tr>
+{% endif %}
+{% for child in node.children %}
+{{ undone_with_children(child, indent+1) }}
+{% endfor %}
+{% endmacro %}
+
+
+{% macro done_with_children(node, indent) %}
+{% if not node.hide %}
+<tr>
+<td>
+{{ show_node(node, indent) }}
+</td>
+</tr>
+{% endif %}
+{% for child in node.children %}
+{{ done_with_children(child, indent+1) }}