home · contact · privacy
1dcfff627c99f0f17218392ac86aee7f0b607502
[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 {% if (not step_node.is_explicit) and step_node.seen %}
15 <a href="process?id={{step_node.process.id_}}">({{step_node.process.title.newest|e}})</a>
16 {% else %}
17 <a href="process?id={{step_node.process.id_}}">{{step_node.process.title.newest|e}}</a>
18 {% endif %}
19 </td>
20 <td>
21 {% if step_node.is_explicit %}
22 add step: <input name="new_step_to_{{step_id}}" list="candidates" autocomplete="off" />
23 {% endif %}
24 </td>
25 </tr>
26 {% if step_node.is_explicit or not step_node.seen %}
27 {% for substep_id, substep in step_node.steps.items() %}
28 {{ process_with_steps(substep_id, substep, indent+1) }}
29 {% endfor %}
30 {% endif %}
31 {% endmacro %}
32
33 {% block content %}
34 <h3>Process</h3>
35 <form action="process?id={{process.id_ or ''}}" method="POST">
36 title: <input name="title" value="{{process.title.newest|e}}" />
37 description: <input name="description" value="{{process.description.newest|e}}" />
38 default effort: <input name="effort" type="number" step=0.1 value={{process.effort.newest}} />
39 <table>
40 {% for step_id, step_node in steps.items() %}
41 {{ process_with_steps(step_id, step_node, 0) }}
42 {% endfor %}
43 </table>
44 add step: <input name="new_top_step" list="candidates" autocomplete="off" />
45 <datalist id="candidates">
46 {% for candidate in candidates %}
47 <option value="{{candidate.id_}}">{{candidate.title.newest|e}}</option>
48 {% endfor %}
49 </datalist>
50 <input type="submit" value="OK" />
51 </form>
52 {% endblock %}
53
54