home · contact · privacy
For Processes and Conditions, in edit page title warn if creation NEW.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 6 Jun 2024 01:54:54 +0000 (03:54 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 6 Jun 2024 01:54:54 +0000 (03:54 +0200)
plomtask/http.py
templates/condition.html
templates/process.html

index ea1358a00f754e217a4ecb9e469f04607962c082..2d5db82ccd2e85e7a56ae13c2e52134592efccd7 100644 (file)
@@ -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_)),
index 6b28a525112ada4d9f8c33a62d77353a83df40a2..b20b5fe04c3520264a4e4864769889b46b7d9227 100644 (file)
@@ -4,7 +4,7 @@
 
 
 {% block content %}
-<h3>condition</h3>
+<h3>{% if is_new %}NEW {% endif %}condition</h3>
 <form action="condition?id={{condition.id_ or ''}}" method="POST">
 <table>
 
index bc8d6e6d64305feeb710bda44c7f6e8de9f6ecb3..f073a5798ed6d0e0a757d4155334f1da7d721e66 100644 (file)
@@ -40,7 +40,7 @@ add sub-step: <input name="new_step_to_{{step_id}}" list="step_candidates" autoc
 
 
 {% block content %}
-<h3>process</h3>
+<h3>{% if is_new %}NEW {% endif %}process</h3>
 <form action="process?id={{process.id_ or ''}}" method="POST">
 <table>