From: Christian Heller Date: Tue, 16 Jan 2024 02:30:57 +0000 (+0100) Subject: Various small fixes. X-Git-Url: https://plomlompom.com/repos/te"st.html?a=commitdiff_plain;h=28bd91c52ce1eab2b26793097e0d9cabc3c33c64;p=misc Various small fixes. --- diff --git a/ledger.py b/ledger.py index a26ca0f..46035bc 100755 --- a/ledger.py +++ b/ledger.py @@ -1248,7 +1248,7 @@ class LedgerHandler(PlomHandler): 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')] diff --git a/todo.py b/todo.py index 171514f..a4d7da0 100644 --- a/todo.py +++ b/todo.py @@ -483,7 +483,7 @@ class TodoDB(PlomDB): 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 @@ -707,7 +707,7 @@ class TodoDB(PlomDB): 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( diff --git a/todo_templates/task.html b/todo_templates/task.html index 05a6611..85347ef 100644 --- a/todo_templates/task.html +++ b/todo_templates/task.html @@ -28,19 +28,19 @@ add:
children -{% for task in linked_tasks %} +{% for subtask in linked_tasks %} - - + + {% endfor %} -{% for task in filtered_tasks %} +{% for subtask in filtered_tasks %} - - + + {% endfor %}
{{task.title}}{{subtask.title}}
---
{{task.title}}{{subtask.title}}