home · contact · privacy
Improve accounting scripts.
[misc] / todo_templates / todo.html
index 404ac1c496e32e3fdff533ccb634b2973029a1f6..45ed8a88bd21e63f334d3fd950f7f4df6eb803b4 100644 (file)
@@ -1,39 +1,54 @@
 {% extends 'base.html' %}
 
 {% block css %}
-th.toplevel { padding-right: 1em; }
-input[type="submit"].delete { background-color: #ff7777; }
-div.delete { float: right; }
+tr.toplevel th { padding-right: 1em; }
 td.center { text-align: center; }
+tr.toplevel td, tr.toplevel th { padding-top: 1em; }
+tr.lowlevel td, tr.lowlevel th { padding-top: 0em; }
 {% endblock %}
 
 {% block content %}
 <h3>edit todo</h3>
 
-<form id="form_to_watch" action="todo" method="POST">
+<form action="todo" method="POST">
 <input type="hidden" name="todo_id" value="{{todo.id_}}" />
-<input type="hidden" name="return_to" value="{{return_to}}" />
+<input type="hidden" name="importance" step=0.1 size=8 value="{{ todo.importance }}" />
 <table>
 
-<tr>
-<th class="toplevel">task</th>
-<td><a href="task?id={{ todo.task.id_ }}">{{ todo.task.title.then|e }}</a></td>
-</tr>
-
-<tr>
-<th class="toplevel">default effort</th>
-<td>{{ todo.default_effort }}</td>
+<tr class="toplevel">
+<th>task</th>
+<td colspan=2>
+<a href="task?id={{ todo.task.id_ }}">{{ todo.task.title.then|e }}</a>
+{% if todo.task.comment %}
+<pre>{{ todo.task.comment|e }}</pre>
+{% else %}
+<br />&nbsp;
+{% endif %}
+</td>
 </tr>
 
-<tr>
-<th class="toplevel">efforts</th>
+<tr class="toplevel">
+<th>work</th>
+<td>
+{% if todo.children %}
+[{% if todo.done %}✓{% else %} {% endif %}]
+{% else %}
+<input type="checkbox" name="done" {% if todo.done %}checked{% endif %}/>
+{% endif %}
+done<br />
+(sum: {{todo.all_days_effort}})
+</td>
 <td>
 <table>
-<tr><th>date</th><th>effort</th><th>delete</th></tr>
+<tr class="lowlevel">
+<th>date</th>
+<th>effort</th>
+<th>delete</th>
+</tr>
 {% for date, effort in todo.efforts.items() %}
-<tr>
+<tr class="lowlevel">
 <td>
-<input name="effort_date" size=10 value="{{date}}" {% if todo.children and effort %}disabled{% endif %}>
+<input name="effort_date" type="hidden" value="{{date}}">{{date}}
 </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 %} />
@@ -43,7 +58,7 @@ td.center { text-align: center; }
 </td>
 </tr>
 {% endfor %}
-<tr>
+<tr class="lowlevel">
 <td>
 <input name="effort_date" size=10 value="">
 </td>
@@ -55,50 +70,27 @@ td.center { text-align: center; }
 </td>
 </tr>
 
-<tr>
-<th class="toplevel">total effort</th>
-<td>{{todo.all_days_effort}}</td>
-</tr>
-
-<tr>
-<th class="toplevel">importance</th>
-<td class="input">
-<input type="number" name="importance" step=0.1 size=8 value="{{ todo.importance }}" />
-</td>
-</tr>
-
-<tr>
-<th class="toplevel">comment</th>
-<td class="input">
-<textarea name="comment" rows=3 cols=100>{{todo.comment|e}}</textarea>
+<tr class="toplevel">
+<th>comment</th>
+<td class="input" colspan=2>
+<input name="comment" size=100 value="{{todo.comment|e}}" />
 </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 class="toplevel">day tags</th>
