rev |
line source |
bsw@1045
|
1 local return_to = param.get("return_to")
|
bsw@1045
|
2
|
bsw@1045
|
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@1045
|
39 type = "radio", name = "notify_level", value = "all",
|
bsw@1045
|
40 checked = app.session.member.notify_level == 'all' 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_discussion",
|
bsw@1045
|
56 type = "radio", name = "notify_level", value = "discussion",
|
bsw@1045
|
57 checked = app.session.member.notify_level == 'discussion' and "checked" or nil
|
bsw@1045
|
58 }
|
bsw@1045
|
59 }
|
bsw@1045
|
60 ui.tag{
|
bsw@1045
|
61 tag = "label", attr = { ['for'] = "notify_level_discussion" },
|
bsw@1045
|
62 content = _"Only for issues reaching the discussion phase"
|
bsw@1045
|
63 }
|
bsw@1045
|
64 end }
|
bsw@1045
|
65
|
bsw@1045
|
66 slot.put("<br />")
|
bsw@286
|
67
|
bsw@1045
|
68 ui.container{ content = function()
|
bsw@1045
|
69 ui.tag{
|
bsw@1045
|
70 tag = "input",
|
bsw@1045
|
71 attr = {
|
bsw@1045
|
72 id = "notify_level_verification",
|
bsw@1045
|
73 type = "radio", name = "notify_level", value = "verification",
|
bsw@1045
|
74 checked = app.session.member.notify_level == 'verification' and "checked" or nil
|
bsw@1045
|
75 }
|
bsw@1045
|
76 }
|
bsw@1045
|
77 ui.tag{
|
bsw@1045
|
78 tag = "label", attr = { ['for'] = "notify_level_verification" },
|
bsw@1045
|
79 content = _"Only for issues reaching the verification phase"
|
bsw@1045
|
80 }
|
bsw@1045
|
81 end }
|
bsw@1045
|
82
|
bsw@1045
|
83 slot.put("<br />")
|
bsw@1045
|
84
|
bsw@1045
|
85 ui.container{ content = function()
|
bsw@1045
|
86 ui.tag{
|
bsw@1045
|
87 tag = "input",
|
bsw@1045
|
88 attr = {
|
bsw@1045
|
89 id = "notify_level_voting",
|
bsw@1045
|
90 type = "radio", name = "notify_level", value = "voting",
|
bsw@1045
|
91 checked = app.session.member.notify_level == 'voting' and "checked" or nil
|
bsw@1045
|
92 }
|
bsw@1045
|
93 }
|
bsw@1045
|
94 ui.tag{
|
bsw@1045
|
95 tag = "label", attr = { ['for'] = "notify_level_voting" },
|
bsw@1045
|
96 content = _"Only for issues reaching the voting phase"
|
bsw@1045
|
97 }
|
bsw@1045
|
98 end }
|
bsw@1045
|
99
|
bsw@1045
|
100 slot.put("<br />")
|
bsw@1045
|
101
|
bsw@1045
|
102 ui.container{ content = function()
|
bsw@1045
|
103 ui.tag{
|
bsw@1045
|
104 tag = "input",
|
bsw@1045
|
105 attr = {
|
bsw@1045
|
106 id = "notify_level_none",
|
bsw@1045
|
107 type = "radio", name = "notify_level", value = "none",
|
bsw@1045
|
108 checked = app.session.member.notify_level == 'none' and "checked" or nil
|
bsw@1045
|
109 }
|
bsw@1045
|
110 }
|
bsw@1045
|
111 ui.tag{
|
bsw@1045
|
112 tag = "label", attr = { ['for'] = "notify_level_none" },
|
bsw@1045
|
113 content = _"I do not like to receive notifications by email"
|
bsw@1045
|
114 }
|
bsw@1045
|
115 end }
|
bsw@1045
|
116
|
bsw@1045
|
117 slot.put("<br />")
|
bsw@1045
|
118
|
bsw@1045
|
119 ui.container { content = _"Notifications are only send to you about events in the subject areas you subscribed, the issues you are interested in and the initiatives you are supporting." }
|
bsw@1045
|
120
|
bsw@1045
|
121
|
bsw@1045
|
122 slot.put("<br />")
|
bsw@1045
|
123
|
bsw@1045
|
124 ui.tag{
|
bsw@1045
|
125 tag = "input",
|
bsw@1045
|
126 attr = {
|
bsw@1045
|
127 type = "submit",
|
bsw@1045
|
128 class = "btn btn-default",
|
bsw@1045
|
129 value = _"Save"
|
bsw@1045
|
130 },
|
bsw@1045
|
131 content = ""
|
bsw@348
|
132 }
|
bsw@1045
|
133 slot.put("<br /><br /><br />")
|
bsw@1045
|
134
|
bsw@1045
|
135 slot.put(" ")
|
bsw@1045
|
136 if return_to == "home" then
|
bsw@1045
|
137 ui.link {
|
bsw@1045
|
138 module = "index", view = "index",
|
bsw@1045
|
139 content = _"cancel"
|
bsw@1045
|
140 }
|
bsw@1045
|
141 else
|
bsw@1045
|
142 ui.link {
|
bsw@1045
|
143 module = "member", view = "show", id = app.session.member_id,
|
bsw@1045
|
144 content = _"cancel"
|
bsw@1045
|
145 }
|
bsw@1045
|
146 end
|
bsw@1045
|
147 end )
|
bsw@1045
|
148 end )
|
bsw@474
|
149
|
bsw@286
|
150 end
|
bsw@286
|
151 }
|
bsw@287
|
152
|