home · contact · privacy
Improve todo accounting.
[misc] / todo_templates / task.html
diff --git a/todo_templates/task.html b/todo_templates/task.html
new file mode 100644 (file)
index 0000000..56d0abe
--- /dev/null
@@ -0,0 +1,47 @@
+{% extends 'base.html' %}
+{% block css %}
+th, td { vertical-align: top; text-align: left}
+td.input { width: 100%; }
+td.checkbox { width: 0.1em; height: 0.1em; padding: 0em; text-align: center; }
+input[type="number"] { text-align: right; }
+input[type="text"] { width: 100% }
+textarea { width: 100% };
+{% endblock %}
+{% block content %}
+<form id="form_to_watch" action="{{action|e}}" method="POST">
+<h3>edit task</h3>
+<input type="hidden" name="id" value="{{ task.id_ }}" />
+<table>
+<tr><th>title</th><td class="input"><input name="title" type="text" value="{{ task.title|e }}" /><details><summary>history</summary><ul>{% for k,v in task.title_history.items() | sort(attribute='0', reverse=True) %}<li>{{ k }}: {{ v|e }}{% endfor %}</ul></details></td></tr>
+<tr><th>default weight</th><td class="input"><input type="number" name="default_weight" value="{{ task.default_weight }}" step=0.1 size=8 required /><details><summary>history</summary><ul>{% for k,v in task.default_weight_history.items() | sort(attribute='0', reverse=True) %}<li>{{ k }}: {{ v|e }}{% endfor %}</ul></details></td></tr>
+<tr><th>tags</th>
+<td>
+{% for tag in db.t_tags | sort %}
+<input type="checkbox" name="tag_{{tag|e}}"{% if tag in task.tags %} checked{% endif %}/> {{ tag }}<br />
+{% endfor %}
+add: <input name="joined_tags" type="text" value="" ><br />
+<details><summary>history</summary><ul>{% for k,v in task.tags_history.items() | sort(attribute='0', reverse=True) %}<li>{{ k }}: {{ v|e }}{% endfor %}</ul></details>
+</td></tr>
+<tr><th>links</th>
+<td>
+{% for other_task_id, other_task in db.tasks.items() | sort(attribute='1.title') %}
+{% if task.id_ != other_task_id and other_task.visible and other_task_id in task.links %}
+<input name="link_{{other_task_id}}" type="checkbox" checked /> <a href="{{db.prefix}}/task?id={{ other_task_id }}">{{ other_task.title|e }}</a><br />
+{% endif %}
+{% endfor %}
+{% for other_task_id, other_task in db.tasks.items() | sort(attribute='1.title') %}
+{% if task.id_ != other_task_id and other_task.visible and not other_task_id in task.links %}
+<input name="link_{{other_task_id}}" type="checkbox"/> <a href="{{db.prefix}}/task?id={{ other_task_id }}">{{ other_task.title|e }}</a><br />
+{% endif %}
+{% endfor %}
+</td>
+</tr>
+</table>
+<input type="submit" value="update" />
+</form>
+<form action="{{action|e}}" method="POST">
+<input type="hidden" name="id" value="{{ task.id_ }}" />
+{% include 'tagfilters.html' %}
+</form>
+{% include 'watch_form.html' %}
+{% endblock %}