home · contact · privacy
Fix Process.get_descendants eliminating sibling references to same Process.id_.
[plomtask] / templates / process.html
index 1743936f2eb3bca793ff70faf1e0edfd898146f2..0f0f0c5a49e5bef9db9b9eb558f7d416afedd4fa 100644 (file)
@@ -1,11 +1,37 @@
 {% extends 'base.html' %}
 
+{% macro process_with_children(node, indent) %}
+<tr>
+<td>
+<input type="checkbox" name="children" value="{{node.process.id_}}" checked />
+</td>
+<td>
+{% for i in range(indent) %}+{%endfor %}
+<a href="process?id={{node.process.id_}}">{{node.process.title.newest|e}}</a>
+</td>
+</tr>
+{% for child in node.children %}
+{{ process_with_children(child, indent+1) }}
+{% endfor %}
+{% endmacro %}
+
 {% block content %}
 <h3>Process</h3>
 <form action="process?id={{process.id_ or ''}}" method="POST">
 title: <input name="title" value="{{process.title.newest|e}}" />
 description: <input name="description" value="{{process.description.newest|e}}" />
 default effort: <input name="effort" type="number" step=0.1 value={{process.effort.newest}} />
+<table>
+{% for child in children %}
+{{ process_with_children(child, 0) }}
+{% endfor %}
+</table>
+add child: <input name="children" list="candidates" autocomplete="off" />
+<datalist id="candidates">
+{% for candidate in candidates %}
+<option value="{{candidate.id_}}">{{candidate.title.newest|e}}</option>
+{% endfor %}
+</datalist>
 <input type="submit" value="OK" />
 </form>
 {% endblock %}