assert isinstance(effort_then, float)
return effort_then
+ @property
+ def has_doneness_in_path(self) -> bool:
+ """Check whether self is done or has any children that are."""
+ if self.is_done:
+ return True
+ for child in self.children:
+ if child.is_done:
+ return True
+ if child.has_doneness_in_path:
+ return True
+ return False
+
def get_step_tree(self, seen_todos: set[int]) -> TodoNode:
"""Return tree of depended-on Todos."""
}
td.cond_line_0 {
border-top: 1px solid white;
- background-color: #dddddd;
+ background-color: #bfbfbf;
}
td.cond_line_1 {
border-top: 1px solid white;
- background-color: #efefef;
+ background-color: #dfdfdf;
}
td.cond_line_2 {
border-top: 1px solid white;
text-overflow: clip;
}
td.todo_line {
- border-bottom: 1px solid #dddddd;
+ border-bottom: 1px solid #bfbfbf;
height: 1.7em;
}
tr.inactive td.todo_line {
- background-color: #dddddd;
+ background-color: #bfbfbf;
+}
+tr.hidden_undone td, tr.hidden_undone a {
+ color: #9f9f9f;
}
td.left_border {
border-left: 1px solid black;
{% macro show_node_done(node, indent, path) %}
-{% if node.todo.is_done %}
-
-<tr>
-{% if path|length > 0 and not path[-1].todo.is_done %}
-<td>
-({% for path_node in path %}<a href="todo?id={{path_node.todo.id_}}">{{path_node.todo.title_then|e}}</a> <- {% endfor %})
-</td>
-</tr>
-
-<tr>
+{% if node.todo.has_doneness_in_path %}
+<tr{% if not node.todo.is_done %} class="hidden_undone"{% endif %}>
<td>
- +
-{% else %}
-<td>
-{% for i in range(indent) %} {% endfor %} +
-{% endif %}
-{% if node.seen %}({% endif %}<a href="todo?id={{node.todo.id_}}">{{node.todo.title_then|e}}</a> {% if node.todo.comment|length > 0 %}[{{node.todo.comment|e}}]{% endif %}{% if node.seen %}){% endif %}
+{% for i in range(indent) %} {% endfor %} +
+{% if not node.todo.is_done %}({% endif %}<a href="todo?id={{node.todo.id_}}">{{node.todo.title_then|e}}</a>{% if not node.todo.is_done %}){% endif %}
</td>
+<td>{{node.todo.comment|e}}</td>
</tr>
-{% endif %}
{% if not node.seen %}
{% for child in node.children %}
-{{ show_node_done(child, indent+1, path + [node]) }}
+{{ show_node_done(child, indent+1) }}
{% endfor %}
{% endif %}
-
+{% endif %}
{% endmacro %}