15 def actions(*elements):
18 "elements": list(elements)
21 def button(label, name):
32 def home(turb, user_id, body):
33 """Returns a view to be published as the turbot home tab for user_id
35 The body argument is a dictionary as provided by the Slack request.
36 The return value is a dictionary suitable to be published to the
37 Slack views_publish API."""
39 response = turb.db.Table("hunts").scan()
40 hunts = response['Items']
45 section(text("*Active hunts*")),
46 *[section(text(hunt['name'])) for hunt in hunts if hunt['active']],
47 actions(button("New hunt", "new_hunt"))