{% 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 %}