home · contact · privacy
Improve accounting scripts.
[misc] / todo_templates / tasks.html
index 7d245dc9aba46139f8889c61eb6895eb988de9e1..a125985d9df32c85d338a327f0f1d00985531d37 100644 (file)
@@ -1,27 +1,49 @@
 {% extends 'base.html' %}
 {% block css %}
 table.alternating tr:nth-child(even) {
-    background-color: #e2e2e2;
+    background-color: #cccccc;
 }
 table.alternating tr:nth-child(odd) {
     background-color: #ffffff;
 }
 td.number { text-align: right; }
+tr.expanded { color: #888888; }
 {% endblock %}
 {% block content %}
-<form action="{{action|e}}" method="POST">
+<form action="tasks" method="POST">
 {% include 'tagfilters.html' %}
 </form>
 <table class="alternating">
 <tr><th>default<br />effort</th><th>task</th><th>tags</th></tr>
-{% for uuid, t in db.tasks.items() | sort(attribute='1.title') %}
+
+{% for uuid, t in db.tasks.items() | sort(attribute='1.title.now') %}
 {% if t.visible %}
+
 <tr>
+<td class="number">{{ t.default_effort.now }}</a></td>
+<td>
+{% if uuid == expand_uuid %}
+<a href="tasks">[-]</a>
+{% elif t.subtasks|count > 0 %}
+<a href="tasks?expand_uuid={{uuid}}">[+]</a>
+{% endif %}
+<a href="task?id={{ uuid }}" />{{ t.title.now|e }}</a></td>
+<td>{% for tag in t.tags.now | sort %}<a href="tasks?and_tag={{tag|e}}">{{ tag }}</a> {% endfor %}</td>
+</tr>
+
+{% if uuid == expand_uuid %}
+{% for uuid, t in expanded_tasks.items() %}
+<tr class="expanded">
 <td class="number">{{ t.default_effort }}</a></td>
-<td><a href="{{db.prefix}}/task?id={{ uuid }}" />{{ t.title|e }}</a></td>
-<td>{% for tag in t.tags | sort %}<a href="{{db.prefix}}/tasks?t_and={{tag|e}}">{{ tag }}</a> {% endfor %}</td>
+<td>&nbsp; [+] <a href="task?id={{ uuid }}" />{{ t.title.now|e }}</a></td>
+<td>{% for tag in t.tags.now | sort %}<a href="tasks?and_tag={{tag|e}}">{{ tag }}</a> {% endfor %}</td>
+</tr>
+{% endfor %}
+{% endif %}
+
 {% endif %}
 {% endfor %}
+
 </table>
 {% endblock %}