rev |
line source |
bsw@1045
|
1 local return_to = param.get("return_to")
|
bsw@1045
|
2
|
bsw@1126
|
3 ui.titleMember(_"notification settings")
|
bsw@286
|
4
|
bsw@1045
|
5 execute.view {
|
bsw@1045
|
6 module = "member", view = "_sidebar_whatcanido", params = {
|
bsw@1045
|
7 member = app.session.member
|
bsw@1045
|
8 }
|
bsw@1045
|
9 }
|
bsw@286
|
10
|
bsw@286
|
11 ui.form{
|
bsw@286
|
12 attr = { class = "vertical" },
|
bsw@286
|
13 module = "member",
|
bsw@348
|
14 action = "update_notify_level",
|
bsw@286
|
15 routing = {
|
bsw@286
|
16 ok = {
|
bsw@286
|
17 mode = "redirect",
|
bsw@1045
|
18 module = return_to == "home" and "index" or "member",
|
bsw@1045
|
19 view = return_to == "home" and "index" or "show",
|
bsw@1045
|
20 id = return_to ~= "home" and app.session.member_id or nil
|
bsw@286
|
21 }
|
bsw@286
|
22 },
|
bsw@286
|
23 content = function()
|
bsw@1045
|
24
|
bsw@1045
|
25 ui.section( function()
|
bsw@1045
|
26
|
bsw@1045
|
27 ui.sectionHead( function()
|
bsw@1045
|
28 ui.heading { level = 1, content = _"For which issue phases do you like to receive notification emails?" }
|
bsw@1045
|
29 end )
|
bsw@1045
|
30
|
bsw@474
|
31
|
bsw@1045
|
32 ui.sectionRow( function()
|
bsw@1045
|
33
|
bsw@1045
|
34 ui.container{ content = function()
|
bsw@1045
|
35 ui.tag{
|
bsw@1045
|
36 tag = "input",
|
bsw@1045
|
37 attr = {
|
bsw@1045
|
38 id = "notify_level_all",
|
bsw@1248
|
39 type = "radio", name = "disable_notifications", value = "false",
|
bsw@1248
|
40 checked = not app.session.member.disable_notifications and "checked" or nil
|
bsw@1045
|
41 }
|
bsw@1045
|
42 }
|
bsw@1045
|
43 ui.tag{
|
bsw@1045
|
44 tag = "label", attr = { ['for'] = "notify_level_all" },
|
bsw@1045
|
45 content = _"I like to receive notifications"
|
bsw@1045
|
46 }
|
bsw@1045
|
47 end }
|
bsw@1045
|
48
|
bsw@1045
|
49 slot.put("<br />")
|
bsw@1045
|
50
|
bsw@1045
|
51 ui.container{ content = function()
|
bsw@1045
|
52 ui.tag{
|
bsw@1045
|
53 tag = "input",
|
bsw@1045
|
54 attr = {
|
bsw@1045
|
55 id = "notify_level_none",
|
bsw@1248
|
56 type = "radio", name = "disable_notifications", value = "true",
|
bsw@1248
|
57 checked = app.session.member.disable_notifications and "checked" or nil
|
bsw@1045
|
58 }
|
bsw@1045
|
59 }
|
bsw@1045
|
60 ui.tag{
|
bsw@1045
|
61 tag = "label", attr = { ['for'] = "notify_level_none" },
|
bsw@1045
|
62 content = _"I do not like to receive notifications by email"
|
bsw@1045
|
63 }
|
bsw@1045
|
64 end }
|
bsw@1045
|
65
|
bsw@1045
|
66 slot.put("<br />")
|
bsw@1045
|
67
|
bsw@1045
|
68 ui.tag{
|
bsw@1045
|
69 tag = "input",
|
bsw@1045
|
70 attr = {
|
bsw@1045
|
71 type = "submit",
|
bsw@1045
|
72 class = "btn btn-default",
|
bsw@1045
|
73 value = _"Save"
|
bsw@1045
|
74 },
|
bsw@1045
|
75 content = ""
|
bsw@348
|
76 }
|
bsw@1045
|
77 slot.put("<br /><br /><br />")
|
bsw@1045
|
78
|
bsw@1045
|
79 slot.put(" ")
|
bsw@1045
|
80 if return_to == "home" then
|
bsw@1045
|
81 ui.link {
|
bsw@1045
|
82 module = "index", view = "index",
|
bsw@1045
|
83 content = _"cancel"
|
bsw@1045
|
84 }
|
bsw@1045
|
85 else
|
bsw@1045
|
86 ui.link {
|
bsw@1045
|
87 module = "member", view = "show", id = app.session.member_id,
|
bsw@1045
|
88 content = _"cancel"
|
bsw@1045
|
89 }
|
bsw@1045
|
90 end
|
bsw@1045
|
91 end )
|
bsw@1045
|
92 end )
|
bsw@474
|
93
|
bsw@286
|
94 end
|
bsw@286
|
95 }
|
bsw@287
|
96
|