home · contact · privacy
Add most basic Todo family relations.
[plomtask] / templates / day.html
1 {% extends 'base.html' %}
2
3 {% macro todo_with_children(todo, indent) %}
4 <li>{% for i in range(indent) %}+{% endfor %}<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 {% endmacro %}
9
10 {% block content %}
11 <h3>{{day.date}} / {{day.weekday}}</h3>
12 <p>
13 <a href="day?date={{day.prev_date}}">prev</a> | <a href="day?date={{day.next_date}}">next</a>
14 </p>
15 <form action="day?date={{day.date}}" method="POST">
16 comment: <input name="comment" value="{{day.comment|e}}" />
17 <input type="submit" value="OK" /><br />
18 add todo: <input name="new_todo" list="processes" autocomplete="off" />
19 <datalist id="processes">
20 {% for process in processes %}
21 <option value="{{process.id_}}">{{process.title.newest|e}}</option>
22 {% endfor %}
23 </datalist>
24 </form>
25 <ul>
26 {% for todo in todos %}
27 {{ todo_with_children(todo, 0) }}
28 {% endfor %}
29 </ul>
30 {% endblock %}
31