home · contact · privacy
Add Conditions for Todos/Processes to be met or undone by other Todos.
[plomtask] / templates / day.html
index 44fd90d17f884050bd90b8231a9041d4dd3571a4..82eaa56fb7b9acfd6aa55b7db39f080f15459ce4 100644 (file)
@@ -1,5 +1,15 @@
 {% extends 'base.html' %}
 
+{% 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) }}
+{% endfor %}
+{% for condition in todo.conditions %}
+<li>{% for i in range(indent+1) %}+{% endfor %} [{% if condition.is_active %}x{% else %} {% endif %}] <a href="condition?id={{condition.id_}}">{{condition.title.newest|e}}</a>
+{% endfor %}
+{% endmacro %}
+
 {% block content %}
 <h3>{{day.date}} / {{day.weekday}}</h3>
 <p>
@@ -15,9 +25,23 @@ add todo: <input name="new_todo" list="processes" autocomplete="off" />
 {% endfor %}
 </datalist>
 </form>
+<h4>conditions</h4>
+{% for node in conditions_listing %}
+<li>[{% if node['condition'].is_active %}x{% else %} {% endif %}] <a href="condition?id={{node['condition'].id_}}">{{node['condition'].title.newest|e}}</a>
+<ul>
+{% for enabler in node['enablers'] %}
+<li>[+] {{enabler.process.title.newest|e}}</li>
+{% endfor %}
+{% for disabler in node['disablers'] %}
+<li>[-] {{disabler.process.title.newest|e}}</li>
+{% endfor %}
+</ul>
+</li>
+{% endfor %}
+<h4>todos</h4>
 <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 %}