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