home · contact · privacy
8c219c6233a748db6e73bb2a37ca0a86c113f7fb
[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}}_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 {{ step_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 <table>
37 <tr>
38 <th>title</th>
39 <td><input name="title" value="{{process.title.newest|e}}" /></td>
40 </tr>
41 <tr>
42 <th>default effort</th>
43 <td><input name="effort" type="number" step=0.1 value={{process.effort.newest}} /></td>
44 </tr>
45 <tr>
46 <th>description</th>
47 <td><textarea name="description">{{process.description.newest|e}}</textarea></td>
48 </tr>
49 <tr>
50 <th>conditions</th>
51 <td>
52 <table>
53 {% for condition in process.conditions %}
54 <tr>
55 <td>
56 <input type="checkbox" name="condition" value="{{condition.id_}}" checked />
57 </td>
58 <td>
59 <a href="condition?id={{condition.id_}}">{{condition.title.newest|e}}</a>
60 </td>
61 </tr>
62 {% endfor %}
63 </table>
64 add condition: <input name="condition" list="condition_candidates" autocomplete="off" />
65 </td>
66 </tr>
67 <tr>
68 <th>enables</th>
69 <td>
70 <table>
71 {% for condition in process.enables %}
72 <tr>
73 <td>
74 <input type="checkbox" name="enables" value="{{condition.id_}}" checked />
75 </td>
76 <td>
77 <a href="condition?id={{condition.id_}}">{{condition.title.newest|e}}</a>
78 </td>
79 </tr>
80 {% endfor %}
81 </table>
82 add enables: <input name="enables" list="condition_candidates" autocomplete="off" />
83 </td>
84 </tr>
85 <tr>
86 <th>disables</th>
87 <td>
88 <table>
89 {% for condition in process.disables %}
90 <tr>
91 <td>
92 <input type="checkbox" name="disables" value="{{condition.id_}}" checked />
93 </td>
94 <td>
95 <a href="condition?id={{condition.id_}}">{{condition.title.newest|e}}</a>
96 </td>
97 </tr>
98 {% endfor %}
99 </table>
100 add disables: <input name="disables" list="condition_candidates" autocomplete="off" />
101 </td>
102 </tr>
103 <tr>
104 <th>steps</th>
105 <td>
106 <table>
107 {% for step_id, step_node in steps.items() %}
108 {{ step_with_steps(step_id, step_node, 0) }}
109 {% endfor %}
110 </table>
111 add step: <input name="new_top_step" list="step_candidates" autocomplete="off" />
112 </td>
113 <tr>
114 </table>
115 <datalist id="condition_candidates">
116 {% for condition_candidate in condition_candidates %}
117 <option value="{{condition_candidate.id_}}">{{condition_candidate.title.newest|e}}</option>
118 {% endfor %}
119 </datalist>
120 <datalist id="step_candidates">
121 {% for candidate in step_candidates %}
122 <option value="{{candidate.id_}}">{{candidate.title.newest|e}}</option>
123 {% endfor %}
124 </datalist>
125 <input type="submit" name="update" value="update" />
126 <input type="submit" name="delete" value="delete" />
127 </form>
128 <h4>step of</h4>
129 <ul>
130 {% for owner in owners %}
131 <li><a href="process?id={{owner.id_}}">{{owner.title.newest|e}}</a>
132 {% endfor %}
133 </ul>
134 {% endblock %}