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