1 {% extends 'base.html' %}
3 table.alternating tr:nth-child(even) {
4 background-color: #f2f2f2;
6 table.alternating tr:nth-child(odd) {
7 background-color: #ffffff;
9 td.checkbox, td.number { height: 0.1em; padding: 0em; text-align: center; }
10 td.checkbox { width: 0.1em }
11 td button { height: 1.5em; padding: 0em; margin: 0em }
12 td details { display: inline }
13 input[type="number"] { text-align: right; }
16 <form action="{{action|e}}" method="POST">
17 {% include 'tagfilters.html' %}
19 <input name="expect_unchosen_done" type="hidden" value="1"/>
20 <input name="hide_unchosen" type="checkbox" {% if db.hide_unchosen %}checked{% endif %} /> hide unchosen <input name="hide_done" type="checkbox" {% if db.hide_done %}checked{% endif %} /> hide done
24 <form id="form_to_watch" action="{{action|e}}" method="POST">
27 <a href="{{db.prefix}}/day?selected_date={{prev_date}}">prev</a> | {{db.selected_date}} | <a href="{{db.prefix}}/day?selected_date={{next_date}}">next</a> |
28 {{ db.selected_day.todos_sum|round(2) }} ({{ db.selected_day.todos_sum2|round(2)}}) |
29 comment: <input name="day_comment" value="{{ db.selected_day.comment|e }}">
30 <input type="submit" value="update">
31 <input type="hidden" name="selected_date" value="{{ db.selected_date }}" />
33 <table class="alternating">
34 <tr><th>task</th><th class="checkbox">choose?</th><th class="checkbox">done?</th><th>weight</th><th>edit?</th><th>day tags</th><th>comment</th></tr>
35 {% for uuid, t in db.tasks.items() | sort(attribute='1.title') %}
36 {% if t.visible and (uuid not in db.selected_day.todos.keys() or db.selected_day.todos[uuid].visible) %}
38 <input name="t_uuid" value="{{ uuid }}" type="hidden" >
39 <td><details><summary>] <a href="{{db.prefix}}/task?id={{ uuid }}" />{{ t.current_title|e }}</a></summary>tags: {% for tag in t.tags | sort %}<a href="{{db.prefix}}/day?t_and={{tag|e}}">{{ tag }}</a> {% endfor %}</details></td>
40 {% if uuid in db.selected_day.todos.keys() %}
41 <td class="checkbox"><input name="choose" type="checkbox" value="{{ uuid }}" checked></td>
42 <td class="checkbox"><input name="done" type="checkbox" value="{{ uuid }}" {% if db.selected_day.todos[uuid].done %}checked{% endif %}></td>
43 <td class="number"><input class="day_weight_input" name="day_weight" type="number" step=0.1 size=8 value="{% if db.selected_day.todos[uuid].day_weight is not none %}{{ db.selected_day.todos[uuid].day_weight }}{% endif %}" placeholder={{ t.current_default_weight }} ></td>
44 <td><a href="{{db.prefix}}/todo?task={{uuid}}&date={{ db.selected_date }}">edit</a></td>
45 <td>{% for tag in db.selected_day.todos[uuid].day_tags | sort %}<a href="{{db.prefix}}/tags?t_and={{tag|e}}">{{ tag }}</a> {% endfor %}</td>
46 <td>{{ db.selected_day.todos[uuid].comment|e }}</td>
48 <td class="checkbox"><input name="choose" type="checkbox" value="{{ uuid }}"</td>
49 <td class="checkbox"><input name="done" type="checkbox" value="{{ uuid }}"></td>
50 <td class="number"><input class="day_weight_input" name="day_weight" type="number" step=0.1 size=8 placeholder={{ t.current_default_weight }} ></td>
59 <input type="submit" value="update">
61 {% include 'watch_form.html' %}
63 var day_weight_inputs = document.getElementsByClassName("day_weight_input");
64 for (let i = 0; i < day_weight_inputs.length; i++) {
65 let input = day_weight_inputs[i];
66 let button = document.createElement('button');
67 button.innerHTML = '+1×';
68 button.onclick = function(event) {
69 event.preventDefault();
71 input.value = parseFloat(input.value) + parseFloat(input.placeholder);
73 input.value = parseFloat(input.placeholder);
75 input.value = parseFloat(input.value).toFixed(1);
76 formHasChanged = true;
78 input.insertAdjacentElement('afterend', button);