home · contact · privacy
Improve accounting scripts.
[misc] / todo_templates / task.html
index 56d0abea8d44029df030ed5c40360a361682f901..2666d0da260cb1ea2ba1109adb8403b559678fe5 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% };
+tr.toplevel th { padding-right: 1em; }
+tr.toplevel td, tr.toplevel th { padding-top: 1em; }
+tr.lowlevel td, tr.lowlevel th { padding-top: 0em; }
 {% 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_ }}" />
+
+<form action="task" method="POST">
+<input type="hidden" name="task_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>
+
+<tr class="toplevel">
+<th>add as todo</th>
+<td><input name="add_as_todo" type="checkbox" /> to {{ selected_date }}</td>
+<input name="selected_date" type="hidden" value="{{ selected_date }}" />
+</tr>
+
+<tr class="toplevel">
+<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 class="toplevel">
+<th>comment</th>
+<td class="input">
+<textarea name="comment" cols=100 rows=5>{{task.comment|e}}</textarea>
+</td>
+</tr>
+
+<tr class="toplevel">
+<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>
+{% endif %}
+</td>
+</tr>
+
+<tr class="toplevel">
+<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 />
+       <!--
+add: <input name="tag" value="" size=15 >
+       -->
+add: {{ macros.tagselection(submit_name='tag', selected_tags=task.tags.now, all_tags=tags) }}
+<details>
+<summary>history</summary>
+<ul>
+{% for k,v in task.tags.history.items() | sort(attribute='0', reverse=True) %}
+<li>{{ k }}: {{ v|e }}
 {% 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>
+</ul>
+</details>
+</td>
+</tr>
+
+{% if task.parents %}
+<tr class="toplevel">
+<th>parents</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 %}
+<ul>
+{% for parent in task.parents %}
+<li><a href="task?id={{parent.id_}}">{{parent.title.now}}</a>
 {% 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 />
+</ul>
+</td>
+</tr>
 {% endif %}
+    
+<tr class="toplevel">
+<th>children</th>
+<td>
+{% if task.subtasks %}
+<table>
+{% for subtask in task.subtasks %}
+<tr class="lowlevel">
+<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 %}
+</table>
+{% endif %}
+<br />
+add: <input name="subtask" list="tasks" />
 </td>
 </tr>
+<datalist id="tasks">
+{% for subtask in filtered_tasks %}
+<option value="{{subtask.id_}}">{{subtask.title.now}}</option>
+{% endfor %}
+</datalist>
+
 </table>
-<input type="submit" value="update" />
-</form>
-<form action="{{action|e}}" method="POST">
-<input type="hidden" name="id" value="{{ task.id_ }}" />
-{% include 'tagfilters.html' %}
+<input id="update_button" class="update" type="submit" name="update" value="update" />
+<div class="delete">
+<input class="delete" type="submit" name="delete" value="delete" />
+</div>
 </form>
-{% include 'watch_form.html' %}
 {% endblock %}