home · contact · privacy
Improve accounting scripts.
[misc] / todo_templates / task.html
index 7284f1bdc7218f0f85c54f5a6c5d94a6b4c92b84..c26d33a9d8d30d7b4c8efebe938b1aed86bc2b4d 100644 (file)
@@ -1,11 +1,31 @@
 {% extends 'base.html' %}
 
+
+
 {% block css %}
 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 %}
 
+
+
+{% macro draw_task(task) %}
+<a href="task?id={{task.id_}}">{{task.title.now}}</a>
+{% endmacro %}
+
+
+
+{% macro task_with_deps(task, indent) %}
+{% for i in range(indent) %}&nbsp;&nbsp;{% if loop.last %}+{% endif %}{% endfor %}
+{{ draw_task(task) }}<br />
+{% for task in task.deps %}
+{{ task_with_deps(task, indent+1) }}
+{% endfor %}
+{% endmacro %}
+
+
+
 {% block content %}
 <h3>edit task</h3>
 
@@ -44,9 +64,6 @@ tr.lowlevel td, tr.lowlevel th { padding-top: 0em; }
 <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>
@@ -56,7 +73,6 @@ tr.lowlevel td, tr.lowlevel th { padding-top: 0em; }
 {% endfor %}
 </ul>
 </details>
-{% endif %}
 </td>
 </tr>
 
@@ -75,45 +91,67 @@ add: {{ macros.tagselection(submit_name='tag', selected_tags=task.tags.now, all_
 </td>
 </tr>
 
-{% if task.parents %}
+{% if task.dependers %}
 <tr class="toplevel">
-<th>parents</th>
+<th>dependers</th>
 <td>
 <ul>
-{% for parent in task.parents %}
+{% for parent in task.dependers %}
 <li><a href="task?id={{parent.id_}}">{{parent.title.now}}</a>
 {% endfor %}
 </ul>
 </td>
 </tr>
 {% endif %}
-    
+
 <tr class="toplevel">
 <th>children</th>
 <td>
-{% if task.subtasks %}
+{% if task.deps %}
 <table>
-{% for subtask in task.subtasks %}
+{% for dep in task.deps %}
 <tr class="lowlevel">
 <td>
-<input name="subtask" type="checkbox" value="{{subtask.id_}}" checked/>
+<input name="dep" type="checkbox" value="{{dep.id_}}" checked/>
 </td>
 <td>
-<a href="task?id={{subtask.id_}}">{{subtask.title.now}}</a>
+{% if dep.deps %}
+<details>
+<summary>
+{% endif %}
+{{ draw_task(dep)}}
+{% if dep.deps %}
+</summary>
+{% for s in dep.deps %}
+{{ task_with_deps(s, 1) }}
+{% endfor %}
+</details>
+{% endif %}
 </td>
 </tr>
 {% endfor %}
 </table>
 {% endif %}
-<br />
-add: <input name="subtask" list="tasks" />
+add: <input name="dep" list="tasks" autocomplete="off" />
 </td>
 </tr>
-<datalist id="tasks">
-{% for subtask in filtered_tasks %}
-<option value="{{subtask.id_}}">{{subtask.title.now}}</option>
+{{ macros.datalist_tasks(filtered_tasks) }}
+
+{% if task.deps %}
+<tr class="toplevel">
+<th>as chain</th>
+<td>
+<table>
+{% for dep in task.deps_chain %}
+<tr class="lowlevel">
+<td class="number">{{dep.deps_depth}}</td>
+<td><a href="task?id={{ dep.id_ }}">{{dep.title.now}}</a></td>
+</tr>
 {% endfor %}
-</datalist>
+</table>
+</td>
+</tr>
+{% endif %}
 
 </table>
 <input id="update_button" class="update" type="submit" name="update" value="update" />