From: Christian Heller Date: Thu, 6 Jun 2024 01:54:54 +0000 (+0200) Subject: For Processes and Conditions, in edit page title warn if creation NEW. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/day?a=commitdiff_plain;h=4c546e0133670dd10aec890c3cea6329c3a29663;p=plomtask For Processes and Conditions, in edit page title warn if creation NEW. --- diff --git a/plomtask/http.py b/plomtask/http.py index ea1358a..2d5db82 100644 --- a/plomtask/http.py +++ b/plomtask/http.py @@ -214,7 +214,7 @@ class TaskHandler(BaseHTTPRequestHandler): id_ = self.params.get_int_or_none('id') c = Condition.by_id(self.conn, id_, create=True) ps = Process.all(self.conn) - return {'condition': c, + return {'condition': c, 'is_new': c.id_ is None, 'enabled_processes': [p for p in ps if c in p.conditions], 'disabled_processes': [p for p in ps if c in p.blockers], 'enabling_processes': [p for p in ps if c in p.enables], @@ -240,7 +240,7 @@ class TaskHandler(BaseHTTPRequestHandler): if title_64: title = b64decode(title_64.encode()).decode() process.title.set(title) - return {'process': process, + return {'process': process, 'is_new': process.id_ is None, 'steps': process.get_steps(self.conn), 'owners': process.used_as_step_by(self.conn), 'n_todos': len(Todo.by_process_id(self.conn, process.id_)), diff --git a/templates/condition.html b/templates/condition.html index 6b28a52..b20b5fe 100644 --- a/templates/condition.html +++ b/templates/condition.html @@ -4,7 +4,7 @@ {% block content %} -

condition

+

{% if is_new %}NEW {% endif %}condition

diff --git a/templates/process.html b/templates/process.html index bc8d6e6..f073a57 100644 --- a/templates/process.html +++ b/templates/process.html @@ -40,7 +40,7 @@ add sub-step: process +

{% if is_new %}NEW {% endif %}process