elif prefix + '/edit' == parsed_url.path:
index = int(postvars['index'][0])
edit_mode = postvars['edit_mode'][0]
- validate = submit_button in {'save', 'copy', 'check'}
+ validate = submit_button in {'update', 'add', 'copy', 'check'}
starts_at = '?' if index == -1 else db.bookings[index].starts_at
if 'textarea' == edit_mode:
lines = [LedgerTextLine(line) for line in postvars['booking'][0].rstrip().split('\n')]
def add_task(self, id_=None, dict_source=None, return_id=False):
id_ = id_ if id_ else str(uuid4())
- t = Task.from_dict(self, dict_source, id_) if dict_source else Task(self, id)
+ t = Task.from_dict(self, dict_source, id_) if dict_source else Task(self, id_)
self.tasks[id_] = t
if return_id:
return id_, t
def show_task(self, id_, return_to='', search=''):
task = self.tasks[id_] if id_ else self.add_task()
- selected = id_ in self.selected_day.todos.keys()
+ selected = task.id_ in self.selected_day.todos.keys()
linked_tasks = [self.tasks[l] for l in task.links]
filtered_tasks = [t for t in self.tasks.values() if t.visible and t != self and (t not in linked_tasks) and (len(search) == 0 or t.matches(search))]
return j2env.get_template('task.html').render(
<tr><th>children</th>
<td>
<table>
-{% for task in linked_tasks %}
+{% for subtask in linked_tasks %}
<tr>
-<td><input name="link_task" type="checkbox" value="{{task.id_}}" checked/></td>
-<td><a href="task?id={{task.id_}}">{{task.title}}</a></td>
+<td><input name="link_task" type="checkbox" value="{{subtask.id_}}" checked/></td>
+<td><a href="task?id={{subtask.id_}}">{{subtask.title}}</a></td>
</tr>
{% endfor %}
<tr>
<th colspan=2>---</th>
</tr>
-{% for task in filtered_tasks %}
+{% for subtask in filtered_tasks %}
<tr>
-<td><input name="link_task" type="checkbox" value="{{task.id_}}"/></td>
-<td><a href="task?id={{task.id_}}">{{task.title}}</a></td>
+<td><input name="link_task" type="checkbox" value="{{subtask.id_}}"/></td>
+<td><a href="task?id={{subtask.id_}}">{{subtask.title}}</a></td>
</tr>
{% endfor %}
</table>