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