1 {% extends 'base.html' %}
3 table.alternating tr:nth-child(even) {
4 background-color: #cccccc;
6 table.alternating tr:nth-child(odd) {
7 background-color: #ffffff;
9 th, td { text-align: left}
10 th.desc { background: linear-gradient(to bottom, white, grey); }
11 th.center { text-align: center; }
12 td.checkbox, td.number { height: 0.1em; padding: 0em; text-align: center; }
13 td.checkbox { width: 0.1em; text-align: center; }
14 td button { height: 1.5em; padding: 0em; margin: 0em }
15 input[type="number"] { text-align: right; }
16 th.desc { background: linear-gradient(to bottom, white, grey); }
19 <form action="do_todos" method="POST">
20 {% include 'tagfilters.html' %}
22 <input name="hide_done" type="checkbox" {% if hide_done %}checked{% endif %} /> hide done
23 <input type="submit" name="filter" value="filter" />
26 <form id="form_to_watch" action="do_todos" method="POST">
28 | <a href="do_todos?date={{prev_date}}">prev</a> | {{day.date}} | <a href="do_todos?date={{next_date}}">next</a> |
29 comment: <input name="day_comment" value="{{day.comment|e}}">
30 <input type="submit" value="update">
31 <input type="hidden" name="date" value="{{day.date}}" />
33 <table class="alternating">
35 <th {% if sort=='done' %}class="desc"{% endif %}><a href="?sort=done">done</a></th>
36 <th class="center{% if sort=='default_effort' %} desc{% endif %}"><a href="?sort=default_effort">effort</a></th>
37 <th {% if sort=='importance' %}class ="desc"{% endif %}><a href="?sort=importance">importance</a></th>
38 <th {% if sort=='title' %}class="desc"{% endif %}><a href="?sort=title">todo</a></th>
40 {% for todo in todos %}
42 <input name="todo_id" value="{{todo.id_}}" type="hidden" >
44 {% if todo.children %}
45 {% if todo.done %}✓{% else %} {% endif %}
47 <input name="done" type="checkbox" value="{{todo.id_}}" {% if todo.done %}checked{% endif %}>
51 {% if todo.children %}
52 <input type="hidden" name="effort" value="0" />
54 <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)}} >
57 <td class="number"><input name="importance" type="number" step=0.1 size=7 value={{todo.importance}} } ></td>
58 <td><a href="todo?id={{todo.id_}}">{{todo.path}}{{todo.title}}</a></td>
59 <td><input name="effort_comment" type="text" size=100 value="{{todo.comment|e}}" /></td>
63 <input type="submit" value="update">
65 {% include 'watch_form.html' %}
67 var effort_inputs = document.getElementsByClassName("effort_input");
68 for (let i = 0; i < effort_inputs.length; i++) {
69 let input = effort_inputs[i];
70 let button = document.createElement('button');
71 button.innerHTML = '+' + parseFloat(input.placeholder).toFixed(1);
72 button.onclick = function(event) {
73 event.preventDefault();
75 input.value = parseFloat(input.value) + parseFloat(input.placeholder);
77 input.value = parseFloat(input.placeholder);
79 input.value = parseFloat(input.value).toFixed(1);
80 formHasChanged = true;
82 input.insertAdjacentElement('afterend', button);