home · contact · privacy
Add most basic Todo family relations.
[plomtask] / templates / day.html
index 44fd90d17f884050bd90b8231a9041d4dd3571a4..0953d52446555fb695f021121ac3c9798827597d 100644 (file)
@@ -1,5 +1,12 @@
 {% extends 'base.html' %}
 
+{% macro todo_with_children(todo, indent) %}
+<li>{% for i in range(indent) %}+{% endfor %}<a href="todo?id={{todo.id_}}">{{todo.process.title.newest|e}}</a>
+{% for child in todo.children %}
+{{ todo_with_children(child, indent+1) }}
+{% endfor %}
+{% endmacro %}
+
 {% block content %}
 <h3>{{day.date}} / {{day.weekday}}</h3>
 <p>
@@ -17,7 +24,7 @@ add todo: <input name="new_todo" list="processes" autocomplete="off" />
 </form>
 <ul>
 {% for todo in todos %}
-<li><a href="todo?id={{todo.id_}}">{{todo.process.title.newest|e}}</a>
+{{ todo_with_children(todo, 0) }}
 {% endfor %}
 </ul>
 {% endblock %}