home · contact · privacy
85424fa6750523487098d280b2568e48ad2f4c29
[plomtask] / templates / process.html
1 {% extends 'base.html' %}
2
3 {% macro step_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}}_condition_id" value="{{step_node.condition.id_}}" />
11 <input type="hidden" name="step_{{step_id}}_parent_id" value="{{step_node.parent_id or ''}}" />
12 {% endif %}
13 </td>
14 <td>{% for i in range(indent) %}+{%endfor %}
15 {% if (not step_node.is_explicit) and step_node.seen %}
16 <a href="process?id={{step_node.process.id_}}">({{step_node.process.title.newest|e}})</a>
17 {% else %}
18 <a href="process?id={{step_node.process.id_}}">{{step_node.process.title.newest|e}}</a>
19 {% endif %}
20 </td>
21 <td>
22 {% if step_node.is_explicit %}
23 add step: <input name="new_step_to_{{step_id}}" list="candidates" autocomplete="off" />
24 {% endif %}
25 </td>
26 </tr>
27 {% if step_node.is_explicit or not step_node.seen %}
28 {% for substep_id, substep in step_node.steps.items() %}
29 {{ step_with_steps(substep_id, substep, indent+1) }}
30 {% endfor %}
31 {% endif %}
32 {% endmacro %}
33
34 {% block content %}
35 <h3>process</h3>
36 <form action="process?id={{process.id_ or ''}}" method="POST">
37 title: <input name="title" value="{{process.title.newest|e}}" />
38 description: <input name="description" value="{{process.description.newest|e}}" />
39 default effort: <input name="effort" type="number" step=0.1 value={{process.effort.newest}} />
40 <h4>conditions</h4>
41 <table>
42 {% for condition in process.conditions %}
43 <tr>
44 <td>
45 <input type="checkbox" name="condition" value="{{condition.id_}}" checked />
46 </td>
47 <td>
48 <a href="condition?id={{condition.id_}}">{{condition.title.newest|e}}</a>
49 </td>
50 </tr>
51 {% endfor %}
52 </table>
53 add condition: <input name="condition" list="condition_candidates" autocomplete="off" />
54 <datalist id="condition_candidates">
55 {% for condition_candidate in condition_candidates %}
56 <option value="{{condition_candidate.id_}}">{{condition_candidate.title.newest|e}}</option>
57 {% endfor %}
58 </datalist>
59 <h4>enables</h4>
60 <table>
61 {% for condition in process.enables %}
62 <tr>
63 <td>
64 <input type="checkbox" name="enables" value="{{condition.id_}}" checked />
65 </td>
66 <td>
67 <a href="condition?id={{condition.id_}}">{{condition.title.newest|e}}</a>
68 </td>
69 </tr>
70 {% endfor %}
71 </table>
72 add enables: <input name="enables" list="condition_candidates" autocomplete="off" />
73 <h4>disables</h4>
74 <table>
75 {% for condition in process.disables %}
76 <tr>
77 <td>
78 <input type="checkbox" name="disables" value="{{condition.id_}}" checked />
79 </td>
80 <td>
81 <a href="condition?id={{condition.id_}}">{{condition.title.newest|e}}</a>
82 </td>
83 </tr>
84 {% endfor %}
85 </table>
86 add disables: <input name="disables" list="condition_candidates" autocomplete="off" />
87 <h4>steps</h4>
88 <table>
89 {% for step_node in steps %}
90 {{ step_with_steps(step_id, step_node, 0) }}
91 {% endfor %}
92 </table>
93 add step: <input name="new_top_step" list="step_candidates" autocomplete="off" />
94 <datalist id="step_candidates">
95 {% for candidate in step_candidates %}
96 <option value="{{candidate.id_}}">{{candidate.title.newest|e}}</option>
97 {% endfor %}
98 </datalist>
99 <h4>save</h4>
100 <input type="submit" value="OK" />
101 </form>
102 <h4>step of</h4>
103 <ul>
104 {% for owner in owners %}
105 <li><a href="process?id={{owner.id_}}">{{owner.title.newest|e}}</a>
106 {% endfor %}
107 </ul>
108 {% endblock %}