home · contact · privacy
8887f9a6609c05c119773d2d7ba68b131622856d
[plomtask] / templates / day.html
1 {% extends 'base.html' %}
2
3 {% macro todo_with_children(todo, indent) %}
4 <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>
5 {% for child in todo.children %}
6 {{ todo_with_children(child, indent+1) }}
7 {% endfor %}
8 {% for condition in todo.conditions %}
9 <li>{% for i in range(indent) %}&nbsp;{% endfor %}&nbsp; &lt;[{% if condition.is_active %}x{% else %} {% endif %}] <a href="condition?id={{condition.id_}}">{{condition.title.newest|e}}</a>
10 {% endfor %}
11 {% endmacro %}
12
13 {% macro node_with_children(node, indent) %}
14 <li>{% for i in range(indent) %}+{% endfor %}
15 {% if node.is_todo %}
16 {% if not node.item.is_doable %}<del>{% endif %}[{% if node.item.is_done %}x{% else %} {% endif %}]{% if not node.item.is_doable %}</del>{% endif %}
17 {% if node.seen %}({% else %}{% endif %}<a href="todo?id={{node.item.id_}}">{{node.item.process.title.newest|e}}</a>{% if node.seen %}){% else %}{% endif %}
18 {% else %}
19 &lt; {% if node.seen %}({% else %}{% endif %}<a href="condition?id={{node.item.id_}}">{{node.item.title.newest|e}}</a>{% if node.seen %}){% else %}{% endif %}
20 {% endif %}
21 {% for child in node.children %}
22 {{ node_with_children(child, indent+1) }}
23 {% endfor %}
24 {% endmacro %}
25
26 {% block content %}
27 <h3>{{day.date}} / {{day.weekday}}</h3>
28 <p>
29 <a href="day?date={{day.prev_date}}">prev</a> | <a href="day?date={{day.next_date}}">next</a>
30 </p>
31 <form action="day?date={{day.date}}" method="POST">
32 comment: <input name="comment" value="{{day.comment|e}}" />
33 <input type="submit" value="OK" /><br />
34 add todo: <input name="new_todo" list="processes" autocomplete="off" />
35 <datalist id="processes">
36 {% for process in processes %}
37 <option value="{{process.id_}}">{{process.title.newest|e}}</option>
38 {% endfor %}
39 </datalist>
40 </form>
41 <h4>conditions</h4>
42 {% for node in conditions_nodes %}
43 <li>[{% if node.condition.is_active %}x{% else %} {% endif %}] <a href="condition?id={{node.condition.id_}}">{{node.condition.title.newest|e}}</a>
44 <ul>
45 {% for enabler in node.enablers %}
46 <li>&lt; {{enabler.process.title.newest|e}}</li>
47 {% endfor %}
48 {% for disabler in node.disablers %}
49 <li>! {{disabler.process.title.newest|e}}</li>
50 {% endfor %}
51 </ul>
52 </li>
53 {% endfor %}
54 <h4>todos</h4>
55 <ul>
56 {% for node in todo_trees %}
57 {{ node_with_children(node, 0) }}
58 {% endfor %}
59 </ul>
60 {% endblock %}
61