home · contact · privacy
8731f4b7b12646fb9a4cc44e4726ff543f91ba8a
[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 <h4>steps</h4>
40 <table>
41 {% for step_id, step_node in steps.items() %}
42 {{ process_with_steps(step_id, step_node, 0) }}
43 {% endfor %}
44 </table>
45 add step: <input name="new_top_step" list="candidates" autocomplete="off" />
46 <datalist id="candidates">
47 {% for candidate in candidates %}
48 <option value="{{candidate.id_}}">{{candidate.title.newest|e}}</option>
49 {% endfor %}
50 </datalist>
51 <h4>save</h4>
52 <input type="submit" value="OK" />
53 </form>
54 <h4>step of</h4>
55 <ul>
56 {% for owner in owners %}
57 <li><a href="process?id={{owner.id_}}">{{owner.title.newest|e}}</a>
58 {% endfor %}
59 </ul>
60 {% endblock %}
61
62