home · contact · privacy
Enable Condition.is_active toggling in Condition view.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 29 Apr 2024 03:09:41 +0000 (05:09 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 29 Apr 2024 03:09:41 +0000 (05:09 +0200)
plomtask/http.py
templates/condition.html

index 316fd0805588a00b59dc28fbd8094fc8634dcd87..196540a9ace22bee3fa9b2b6ebe2220a6a36e7d4 100644 (file)
@@ -287,6 +287,7 @@ class TaskHandler(BaseHTTPRequestHandler):
             condition.remove(self.conn)
             return '/conditions'
         condition = Condition.by_id(self.conn, id_, create=True)
+        condition.is_active = self.form_data.get_all_str('is_active') != []
         condition.title.set(self.form_data.get_str('title'))
         condition.description.set(self.form_data.get_str('description'))
         condition.save(self.conn)
index a0a9f45c54c3372bad772c1a67f33ba699e1630d..92f04eb9688c2aad9992d810778f3780fad8d542 100644 (file)
@@ -5,6 +5,7 @@
 <form action="condition?id={{condition.id_ or ''}}" method="POST">
 title: <input name="title" value="{{condition.title.newest|e}}" />
 description: <input name="description" value="{{condition.description.newest|e}}" />
+is active: <input name="is_active" type="checkbox" {% if condition.is_active %}checked{% endif %} />
 
 <input class="btn-harmless" type="submit" name="update" value="update" />
 <div class="btn-to-right">