home · contact · privacy
From Process template remove now unneeded safeguard against endless step trees.
[plomtask] / templates / process.html
1 {% extends 'base.html' %}
2
3 {% macro process_with_steps(step_id, step_node, indent) %}
4 <tr>
5 <td>
6 <input type="hidden" name="steps" value="{{step_id}}" />
7 {% if step_node.is_explicit %}
8 <input type="checkbox" name="keep_step" value="{{step_id}}" checked />
9 <input type="hidden" name="step_{{step_id}}_process_id" value="{{step_node.process.id_}}" />
10 <input type="hidden" name="step_{{step_id}}_parent_id" value="{{step_node.parent_id or ''}}" />
11 {% endif %}
12 </td>
13 <td>{% for i in range(indent) %}+{%endfor %}
14 <a href="process?id={{step_node.process.id_}}">{{step_node.process.title.newest|e}}</a>
15 </td>
16 <td>
17 {% if step_node.is_explicit %}
18 add step: <input name="new_step_to_{{step_id}}" list="candidates" autocomplete="off" />
19 {% endif %}
20 </td>
21 </tr>
22 {% for substep_id, substep in step_node.steps.items() %}
23 {{ process_with_steps(substep_id, substep, indent+1) }}
24 {% endfor %}
25 {% endmacro %}
26
27 {% block content %}
28 <h3>Process</h3>
29 <form action="process?id={{process.id_ or ''}}" method="POST">
30 title: <input name="title" value="{{process.title.newest|e}}" />
31 description: <input name="description" value="{{process.description.newest|e}}" />
32 default effort: <input name="effort" type="number" step=0.1 value={{process.effort.newest}} />
33 <table>
34 {% for step_id, step_node in steps.items() %}
35 {{ process_with_steps(step_id, step_node, 0) }}
36 {% endfor %}
37 </table>
38 add step: <input name="new_top_step" list="candidates" autocomplete="off" />
39 <datalist id="candidates">
40 {% for candidate in candidates %}
41 <option value="{{candidate.id_}}">{{candidate.title.newest|e}}</option>
42 {% endfor %}
43 </datalist>
44 <input type="submit" value="OK" />
45 </form>
46 {% endblock %}
47
48