home · contact · privacy
Add VersionedAttributes history pages for Conditions.
[plomtask] / plomtask / http.py
index 2c7e628bdd14fd572a29c5686a5d3a5a37ceb409..88725fcc57b9ada06d2bb85a4744b489a8bf97e7 100644 (file)
@@ -96,7 +96,9 @@ class TaskHandler(BaseHTTPRequestHandler):
             self._init_handling()
             if self.site in {'calendar', 'day', 'process', 'process_titles',
                              'process_descriptions', 'process_efforts',
-                             'processes', 'todo', 'condition', 'conditions'}:
+                             'processes', 'todo', 'condition',
+                             'condition_titles', 'condition_descriptions',
+                             'conditions'}:
                 template = f'{self.site}.html'
                 ctx = getattr(self, f'do_GET_{self.site}')()
                 html = self.server.jinja.get_template(template).render(**ctx)
@@ -156,6 +158,18 @@ class TaskHandler(BaseHTTPRequestHandler):
         id_ = self.params.get_int_or_none('id')
         return {'condition': Condition.by_id(self.conn, id_, create=True)}
 
+    def do_GET_condition_titles(self) -> dict[str, object]:
+        """Show title history of Condition of ?id=."""
+        id_ = self.params.get_int_or_none('id')
+        condition = Condition.by_id(self.conn, id_)
+        return {'condition': condition}
+
+    def do_GET_condition_descriptions(self) -> dict[str, object]:
+        """Show description historys of Condition of ?id=."""
+        id_ = self.params.get_int_or_none('id')
+        condition = Condition.by_id(self.conn, id_)
+        return {'condition': condition}
+
     def do_GET_process(self) -> dict[str, object]:
         """Show Process of ?id=."""
         id_ = self.params.get_int_or_none('id')