1 {% extends 'base.html' %}
3 td.number { text-align: right; }
4 table.alternating tr:nth-child(even) {
5 background-color: #cccccc;
7 table.alternating tr:nth-child(odd) {
8 background-color: #ffffff;
10 th { text-align: left; background-color: white; border: 1px solid black; }
11 th.desc { background: linear-gradient(to bottom, white, grey); }
14 <form action="pick_tasks" method="POST">
15 {% include 'tagfilters.html' %}
17 <input name="hide_chosen_tasks" type="checkbox" {% if hide_chosen_tasks %}checked{% endif %} /> hide chosen tasks<br />
18 search: <input name="search" value="{{search|e}}" />
19 <input type="submit" name="filter" value="filter" />
22 <h3>pick todos for day</h3>
23 <p><a href="pick_tasks?date={{prev_date}}">prev</a> | {{day.date}} | <a href="pick_tasks?date={{next_date}}">next</a> | {{day.comment}}</p>
24 <form id="form_to_watch" action="{{action|e}}" method="POST">
25 <input type="hidden" name="date" value="{{day.date}}" />
26 <input id="pick_upper" type="submit" value="pick" />
27 <table class="alternating">
30 <th {% if sort=='effort' %}class="desc"{% endif %}><a href="?sort=effort">effort</a></th>
31 <th {% if sort=='title' %}class="desc"{% endif %}><a href="?sort=title">what</a></th>
34 {% for todo in chosen_todos %}
37 <input name="chosen_todo" {% if todo.done or todo.day_effort %}class="protected"{% endif %} type="checkbox" value="{{todo.id_}}" checked>
40 {% if todo.day_effort %}{{todo.day_effort}} {% else %}({{todo.default_effort}}){% endif %}{% if todo.done and not "cancelled" in todo.contemporary_tags%}✓{% else %} {% endif %}</td>
41 <td><a href="todo?id={{todo.id_}}">{% if "cancelled" in todo.contemporary_tags %}<s>{% endif %}{% if "deadline" in todo.contemporary_tags %}DEADLINE: {% endif %}<a href="todo?id={{todo.id_}}&return_to=pick_tasks" />{{todo.path|e}}{{todo.title|e}}</a>{%if "cancelled" in todo.contemporary_tags%}</s>{% endif %}</a></td>
42 <td>{{todo.comment|e}}</td>
46 <th colspan=4>earlier todos to continue</th>
48 {% for todo in relevant_todos %}
51 <input name="choose_todo" type="checkbox" value="{{todo.id_}}">
53 <td class="number">{{todo.all_days_effort}}/{{todo.default_effort}}</td>
54 <td><a href="todo?id={{todo.id_}}">{{todo.day.date}} {{todo.task.title.then|e}}</a></td>
55 <td>{{todo.comment|e}}</td>
58 <th colspan=4>tasks</th>
59 {% for task in tasks %}
62 <input name="choose_task" type="checkbox" value="{{task.id_}}">
64 <td class="number">({{task.default_effort.then}}) </td>
65 <td><a href="task?id={{ task.id_ }}&return_to=pick_tasks" />{{ task.title.then|e }}</a></td>
66 <td>{{task.comment|e}}</td>
70 <input type="hidden" name="search" value="{{search|e}}" />
71 <input id="pick_lower" type="submit" value="pick" />
73 {% include 'watch_form.html' %}
75 function make_selectables_toggler(neighbor_id, input_name) {
76 var neighbor = document.getElementById(neighbor_id);
77 var button = document.createElement('button');
78 button.textContent = 'toggle selectables';
79 button.onclick = function(event) {
80 event.preventDefault();
81 let checkboxes = document.getElementsByName(input_name);
82 for (let i = 0; i < checkboxes.length; i++) {
83 if (checkboxes[i].classList.contains('protected')) {
86 checkboxes[i].click();
87 formHasChanged = true;
90 neighbor.insertAdjacentElement('afterend', button);
92 make_selectables_toggler('pick_upper', 'chosen_todo');
93 make_selectables_toggler('pick_lower', 'choose_task');