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