home · contact · privacy
Refactor tests.
[plomtask] / templates / process.html
1 {% extends 'base.html' %}
2
3
4
5 {% macro step_with_steps(step_id, step_node, indent) %}
6 <tr>
7 <td>
8 <input type="hidden" name="steps" value="{{step_id}}" />
9 {% if step_node.is_explicit %}
10 <input type="checkbox" name="keep_step" value="{{step_id}}" checked />
11 <input type="hidden" name="step_{{step_id}}_process_id" value="{{step_node.process.id_}}" />
12 <input type="hidden" name="step_{{step_id}}_parent_id" value="{{step_node.parent_id or ''}}" />
13 {% endif %}
14 </td>
15 <td>{% for i in range(indent) %}+{%endfor %}
16 {% if (not step_node.is_explicit) and step_node.seen %}
17 <a href="process?id={{step_node.process.id_}}">({{step_node.process.title.newest|e}})</a>
18 {% else %}
19 <a href="process?id={{step_node.process.id_}}">{{step_node.process.title.newest|e}}</a>
20 {% endif %}
21 </td>
22 <td>
23 {% if step_node.is_explicit %}
24 add step: <input name="new_step_to_{{step_id}}" list="candidates" autocomplete="off" />
25 {% endif %}
26 </td>
27 </tr>
28 {% if step_node.is_explicit or not step_node.seen %}
29 {% for substep_id, substep in step_node.steps.items() %}
30 {{ step_with_steps(substep_id, substep, indent+1) }}
31 {% endfor %}
32 {% endif %}
33 {% endmacro %}
34
35
36
37 {% block content %}
38 <h3>process</h3>
39 <form action="process?id={{process.id_ or ''}}" method="POST">
40 <table>
41 <tr>
42 <th>title</th>
43 <td><input name="title" value="{{process.title.newest|e}}" /></td>
44 </tr>
45 <tr>
46 <th>default effort</th>
47 <td><input name="effort" type="number" step=0.1 value={{process.effort.newest}} /></td>
48 </tr>
49 <tr>
50 <th>description</th>
51 <td><textarea name="description">{{process.description.newest|e}}</textarea></td>
52 </tr>
53 <tr>
54 <th>conditions</th>
55 <td>
56 <table>
57 {% for condition in process.conditions %}
58 <tr>
59 <td>
60 <input type="checkbox" name="condition" value="{{condition.id_}}" checked />
61 </td>
62 <td>
63 <a href="condition?id={{condition.id_}}">{{condition.title.newest|e}}</a>
64 </td>
65 </tr>
66 {% endfor %}
67 </table>
68 add condition: <input name="condition" list="condition_candidates" autocomplete="off" />
69 </td>
70 </tr>
71 <tr>
72 <th>enables</th>
73 <td>
74 <table>
75 {% for condition in process.enables %}
76 <tr>
77 <td>
78 <input type="checkbox" name="enables" 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 enables: <input name="enables" list="condition_candidates" autocomplete="off" />
87 </td>
88 </tr>
89 <tr>
90 <th>disables</th>
91 <td>
92 <table>
93 {% for condition in process.disables %}
94 <tr>
95 <td>
96 <input type="checkbox" name="disables" value="{{condition.id_}}" checked />
97 </td>
98 <td>
99 <a href="condition?id={{condition.id_}}">{{condition.title.newest|e}}</a>
100 </td>
101 </tr>
102 {% endfor %}
103 </table>
104 add disables: <input name="disables" list="condition_candidates" autocomplete="off" />
105 </td>
106 </tr>
107 <tr>
108 <th>steps</th>
109 <td>
110 <table>
111 {% for step_id, step_node in steps.items() %}
112 {{ step_with_steps(step_id, step_node, 0) }}
113 {% endfor %}
114 </table>
115 add step: <input name="new_top_step" list="step_candidates" autocomplete="off" />
116 </td>
117 <tr>
118 </table>
119 <datalist id="condition_candidates">
120 {% for condition_candidate in condition_candidates %}
121 <option value="{{condition_candidate.id_}}">{{condition_candidate.title.newest|e}}</option>
122 {% endfor %}
123 </datalist>
124 <datalist id="step_candidates">
125 {% for candidate in step_candidates %}
126 <option value="{{candidate.id_}}">{{candidate.title.newest|e}}</option>
127 {% endfor %}
128 </datalist>
129 <input class="btn-harmless" type="submit" name="update" value="update" />
130 <div class="btn-to-right">
131 <input class="btn-dangerous" type="submit" name="delete" value="delete" />
132 </div>
133 </form>
134 <h4>step of</h4>
135 <ul>
136 {% for owner in owners %}
137 <li><a href="process?id={{owner.id_}}">{{owner.title.newest|e}}</a>
138 {% endfor %}
139 </ul>
140 {% endblock %}