forked from chiefonboarding/ChiefOnboarding
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslack_misc.py
64 lines (59 loc) · 1.73 KB
/
slack_misc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# misc items
from django.utils.translation import gettext as _
from admin.sequences.models import Sequence
def get_new_hire_approve_sequence_options():
return {
"type": "input",
"block_id": "seq",
"label": {
"type": "plain_text",
"text": _("Select sequences"),
},
"element": {
"type": "multi_static_select",
"placeholder": {
"type": "plain_text",
"text": _("Select sequences"),
},
"options": [
{
"text": {"type": "plain_text", "text": seq.name},
"value": str(seq.id),
}
# max is 100 as per Slack limits
for seq in Sequence.objects.all()[:100]
],
"action_id": "answers",
},
}
def get_new_hire_first_message_buttons():
return [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": _("Click a button to see more information :)"),
},
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": _("To do items"),
},
"action_id": "show_to_do_items",
},
{
"type": "button",
"text": {
"type": "plain_text",
"text": _("Resources"),
},
"action_id": "show_resource_items",
},
],
},
]