home · contact · privacy
Enable toggling of Todo.is_done.
[plomtask] / templates / day.html
index 51829b2282146c09fb9ec175103f4fe2944378f9..637e08d94ad2e72da8fbcbd009b0c428131edaee 100644 (file)
@@ -1,6 +1,31 @@
 {% 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 %}
+{% 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>
+<ul>
+{% for todo in todos %}
+{{ todo_with_children(todo, 0) }}
+{% endfor %}
+</ul>
 {% endblock %}