]> git.cworth.org Git - turbot/commitdiff
Add a "new_hunt" name to the button we place on the app's home view
authorCarl Worth <cworth@cworth.org>
Tue, 13 Oct 2020 20:57:52 +0000 (13:57 -0700)
committerCarl Worth <cworth@cworth.org>
Tue, 13 Oct 2020 21:30:02 +0000 (14:30 -0700)
This will be more reliable to match on than any particular label text.

turbot/views.py

index 122d92ceff4ad43ee985808d2e4305951a0e5a48..c7c8ac71271ad1323e6fb48e5caf19e0c79c9bbd 100644 (file)
@@ -18,14 +18,15 @@ def actions(*elements):
         "elements": list(elements)
     }
 
-def button(label):
+def button(label, name):
     return {
         "type": "button",
         "text": {
             "type": "plain_text",
             "text": label,
             "emoji": True
-        }
+        },
+        "value": name
     }
 
 def home(user_id, body):
@@ -39,6 +40,6 @@ def home(user_id, body):
         "type": "home",
         "blocks": [
             section(text("This is (or soon will be) a list of available puzzle hunts)")),
-            actions(button("New hunt"))
+            actions(button("New hunt", "new_hunt"))
         ]
     }