-<td>
-{% for tag in tags | sort %}
-{% 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 }}
+<tr class="toplevel">
+<th>tags</th>
+<td colspan=2>
+new: <input name="tag" value="" size=15 >
+{% for tag in todo.task.tags.now | sort %}<select disabled><option>{{ tag }}</option></select>{% endfor %}
+{{ macros.tagselection(submit_name='tag', selected_tags=todo.day_tags, all_tags=tags) }}
 <br />
-{% endfor %}
-add: <input name="joined_day_tags" value="" size=100 >
 </td>
 </tr>
 
-<tr>
-<th class="toplevel">parents</th>
-<td>
+{% if todo.parents %}
+<tr class="toplevel">
+<th>parents</th>
+<td colspan=2>
 <ul>
 {% for parent in todo.parents %}
 <li><a href="todo?id={{parent.id_}}">{{parent.title}}</a>
@@ -106,52 +98,46 @@ add: <input name="joined_day_tags" value="" size=100 >
 </ul>
 </td>
 </tr>
+{% endif %}
 
-<tr>
-<th class="toplevel">children</th>
-<td>
-<table class="alternating">
-<tr>
-<th>adopt</th><th>effort</th><th>title</th><th>comments</th>
+<tr class="toplevel">
+<th>children</th>
+<td colspan=2>
+{% if todo.children %}
+<table>
+<tr class="lowlevel">
+<th>adopted</th><th>effort</th><th>title</th><th>comments</th>
 </tr>
 {% for todo in child_todos %}
-<tr>
+<tr class="lowlevel">
 <td class="center"><input name="adopt_child" type="checkbox" value="{{todo.id_}}" checked/></td>
 <td class="number">{{ '{:2.1f}'.format(todo.all_days_effort) }} {% if todo.done %}✓{% else %}&nbsp;{% endif %}</td>
 <td><a href="todo?id={{todo.id_}}">{{todo.day.date}} {{todo.title}}</a></td>
-</tr>
-{% endfor %}
-<tr>
-<th colspan=4>--------</th>
-</tr>
-{% for todo in filtered_todos %}
-<tr>
-<td class="center"><input name="adopt_child" type="checkbox" value="{{todo.id_}}" /></td>
-<td class="number">{{ '{:2.1f}'.format(todo.all_days_effort) }} {% if todo.done %}✓{% else %}&nbsp;{% endif %}</td>
-<td><a href="todo?id={{todo.id_}}">{{todo.day.date}} {{todo.title}}</a></td>
+<td>{{todo.comment}}</td>
 </tr>
 {% endfor %}
 </table>
+{% endif %}
+<br />
+make from task:<br />
+<input name="birth_child" list="tasks" size=100><br />
+adopt (from <input name="start" {% if start_date %}value="{{ start_date }}"{% endif %} placeholder="yesterday" /> to <input name="end" {% if end_date %}value="{{ end_date }}"{% endif %} placeholder="2030-12-31" />):<br />
+<input name="adopt_child" list="todos" size=100>
+<datalist id="todos">
+{% for todo in filtered_todos %}<option value="{{todo.id_}}">{{ '{:2.1f}'.format(todo.all_days_effort) }} {% if todo.done %}✓{% else %}&nbsp;&nbsp;{% endif %} {{todo.day.date}} {{todo.title}}</option>
+{% endfor %}
+</datalist>
+<datalist id="tasks">
+{% for task in filtered_tasks %}<option value="{{task.id_}}">{{task.title.now}}</option>
+{% endfor %}
+</datalist>
 </td>
 </tr>
 
 </table>
-<input class="update" name="update" type="submit" value="update" />
+<input id="update_button" class="update" name="update" type="submit" value="update" />
 <div class="delete">
 <input class="delete" type="submit" name="delete" value="delete" />
 </div>
-
-<hr />
-{% include 'tagfilters.html' %}
-<br />
-from: <input name="start" {% if start_date %}value="{{ start_date }}"{% endif %} placeholder="yesterday" />
-to: <input name="end" {% if end_date %}value="{{ end_date }}"{% endif %} placeholder="2030-12-31" />
-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', 'start', 'end']);
-</script> 
 {% endblock %}