home · contact · privacy
In Calendar view, highlight today's date.
[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">
45 {% for i in range(indent) %}&nbsp; {% endfor %} +
46 {% if node.seen %}({% endif %}<a href="todo?id={{node.todo.id_}}">{{node.todo.process.title.newest|e}}</a>{% if node.seen %}){% endif %}
47 </td>
48 <td class="todo_line">-&gt;</td>
49
50 {% for condition in conditions_present|reverse %}
51 <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>
52 {% endfor %}
53
54 <td><input name="comment" value="{{node.todo.comment|e}}" /></td>
55
56 </tr>
57 {% endif %}
58
59 {% if not node.seen %}
60 {% for child in node.children %}
61 {{ show_node_undone(child, indent+1) }}
62 {% endfor %}
63 {% endif %}
64
65 {% endmacro %}
66
67
68
69 {% macro show_node_done(node, indent, path) %}
70 {% if node.todo.is_done %}
71
72 <tr>
73 {% if path|length > 0 and not path[-1].todo.is_done %}
74 <td>
75 ({% for path_node in path %}<a href="todo?id={{path_node.todo.id_}}">{{path_node.todo.process.title.newest|e}}</a>  &lt;- {% endfor %})
76 </td>
77 </tr>
78
79 <tr>
80 <td>
81 &nbsp; +
82 {% else %}
83 <td>
84 {% for i in range(indent) %}&nbsp; {% endfor %} +
85 {% endif %}
86 {% 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 %}
87 </td>
88 </tr>
89
90 {% endif %}
91 {% if not node.seen %}
92 {% for child in node.children %}
93 {{ show_node_done(child, indent+1, path + [node]) }}
94 {% endfor %}
95 {% endif %}
96
97 {% endmacro %}
98
99
100
101 {% block content %}
102 <h3>{{day.date}} / {{day.weekday}}</h3>
103 <p>
104 <a href="day?date={{day.prev_date}}">prev</a> | <a href="day?date={{day.next_date}}">next</a>
105 </p>
106 <form action="day?date={{day.date}}" method="POST">
107 comment: <input name="day_comment" value="{{day.comment|e}}" />
108 <input type="submit" value="OK" /><br />
109 add todo: <input name="new_todo" list="processes" autocomplete="off" />
110
111 <h4>todo</h4>
112
113 <table>
114
115 <tr>
116 <th colspan={{ conditions_present|length}}>c</th>
117 <th colspan=4>states</th>
118 <th colspan={{ conditions_present|length}}>t</th>
119 <th>add enabler</th>
120 </tr>
121
122 {% for condition in conditions_present %}
123 {% set outer_loop = loop %}
124 <tr>
125
126 {% for _ in conditions_present %}
127 {% if outer_loop.index > loop.index %}
128 <td class="cond_line_{{loop.index0 % 3}}">
129 {% else %}
130 <td class="cond_line_{{outer_loop.index0 % 3}}">
131 {% endif %}
132 {% if outer_loop.index == loop.index  %}
133 {% endif %}
134 </td>
135 {% endfor %}
136
137 <td class="cond_line_{{loop.index0 % 3}}">[{% if condition.is_active %}X{% else %}&nbsp;{% endif %}]</td>
138 <td colspan=3 class="cond_line_{{loop.index0 % 3}}"><a href="condition?id={{condition.id_}}">{{condition.title.newest|e}}</a></td>
139
140 {% for _ in conditions_present %}
141 {% if outer_loop.index0 + loop.index0 < conditions_present|length %}
142 <td class="cond_line_{{outer_loop.index0 % 3}}">
143 {% else %}
144 <td class="cond_line_{{(conditions_present|length - loop.index) % 3}}">
145 {% endif %}
146 {% endfor %}
147 {% set list_name = "todos_for_%s"|format(condition.id_) %}
148 <td><input name="new_todo" list="{{list_name}}" autocomplete="off" /></td>
149 {{ macros.datalist_of_titles(list_name, enablers_for[condition.id_]) }}
150 </td>
151 </tr>
152 {% endfor %}
153
154 <tr>
155 {% for condition in conditions_present %}
156 <td class="cond_line_{{loop.index0 % 3}}"></td>
157 {% endfor %}
158 <th colspan={{ 4 }}>doables</th>
159 {% for condition in conditions_present %}
160 <td class="cond_line_{{(conditions_present|length - loop.index) % 3}}"></td>
161 {% endfor %}
162 <th>comments</th>
163 </tr>
164 {% for node in top_nodes %}
165 {{ show_node_undone(node, 0) }}
166 {% endfor %}
167
168 </table>
169
170 <h4>done</h4>
171
172 <table>
173 {% for node in top_nodes %}
174 {{ show_node_done(node, 0, []) }}
175 {% endfor %}
176 </table>
177
178 </form>
179
180 {{ macros.datalist_of_titles("processes", processes) }}
181 {% endblock %}