1 {% extends 'base.html' %}
6 td.checkbox { text-align: center; }
7 td { vertical-align: middle; }
8 td button { padding: 0em; }
9 th.centered { text-align: center; }
10 ul { padding-left: 1.5em; margin: 0; }
11 details > summary.todo {
14 details > summary.has_dependers {
15 list-style-type: '[+]:';
17 details[open] > summary.has_dependers {
18 list-style-type: '[▼]:';
20 details > summary.has_deps::after {
23 details[open] > summary.has_deps::after {
26 table.undone_todos tr.deps_undone {
27 background-color: #cccccc;
32 details.adoptables summary span {
33 background-color: #cccccc;
35 table.undone_todos tr td {
36 border-bottom: 1px dotted black;
38 td.left { text-align: left; }
39 td.unbreakable { white-space: nowrap; }
44 {% macro todo_title_expandable(todo, show_deps_doneness, ignore=0) %}
45 {% if todo.has_dependers or todo.has_deps %}
47 <summary class="todo {% if todo.has_dependers %}has_dependers{% endif %} {% if todo.has_deps %}has_deps{% endif %}">
49
51 <a href="todo?id={{todo.id_}}&return_to=day_todos">{{todo.title|e}}</a>
52 {% if todo.has_dependers or todo.has_deps %}
54 {% if todo.has_dependers %}
57 {% for path in todo.depender_paths %}
58 <li>{% for depender_todo in path %}<a href="todo?id={{depender_todo.id_}}&return_to=day_todos">{{ depender_todo.title|e }}</a>{% if not loop.last %}:{% endif %}{% endfor %}
62 {% if todo.has_deps %}
65 {% for dep_todo in todo.deps %}
67 {% if show_deps_doneness == true %}{{ macros.doneness_string(dep_todo) }}{% endif %}
68 <a href="todo?id={{dep_todo.id_}}&return_to=day_todos">{{ dep_todo.title|e }}</a>{% if dep_todo.has_deps %}:+{% endif %}
78 {% macro todo_title_as_tree_node(todo, indent) %}
79 {% for i in range(indent-1) %} {% endfor %}
80 {% if indent>0 %} +{% endif %}
81 {% if todo.been_observed %}({% endif %}<a href="todo?id={{todo.id_}}&return_to=day_todos">{{todo.title}}</a>{% if todo.been_observed %}){% endif %}
86 {% macro draw_undone_todo_row(todo, title_drawer, indent_or_doneness) %}
87 <tr {% if todo.deps_done == false %}class="deps_undone"{% endif %}>
88 {% if todo.already_listed %}
89 <td class="checkbox"><input type="checkbox" disabled /></td>
90 <td class="number left"><input type="number" value="{{todo.day_effort}}" size=7 disabled /></td>
91 <td class="number"><input type="number" value="{{todo.importance}}" size=7 disabled /></td>
93 {{ title_drawer(todo, indent_or_doneness ) }}
95 <td><input value="{{todo.comment|e}}" size=100 disabled /></td>
97 <input name="todo_id" value="{{todo.id_}}" type="hidden" >
99 <input name="done" type="checkbox" value="{{todo.id_}}" {% if todo.done %}checked{% endif %} {% if todo.deps_done == false %}disabled{% endif %}>
101 <td class="number unbreakable">
102 <input class="effort_input" name="effort" type="number" step=0.1 size=7 value="{% if todo.day_effort is not none %}{{todo.day_effort}}{% endif %}" placeholder={{"%.1f"|format(todo.task.default_effort.then)}} >
105 <input name="importance" type="number" step=0.1 size=7 value={{todo.importance}} } >
108 {{ title_drawer(todo, indent_or_doneness) }}
111 <input name="effort_comment" type="text" size=100 value="{{todo.comment|e}}" />
119 {% macro draw_done_todo_row(todo, title_drawer, indent) %}
121 <td class="number">{{ '{:4.1f}'.format(todo.effort_at_selected_date) }}</td>
122 <td class="number">{{ '{:4.1f}'.format(todo.effort_at_selected_date + todo.dep_efforts) }}</td>
124 {{ title_drawer(todo, indent) }}
128 <td>{{ todo.comment }}</td>
134 {% macro draw_todo_rows(todos, is_tree_shaped, todo_row_drawer, indent, show_deps_doneness=false) %}
135 {% for todo in todos %}
136 {% if is_tree_shaped %}
137 {{ todo_row_drawer(todo, todo_title_as_tree_node, indent) }}
138 {% if not todo.been_observed and todo.deps %}
139 {{ draw_todo_rows(todo.deps, is_tree_shaped, todo_row_drawer, indent+1) }}
142 {{ todo_row_drawer(todo, todo_title_expandable, show_deps_doneness) }}
153 <form id="form_to_watch" action="day_todos" method="POST">
154 {% include 'tagfilters.html' %}
156 <input id="filter_button" type="submit" name="filter" value="filter" />
158 | <a href="day_todos?date={{prev_date}}">prev</a> | {{day.date}} | <a href="day_todos?date={{next_date}}">next</a> |
159 comment: <input name="day_comment" value="{{day.comment|e}}">
160 <input class="update" type="submit" name="update" value="update">
161 <input type="hidden" name="date" value="{{day.date}}" />
162 | show as {% if is_tree_shaped %}<a href="?tree=0">flat</a>|<b>tree</b>{% else %}<b>flat</b>|<a href="?tree=1">tree</a>{% endif %}
167 task quick-add: <input name="choose_task" size=50 list="tasks" autocomplete="off">
168 don't adopt, make new: <input type="checkbox" name="dont_adopt" />
170 {{ macros.datalist_tasks(all_tasks, with_weight=true) }}
172 {% if adoptable_past_todos %}
173 <details class="adoptables">
174 <summary><span>there are adoptable/unfinished past todos ({{adoptable_past_todos|count}})</span></summary>
175 <table class="alternating">
177 <th>adopt?</th><th>date</th><th>title</th><th>comment</th>
179 {% for todo in adoptable_past_todos %}
181 <td class="checkbox"><input name="choose_todo" type="checkbox" value="{{todo.id_}}"></td>
182 <td>{{todo.earliest_date}}</td>
183 <td><a href="todo?id={{todo.id_}}">{{todo.title|e}}</a></td>
184 <td>{{todo.comment|e}}</td>
191 {% if undone_todos %}
192 <table class="undone_todos">
194 {{ macros.sort_head(undone_sort, "sort_done", "done", "undone_sort") }}
195 {{ macros.sort_head(undone_sort, "default_effort", "effort", "undone_sort") }}
196 {{ macros.sort_head(undone_sort, "importance", "importance", "undone_sort") }}
197 {{ macros.sort_head(undone_sort, "title", "todo", "undone_sort") }}
200 {{ draw_todo_rows(undone_todos, is_tree_shaped, draw_undone_todo_row, 0, show_deps_doneness=true) }}
204 <input id="update_button" class="update" type="submit" name="update" value="update">
209 <table class="alternating">
211 {{ macros.sort_head(done_sort, "effort_at_selected_date", "single<br />effort", "done_sort") }}
212 {{ macros.sort_head(done_sort, "family_effort", "family<br />effort", "done_sort") }}
213 {{ macros.sort_head(done_sort, "title", "todo", "done_sort") }}
216 {{ draw_todo_rows(done_todos, is_tree_shaped, draw_done_todo_row, 0) }}
220 {% include 'watch_form.html' %}
222 var effort_inputs = document.getElementsByClassName("effort_input");
223 for (let i = 0; i < effort_inputs.length; i++) {
224 let input = effort_inputs[i];
225 let button = document.createElement('button');
226 button.innerHTML = '+' + parseFloat(input.placeholder).toFixed(1);
227 button.onclick = function(event) {
228 event.preventDefault();
230 input.value = parseFloat(input.value) + parseFloat(input.placeholder);
232 input.value = parseFloat(input.placeholder);
234 input.value = parseFloat(input.value).toFixed(1);
235 changes_to_commit = true;
237 input.insertAdjacentElement('afterend', button);