home · contact · privacy
Add Conditions for Todos/Processes to be met or undone by other Todos.
[plomtask] / templates / day.html
index 0fff9e049792f695230947e56afc5be3b4d40060..82eaa56fb7b9acfd6aa55b7db39f080f15459ce4 100644 (file)
@@ -1,10 +1,48 @@
 {% 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>
+<a href="day?date={{day.prev_date}}">prev</a> | <a href="day?date={{day.next_date}}">next</a>
+</p>
 <form action="day?date={{day.date}}" method="POST">
 comment: <input name="comment" value="{{day.comment|e}}" />
-<input type="submit" value="OK" />
+<input type="submit" value="OK" /><br />
+add todo: <input name="new_todo" list="processes" autocomplete="off" />
+<datalist id="processes">
+{% for process in processes %}
+<option value="{{process.id_}}">{{process.title.newest|e}}</option>
+{% 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 %}
+{{ todo_with_children(todo, 0) }}
+{% endfor %}
+</ul>
 {% endblock %}