home · contact · privacy
Minor code style improvement re NamedTuple usage.
[plomtask] / templates / day.html
index 51829b2282146c09fb9ec175103f4fe2944378f9..e3fe5ef29c5865551d42d751a5d45ea380921065 100644 (file)
@@ -1,6 +1,51 @@
 {% extends 'base.html' %}
 
+{% macro node_with_children(node, indent) %}
+<li>{% for i in range(indent) %}+{% endfor %}
+{% if node.is_todo %}
+{% if not node.item.is_doable %}<del>{% endif %}[{% if node.item.is_done %}x{% else %} {% endif %}]{% if not node.item.is_doable %}</del>{% endif %}
+{% 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 %}
+&lt; {% if node.seen %}({% else %}{% endif %}<a href="condition?id={{node.item.id_}}">{{node.item.title.newest|e}}</a>{% if node.seen %}){% else %}{% endif %}
+{% endif %}
+{% for child in node.children %}
+{{ node_with_children(child, indent+1) }}
+{% 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" /><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 condition_listings %}
+<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>&lt; {{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 node in todo_trees %}
+{{ node_with_children(node, 0) }}
+{% endfor %}
+</ul>
 {% endblock %}