home · contact · privacy
Improve template layouts.
[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: <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
42 <tr>
43 <th>title</th>
44 <td><input name="title" value="{{process.title.newest|e}}" /></td>
45 </tr>
46
47 <tr>
48 <th>default effort</th>
49 <td><input name="effort" type="number" step=0.1 value={{process.effort.newest}} /></td>
50 </tr>
51
52 <tr>
53 <th>description</th>
54 <td><textarea name="description">{{process.description.newest|e}}</textarea></td>
55 </tr>
56
57 <tr>
58 <th>conditions</th>
59 <td>
60 <table>
61 {% for condition in process.conditions %}
62 <tr>
63 <td>
64 <input type="checkbox" name="condition" 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: <input name="condition" list="condition_candidates" autocomplete="off" />
73 </td>
74 </tr>
75
76 <tr>
77 <th>enables</th>
78 <td>
79 <table>
80 {% for condition in process.enables %}
81 <tr>
82 <td>
83 <input type="checkbox" name="enables" value="{{condition.id_}}" checked />
84 </td>
85 <td>
86 <a href="condition?id={{condition.id_}}">{{condition.title.newest|e}}</a>
87 </td>
88 </tr>
89 {% endfor %}
90 </table>
91 add: <input name="enables" list="condition_candidates" autocomplete="off" />
92 </td>
93 </tr>
94
95 <tr>
96 <th>disables</th>
97 <td>
98 <table>
99 {% for condition in process.disables %}
100 <tr>
101 <td>
102 <input type="checkbox" name="disables" value="{{condition.id_}}" checked />
103 </td>
104 <td>
105 <a href="condition?id={{condition.id_}}">{{condition.title.newest|e}}</a>
106 </td>
107 </tr>
108 {% endfor %}
109 </table>
110 add: <input name="disables" list="condition_candidates" autocomplete="off" />
111 </td>
112 </tr>
113
114 <tr>
115 <th>steps</th>
116 <td>
117 <table>
118 {% for step_id, step_node in steps.items() %}
119 {{ step_with_steps(step_id, step_node, 0) }}
120 {% endfor %}
121 </table>
122 add: <input name="new_top_step" list="step_candidates" autocomplete="off" />
123 </td>
124 <tr>
125
126 <tr>
127 <th>step of</th>
128 <td>
129 {% for owner in owners %}
130 <a href="process?id={{owner.id_}}">{{owner.title.newest|e}}</a><br />
131 {% endfor %}
132 </td>
133 <tr>
134
135 </table>
136 <datalist id="condition_candidates">
137 {% for condition_candidate in condition_candidates %}
138 <option value="{{condition_candidate.id_}}">{{condition_candidate.title.newest|e}}</option>
139 {% endfor %}
140 </datalist>
141 <datalist id="step_candidates">
142 {% for candidate in step_candidates %}
143 <option value="{{candidate.id_}}">{{candidate.title.newest|e}}</option>
144 {% endfor %}
145 </datalist>
146
147 <input class="btn-harmless" type="submit" name="update" value="update" />
148 <div class="btn-to-right">
149 <input class="btn-dangerous" type="submit" name="delete" value="delete" />
150 </div>
151 </form>
152 {% endblock %}