1 {% extends 'base.html' %}
4 #pick_upper, #pick_lower { margin-right: 1em; }
8 <h3>pick todos for day</h3>
10 <form id="form_to_watch" action="pick_tasks" method="POST">
13 <a href="pick_tasks?date={{prev_date}}">prev</a> | {{day.date}} | <a href="pick_tasks?date={{next_date}}">next</a> | {{day.comment}}
16 <input type="hidden" name="date" value="{{day.date}}" />
17 <input class="update" id="pick_upper" name="update" type="submit" value="pick" />
18 <input type="hidden" name="search" value="{{search|e}}" />
22 <th colspan=5>task quick-add: <input name="choose_task" size=50 list="tasks"></th>
25 {% for task in all_tasks %}
26 <option value="{{task.id_}}">{{task.title.now}}</option>
32 <th {% if sort=='effort' %}class="desc"{% endif %}>
33 <a href="?sort=effort">effort</a>
35 <th {% if sort=='title' %}class="desc"{% endif %}>
36 <a href="?sort=title">what</a>
41 {% for todo in chosen_todos %}
44 <input name="chosen_todo" {% if todo.done or todo.day_effort %}class="protected"{% endif %} type="checkbox" value="{{todo.id_}}" checked>
47 {% if todo.day_effort %}{{todo.day_effort}} {% else %}({{todo.default_effort}}){% endif %}{% if todo.done and not "cancelled" in todo.contemporary_tags%}✓{% else %} {% endif %}
50 <a href="todo?id={{todo.id_}}&return_to=pick_tasks">
51 {% if "cancelled" in todo.tags.now %}<s>{% endif %}
52 {{todo.path|e}}{{todo.title|e}}
53 {%if "cancelled" in todo.tags.now %}</s>{% endif %}
63 <th colspan=4>earlier todos to continue</th>
66 {% for todo in relevant_todos %}
69 <input name="choose_todo" type="checkbox" value="{{todo.id_}}">
72 {{todo.all_days_effort}}/{{todo.default_effort}}
75 <a href="todo?id={{todo.id_}}">{{todo.dated_title|e}}</a>
84 <th colspan=4>tasks</th>
87 {% for task in filtered_tasks %}
90 <input name="choose_task" type="checkbox" value="{{task.id_}}">
93 ({{task.default_effort.then}})
96 <a href="task?id={{ task.id_ }}&return_to=pick_tasks" />{{ task.title.then|e }}</a>
105 <input id="update_button" class="update" id="pick_lower" name="update" type="submit" value="pick" />
107 {% include 'tagfilters.html' %}
109 <input name="hide_chosen_tasks" type="checkbox" {% if hide_chosen_tasks %}checked{% endif %} /> hide chosen tasks<br />
110 search: <input name="search" value="{{search|e}}" />
111 <input id="filter_button" type="submit" name="filter" value="filter" />
114 {% include 'watch_form.html' %}
116 function make_selectables_toggler(neighbor_id, input_name) {
117 var neighbor = document.getElementById(neighbor_id);
118 var button = document.createElement('button');
119 button.textContent = 'toggle selectables';
120 button.onclick = function(event) {
121 event.preventDefault();
122 let checkboxes = document.getElementsByName(input_name);
123 for (let i = 0; i < checkboxes.length; i++) {
124 if (checkboxes[i].classList.contains('protected')) {
127 checkboxes[i].click();
128 changes_to_comit = true;
131 neighbor.insertAdjacentElement('afterend', button);
133 make_selectables_toggler('pick_upper', 'chosen_todo');
134 make_selectables_toggler('pick_lower', 'choose_task');