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