home · contact · privacy
ac0a64a704cce415cfdc4977597b9de21b2c5dc4
[plomtask] / templates / day.html
1 {% extends '_base.html' %}
2 {% import '_macros.html' as macros %}
3
4
5
6 {% block css %}
7 td, th, tr, table {
8   padding: 0;
9   margin: 0;
10 }
11 th {
12   border: 1px solid black;
13 }
14 td.min_width {
15   min-width: 1em;
16 }
17 td.cond_line_0 {
18   background-color: #ffbbbb;
19 }
20 td.cond_line_1 {
21   background-color: #bbffbb;
22 }
23 td.cond_line_2 {
24   background-color: #bbbbff;
25 }
26 td.todo_line {
27   border-bottom: 1px solid #bbbbbb;
28 }
29 {% endblock %}
30
31
32
33 {% macro show_node_undone(node, indent) %}
34 {% if not node.todo.is_done %}
35 <tr>
36 <input type="hidden" name="todo_id" value="{{node.todo.id_}}" />
37
38 {% for condition in conditions_present %}
39 <td class="cond_line_{{loop.index0 % 3}} {% if not condition.is_active %}min_width{% endif %}">{% if condition in node.todo.conditions %}{% if not condition.is_active %}O{% endif %}{% endif %}</td>
40 {% endfor %}
41
42 <td class="todo_line">-&gt;</td>
43 <td class="todo_line"><input name="done" type="checkbox" value="{{node.todo.id_}}" {% if node.todo.is_done %}checked disabled{% endif %} {% if not node.todo.is_doable %}disabled{% endif %}/></td>
44 <td class="todo_line"><input name="effort" type="number" step=0.1 size=5 placeholder={{node.todo.process.effort.newest }} value={{node.todo.effort}} /></td>
45 <td class="todo_line">
46 {% for i in range(indent) %}&nbsp; {% endfor %} +
47 {% if node.seen %}({% endif %}<a href="todo?id={{node.todo.id_}}">{{node.todo.process.title.newest|e}}</a>{% if node.seen %}){% endif %}
48 </td>
49 <td class="todo_line">-&gt;</td>
50
51 {% for condition in conditions_present|reverse %}
52 <td class="cond_line_{{(conditions_present|length - loop.index) % 3}} {% if condition in node.todo.enables or condition in node.todo.disables %}min_width{% endif %}">{% if condition in node.todo.enables %}+{% elif condition in node.todo.disables %}!{% endif %}</td>
53 {% endfor %}
54
55 <td><input name="comment" value="{{node.todo.comment|e}}" /></td>
56
57 </tr>
58 {% endif %}
59
60 {% if not node.seen %}
61 {% for child in node.children %}
62 {{ show_node_undone(child, indent+1) }}
63 {% endfor %}
64 {% endif %}
65
66 {% endmacro %}
67
68
69
70 {% macro show_node_done(node, indent, path) %}
71 {% if node.todo.is_done %}
72
73 <tr>
74 {% if path|length > 0 and not path[-1].todo.is_done %}
75 <td>
76 ({% for path_node in path %}<a href="todo?id={{path_node.todo.id_}}">{{path_node.todo.process.title.newest|e}}</a>  &lt;- {% endfor %})
77 </td>
78 </tr>
79
80 <tr>
81 <td>
82 &nbsp; +
83 {% else %}
84 <td>
85 {% for i in range(indent) %}&nbsp; {% endfor %} +
86 {% endif %}
87 {% if node.seen %}({% endif %}<a href="todo?id={{node.todo.id_}}">{{node.todo.process.title.newest|e}}</a> {% if node.todo.comment|length > 0 %}[{{node.todo.comment|e}}]{% endif %}{% if node.seen %}){% endif %}
88 </td>
89 </tr>
90
91 {% endif %}
92 {% if not node.seen %}
93 {% for child in node.children %}
94 {{ show_node_done(child, indent+1, path + [node]) }}
95 {% endfor %}
96 {% endif %}
97
98 {% endmacro %}
99
100
101
102 {% block content %}
103 <h3>{{day.date}} / {{day.weekday}}</h3>
104 <p>
105 <a href="day?date={{day.prev_date}}">prev</a> | <a href="day?date={{day.next_date}}">next</a>
106 </p>
107 <form action="day?date={{day.date}}" method="POST">
108 comment: <input name="day_comment" value="{{day.comment|e}}" />
109 <input type="submit" value="OK" /><br />
110 add todo: <input name="new_todo" list="processes" autocomplete="off" />
111
112 <h4>todo</h4>
113
114 <table>
115
116 <tr>
117 <th colspan={{ conditions_present|length}}>c</th>
118 <th colspan=4>states</th>
119 <th colspan={{ conditions_present|length}}>t</th>
120 <th>add enabler</th>
121 </tr>
122
123 {% for condition in conditions_present %}
124 {% set outer_loop = loop %}
125 <tr>
126
127 {% for _ in conditions_present %}
128 {% if outer_loop.index > loop.index %}
129 <td class="cond_line_{{loop.index0 % 3}}">
130 {% else %}
131 <td class="cond_line_{{outer_loop.index0 % 3}}">
132 {% endif %}
133 {% if outer_loop.index == loop.index  %}
134 {% endif %}
135 </td>
136 {% endfor %}
137
138 <td class="cond_line_{{loop.index0 % 3}}">[{% if condition.is_active %}X{% else %}&nbsp;{% endif %}]</td>
139 <td colspan=3 class="cond_line_{{loop.index0 % 3}}"><a href="condition?id={{condition.id_}}">{{condition.title.newest|e}}</a></td>
140
141 {% for _ in conditions_present %}
142 {% if outer_loop.index0 + loop.index0 < conditions_present|length %}
143 <td class="cond_line_{{outer_loop.index0 % 3}}">
144 {% else %}
145 <td class="cond_line_{{(conditions_present|length - loop.index) % 3}}">
146 {% endif %}
147 {% endfor %}
148 {% set list_name = "todos_for_%s"|format(condition.id_) %}
149 <td><input name="new_todo" list="{{list_name}}" autocomplete="off" /></td>
150 {{ macros.datalist_of_titles(list_name, enablers_for[condition.id_]) }}
151 </td>
152 </tr>
153 {% endfor %}
154
155 <tr>
156 {% for condition in conditions_present %}
157 <td class="cond_line_{{loop.index0 % 3}}"></td>
158 {% endfor %}
159 <th colspan={{ 4 }}>doables</th>
160 {% for condition in conditions_present %}
161 <td class="cond_line_{{(conditions_present|length - loop.index) % 3}}"></td>
162 {% endfor %}
163 <th>comments</th>
164 </tr>
165 {% for node in top_nodes %}
166 {{ show_node_undone(node, 0) }}
167 {% endfor %}
168
169 </table>
170
171 <h4>done</h4>
172
173 <table>
174 {% for node in top_nodes %}
175 {{ show_node_done(node, 0, []) }}
176 {% endfor %}
177 </table>
178
179 </form>
180
181 {{ macros.datalist_of_titles("processes", processes) }}
182 {% endblock %}