home · contact · privacy
Improve todo accounting script.
[misc] / todo_templates / task.html
index 11f45377caab0d42ebe1bac09ff7cb7e7f3defb4..7a8f981fef608cbad413a66b866ad452cbbfdc88 100644 (file)
 {% 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% };
+th { padding-right: 1em; }
 {% endblock %}
+
 {% block content %}
-<form id="form_to_watch" action="task" method="POST">
 <h3>edit task</h3>
-<input type="hidden" name="id" value="{{ task.id_ }}" />
+
+<form id="form_to_watch" action="task" method="POST">
+<input type="hidden" name="task_id" value="{{ task.id_ }}" />
 <input type="hidden" name="return_to" value="{{ return_to }}" />
 <table>
-<tr><th>title</th><td class="input"><input name="title" type="text" value="{{ task.title.now|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></th><td><input type="checkbox" name="as_todo" {% if selected %}checked{% endif%}> selected for {{db.selected_date}}</td></tr>
-<tr><th>comment</th><td class="input"><textarea name="comment">{{task.comment|e}}</textarea></td></tr>
+
+<tr>
+<th>title</th>
+<td class="input">
+<input name="title" type="text" value="{{ task.title.now|e }}" size=100 />
+<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>comment</th>
+<td class="input">
+<textarea name="comment" cols=100>{{task.comment|e}}</textarea>
+</td>
+</tr>
+
 <tr>
 <th>default effort</th>
 <td class="input">
 {% if task.subtasks %}
 {{ task.default_effort.now }}
 {% else %}
-<input type="number" name="default_effort" value="{{ task.default_effort.now }}" step=0.1 size=8 required /><details><summary>history</summary><ul>{% for k,v in task.default_effort.history.items() | sort(attribute='0', reverse=True) %}<li>{{ k }}: {{ v|e }}{% endfor %}</ul></details>
+<input type="number" name="default_effort" value="{{ task.default_effort.now }}" step=0.1 size=8 required />
+<details>
+<summary>history</summary>
+<ul>
+{% for k,v in task.default_effort.history.items() | sort(attribute='0', reverse=True) %}
+<li>{{ k }}: {{ v|e }}
+{% endfor %}
+</ul>
+</details>
 {% endif %}
 </td>
 </tr>
-<tr><th>tags</th>
+
+<tr>
+<th>tags</th>
 <td>
-{% for tag in db.t_tags | sort %}
-<input type="checkbox" name="tag_{{tag|e}}"{% if tag in task.tags.now %} checked{% endif %}/> {{ tag }}<br />
+{% for tag in tags | sort %}
+<input type="checkbox" name="tag_{{tag|e}}"{% if tag in task.tags.now %} 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>children</th>
+add: <input name="joined_tags" type="text" value="" size=100>
+<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>children</th>
 <td>
 <table>
+
 {% for subtask in task.subtasks %}
 <tr>
-<td><input name="subtask" type="checkbox" value="{{subtask.id_}}" checked/></td>
-<td><a href="task?id={{subtask.id_}}">{{subtask.title.now}}</a></td>
+<td>
+<input name="subtask" type="checkbox" value="{{subtask.id_}}" checked/>
+</td>
+<td>
+<a href="task?id={{subtask.id_}}">{{subtask.title.now}}</a>
+</td>
 </tr>
 {% endfor %}
+
 <tr>
 <th colspan=2>---</th>
 </tr>
+
 {% for subtask in filtered_tasks %}
 <tr>
-<td><input name="subtask" type="checkbox" value="{{subtask.id_}}"/></td>
-<td><a href="task?id={{subtask.id_}}">{{subtask.title.now}}</a></td>
+<td>
+<input name="subtask" type="checkbox" value="{{subtask.id_}}"/>
+</td>
+<td>
+<a href="task?id={{subtask.id_}}">{{subtask.title.now}}</a>
+</td>
 </tr>
 {% endfor %}
+
 </table>
 </td>
 </tr>
+
 </table>
-<input type="submit" value="update" />
-</form>
-<form action="task" method="POST">
-<input type="hidden" name="id" value="{{task.id_}}" />
+<input class="update" type="submit" name="update" value="update" />
+<hr />
 {% include 'tagfilters.html' %}
 <br />
 search: <input name="search" value="{{search|e}}" />
 <input type="submit" name="filter" value="filter" />
 </form>
+
 {% include 'watch_form.html' %}
+<script>
+mere_filter_inputs = mere_filter_inputs.concat(['search']);
+</script> 
 {% endblock %}