home · contact · privacy
Clean up do_POST_process code.
[plomtask] / templates / process.html
1 {% extends '_base.html' %}
2 {% import '_macros.html' as macros %}
3
4
5
6 {% block css %}
7 details > summary::after {
8   content: '[+]';
9 }
10 details summary {
11   list-style: none;
12 }
13 details[open] > summary::after {
14   content: '[-]';
15 }
16 {% endblock %}
17
18
19
20 {% macro step_with_steps(step_node, indent) %}
21 <tr>
22 <td>
23 <input type="hidden" name="steps" value="{{step_node.step.id_}}" />
24 {% if step_node.is_explicit %}
25 <input type="checkbox" name="kept_steps" value="{{step_node.step.id_}}" checked />
26 {% endif %}
27 </td>
28
29 {% if step_node.is_explicit and not step_node.seen %}
30 <td colspan=2>
31 <details>
32 <summary>
33 {% else %}
34 <td>
35 {% endif %}
36
37 {% for i in range(indent) %}+{%endfor %}
38 {% if step_node.is_suppressed %}<del>{% endif %}
39 {% if step_node.seen %}
40 <a href="process?id={{step_node.process.id_}}">({{step_node.process.title.newest|e}})</a>
41 {% else %}
42 <a href="process?id={{step_node.process.id_}}">{{step_node.process.title.newest|e}}</a>
43 {% endif %}
44 {% if step_node.is_suppressed %}</del>{% endif %}
45
46
47 {% if step_node.is_explicit and not step_node.seen %}
48 </summary>
49 <div>add sub-step: <input name="new_step_to_{{step_id}}" list="process_candidates" autocomplete="off" size="100" /></div>
50 </details>
51 {% endif %}
52
53 </td>
54 {% if (not step_node.is_explicit) and (not step_node.seen) %}
55 <td>
56 <input type="checkbox" name="suppresses" value="{{step_id}}" {% if step_node.is_suppressed %}checked{% endif %}> suppress
57 </td>
58 {% endif %}
59 </tr>
60 {% if step_node.is_explicit or not step_node.seen %}
61 {% for substep in step_node.steps %}
62 {{ step_with_steps(substep, indent+1) }}
63 {% endfor %}
64 {% endif %}
65 {% endmacro %}
66
67
68
69 {% block content %}
70 <h3>
71 {% if is_new %}
72 add NEW process
73 {% else %}
74 edit process of ID {{process.id_}}
75 {% endif %}
76 </h3>
77 <form action="process?id={{process.id_ or ''}}" method="POST">
78
79 <table class="edit_table">
80 <tr>
81 <th>title</th>
82 <td><input name="title" type="text" value="{{process.title.newest|e}}" />{% if process.id_ %} [<a href="process_titles?id={{process.id_}}">history</a>]{% endif %}</td>
83 </tr>
84 <tr>
85 <th>effort</th>
86 <td><input type="number" name="effort" step=0.1 value={{process.effort.newest}} />{% if process.id_ %} [<a href="process_efforts?id={{process.id_}}">history</a>]{% endif %}</td>
87 </tr>
88 <tr>
89 <th>description</th>
90 <td><textarea name="description">{{process.description.newest|e}}</textarea><br />{% if process.id_ %} [<a href="process_descriptions?id={{process.id_}}">history</a>]{% endif %}</td>
91 </tr>
92 <tr>
93 <th>calendarize</th>
94 <td><input type="checkbox" name="calendarize" {% if process.calendarize %}checked {% endif %}</td>
95 </tr>
96 <tr>
97 <th>conditions</th>
98 <td>{{ macros.simple_checkbox_table("conditions", process.conditions, "condition", "condition_candidates") }}</td>
99 </tr>
100 <tr>
101 <th>blockers</th>
102 <td>{{ macros.simple_checkbox_table("blockers", process.blockers, "condition", "condition_candidates") }}</td>
103 </tr>
104 <tr>
105 <th>enables</th>
106 <td>{{ macros.simple_checkbox_table("enables", process.enables, "condition", "condition_candidates") }}</td>
107 </tr>
108 <tr>
109 <th>disables</th>
110 <td>{{ macros.simple_checkbox_table("disables", process.disables, "condition", "condition_candidates") }}</td>
111 </tr>
112 <tr>
113 <th>steps</th>
114 <td>
115 {% if steps %}
116 <table>
117 {% for step_node in steps %}
118 {{ step_with_steps(step_node, 0) }}
119 {% endfor %}
120 </table>
121 {% endif %}
122 add: <input type="text" name="new_top_step" list="process_candidates" autocomplete="off" value="{{preset_top_step or ''}}" />
123 </td>
124 </tr>
125 <tr>
126 <th>step of</th>
127 <td>{{ macros.simple_checkbox_table("step_of", owners, "process", "process_candidates") }}</td>
128 </tr>
129 <tr>
130 <th>todos</th>
131 <td>
132 <a href="todos?process_id={{process.id_}}">{{n_todos}}</a><br />
133 </td>
134 </tr>
135 </table>
136
137 {{ macros.edit_buttons() }}
138 </form>
139 {{ macros.datalist_of_titles("condition_candidates", condition_candidates) }}
140 {{ macros.datalist_of_titles("process_candidates", process_candidates) }}
141 {% endblock %}