X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=plomtask%2Fhttp.py;h=bb05fa9618effaf7279ffe8553f872d3d1f16e05;hb=eea64af900512aaa83146a02f6e7c6d0092b5b3a;hp=773548f8a9201e3e48ab8093b6431ab826842110;hpb=8b606f7c555c250f0d5ab8314aa95ce7efda07c7;p=plomtask diff --git a/plomtask/http.py b/plomtask/http.py index 773548f..bb05fa9 100644 --- a/plomtask/http.py +++ b/plomtask/http.py @@ -110,7 +110,7 @@ class TaskHandler(BaseHTTPRequestHandler): finally: self.conn.close() - def do_GET_calendar(self) -> dict[str, object]: + def _do_GET_calendar(self) -> dict[str, object]: """Show Days from ?start= to ?end=.""" start = self.params.get_str('start') end = self.params.get_str('end') @@ -124,6 +124,14 @@ class TaskHandler(BaseHTTPRequestHandler): today = date_in_n_days(0) return {'start': start, 'end': end, 'days': days, 'today': today} + def do_GET_calendar(self) -> dict[str, object]: + """Show Days from ?start= to ?end= – normal view.""" + return self._do_GET_calendar() + + def do_GET_calendar_txt(self) -> dict[str, object]: + """Show Days from ?start= to ?end= – minimalist view.""" + return self._do_GET_calendar() + def do_GET_day(self) -> dict[str, object]: """Show single Day of ?date=.""" date = self.params.get_str('date', date_in_n_days(0)) @@ -156,6 +164,7 @@ class TaskHandler(BaseHTTPRequestHandler): id_ = self.params.get_int('id') todo = Todo.by_id(self.conn, id_) return {'todo': todo, + 'process_candidates': Process.all(self.conn), 'todo_candidates': Todo.by_date(self.conn, todo.date), 'condition_candidates': Condition.all(self.conn)} @@ -359,6 +368,9 @@ class TaskHandler(BaseHTTPRequestHandler): continue child = Todo.by_id(self.conn, child_id) todo.add_child(child) + for process_id in self.form_data.get_all_int('make'): + made = Todo.create_with_children(self.conn, process_id, todo.date) + todo.add_child(made) effort = self.form_data.get_str('effort', ignore_strict=True) todo.effort = float(effort) if effort else None todo.set_conditions(self.conn, self.form_data.get_all_int('condition'))