home · contact · privacy
Improve accounting scripts.
[misc] / todo_templates / todo.html
index 035c9496ddac666e9785c163e1b301e4f097e730..beccb75e2d051d5446b9adce9018ef7b3d5f3dce 100644 (file)
@@ -1,11 +1,8 @@
 {% 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 action="todo" method="POST">
@@ -13,7 +10,7 @@ textarea { width: 100% };
 <input type="hidden" name="todo_id" value="{{todo.id_}}" />
 <input type="hidden" name="return_to" value="{{return_to}}" />
 <table>
-<tr><th>task</th><td><a href="{{db.prefix}}/task?id={{ todo.task.id_ }}">{{ todo.task.title|e }}</a></td></tr>
+<tr><th>task</th><td><a href="{{db.prefix}}/task?id={{ todo.task.id_ }}">{{ todo.task.title.then|e }}</a></td></tr>
 <tr><th>default effort</th><td>{{ todo.default_effort }}</td></tr>
 <tr>
 <th>efforts</th>
@@ -22,48 +19,59 @@ textarea { width: 100% };
 <tr><th>date</th><th>effort</th><th>delete</th>
 {% for date, effort in todo.efforts.items() %}
 <tr>
-<td><input name="effort_date" size=10 value="{{date}}"></td>
-<td><input type="number" name="effort" step=0.1 size=8 value="{{effort}}" placeholder="{{todo.default_effort}}" /></td>
-<td><input type="checkbox" name="delete_effort" value="{{date}}" />
+<td><input name="effort_date" size=10 value="{{date}}" {% if todo.children and effort %}disabled{% endif %}></td>
+<td><input type="number" name="effort" step=0.1 size=8 value="{{effort}}" placeholder="{{todo.default_effort}}" {% if todo.children and effort %}disabled{% endif %} /></td>
+<td>{% if not (todo.children and effort) %}<input type="checkbox" name="delete_effort" value="{{date}}" />{% endif %}</td>
 </tr>
 {% endfor %}
 <tr>
 <td><input name="effort_date" size=10 value=""></td>
-<td><input type="number" name="effort" step=0.1 size=8 value="" placeholder="{{todo.default_effort}}" /></td>
+<td><input type="number" name="effort" step=0.1 size=8 value="" {% if todo.children %} disabled {% else %} placeholder="{{todo.default_effort}}" {% endif %} /></td>
 </tr>
 </table>
 </td>
 </tr>
+<tr>
+<th>total effort</th><td>{{todo.all_days_effort}}</td>
+</tr>
 <tr><th>importance</th><td class="input"><input type="number" name="importance" step=0.1 size=8 value="{{ todo.importance }}" /></td></tr>
-<tr><th>comment</th><td class="input"><textarea name="comment">{{todo.comment|e}}</textarea></td></tr>
-<tr><th>done</th><td class="input"><input type="checkbox" name="done" {% if todo.done %}checked{% endif %}/></td></tr>
+<tr><th>comment</th><td class="input"><textarea name="comment" rows=3 cols=100>{{todo.comment|e}}</textarea></td></tr>
+<tr>
+<th>done</th>
+<td class="input">
+{% if todo.children %}✓{% else %}<input type="checkbox" name="done" {% if todo.done %}checked{% endif %}/>{% endif %}
+</td>
+</tr>
 <tr><th>day tags</th>
 <td>
 {% for tag in db.t_tags | sort %}
-{% if tag in todo.task.tags %}&nbsp;✓{% else %}<input type="checkbox" name="day_tag_{{tag|e}}"{% if tag in todo.day_tags %} checked{% endif %}/>{% endif %} {{ tag }}<br />
+{% if tag in todo.task.tags.now %}&nbsp;✓{% else %}<input type="checkbox" name="day_tag_{{tag|e}}"{% if tag in todo.day_tags %} checked{% endif %}/>{% endif %} {{ tag }}<br />
 {% endfor %}
-add: <input name="joined_day_tags" type="text" value="" >
+add: <input name="joined_day_tags" value="" size=100 >
 </td>
 </tr>
 <tr><th>parent</th><td>{% if todo.parent %}<a href="todo?id={{todo.parent.id_}}">{{todo.parent.title}}</a>{% else %}–{% endif %}</td></tr>
 <tr><th>children</th>
 <td>
 <table>
-{% for todo in linked_todos %}
+{% for todo in child_todos %}
 <tr>
-<td><input name="link_child" type="checkbox" value="{{todo.id_}}" checked/></td>
+       <!-- <td><input name="link_child" type="checkbox" value="{{todo.id_}}" checked disabled/></td> -->
+       <td>{% if todo.done %}✓{% endif %}</td><td>{{todo.all_days_effort}}</td>
 <td><a href="todo?id={{todo.id_}}">{{todo.title}}</a></td>
 </tr>
 {% endfor %}
+<!--
 <tr>
 <th colspan=2>---</th>
 </tr>
 {% for todo in filtered_todos %}
 <tr>
-<td><input name="link_todo" type="checkbox" value="{{todo.id_}}"/></td>
+<td><input name="link_todo" type="checkbox" value="{{todo.id_}}" disabled/></td>
 <td><a href="todo?id={{todo.id_}}">{{todo.title}}</a></td>
 </tr>
 {% endfor %}
+-->
 </table>
 </td>
 </table>