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">
11 {% include 'tagfilters.html' %}
13 <input name="hide_chosen_tasks" type="checkbox" {% if hide_chosen_tasks %}checked{% endif %} /> hide chosen tasks<br />
14 search: <input name="search" value="{{search|e}}" />
15 <input type="submit" name="filter" value="filter" />
18 <a href="pick_tasks?date={{prev_date}}">prev</a> | {{day.date}} | <a href="pick_tasks?date={{next_date}}">next</a> | {{day.comment}}
21 <input type="hidden" name="date" value="{{day.date}}" />
22 <input class="update" id="pick_upper" name="update" type="submit" value="pick" />
23 <input type="hidden" name="search" value="{{search|e}}" />
24 <table class="alternating">
27 <th {% if sort=='effort' %}class="desc"{% endif %}>
28 <a href="?sort=effort">effort</a>
30 <th {% if sort=='title' %}class="desc"{% endif %}>
31 <a href="?sort=title">what</a>
36 {% for todo in chosen_todos %}
39 <input name="chosen_todo" {% if todo.done or todo.day_effort %}class="protected"{% endif %} type="checkbox" value="{{todo.id_}}" checked>
42 {% if todo.day_effort %}{{todo.day_effort}} {% else %}({{todo.default_effort}}){% endif %}{% if todo.done and not "cancelled" in todo.contemporary_tags%}✓{% else %} {% endif %}
45 <a href="todo?id={{todo.id_}}&return_to=pick_tasks">
46 {% if "cancelled" in todo.tags.now %}<s>{% endif %}
47 {{todo.path|e}}{{todo.title|e}}
48 {%if "cancelled" in todo.tags.now %}</s>{% endif %}
58 <th colspan=4>earlier todos to continue</th>
61 {% for todo in relevant_todos %}
64 <input name="choose_todo" type="checkbox" value="{{todo.id_}}">
67 {{todo.all_days_effort}}/{{todo.default_effort}}
70 <a href="todo?id={{todo.id_}}">{{todo.day.date}} {{todo.task.title.then|e}}</a>
79 <th colspan=4>tasks</th>
82 {% for task in tasks %}
85 <input name="choose_task" type="checkbox" value="{{task.id_}}">
88 ({{task.default_effort.then}})
91 <a href="task?id={{ task.id_ }}&return_to=pick_tasks" />{{ task.title.then|e }}</a>
100 <input class="update" id="pick_lower" name="update" type="submit" value="pick" />
103 {% include 'watch_form.html' %}
105 function make_selectables_toggler(neighbor_id, input_name) {
106 var neighbor = document.getElementById(neighbor_id);
107 var button = document.createElement('button');
108 button.textContent = 'toggle selectables';
109 button.onclick = function(event) {
110 event.preventDefault();
111 let checkboxes = document.getElementsByName(input_name);
112 for (let i = 0; i < checkboxes.length; i++) {
113 if (checkboxes[i].classList.contains('protected')) {
116 checkboxes[i].click();
117 changes_to_comit = true;
120 neighbor.insertAdjacentElement('afterend', button);
122 make_selectables_toggler('pick_upper', 'chosen_todo');
123 make_selectables_toggler('pick_lower', 'choose_task');