liquid_feedback_frontend

view app/main/member/settings_notification.lua @ 1257:580634189551

Fix syntax error
author bsw
date Sun Apr 17 16:49:02 2016 +0200 (2016-04-17)
parents 0455f101565c
children 10a54c55951f
line source
1 local return_to = param.get("return_to")
2 local return_to_area_id param.get("return_to_area_id", atom.integer)
4 ui.titleMember(_"notification settings")
6 execute.view {
7 module = "member", view = "_sidebar_whatcanido", params = {
8 member = app.session.member
9 }
10 }
12 ui.form{
13 attr = { class = "vertical" },
14 module = "member",
15 action = "update_notify_level",
16 routing = {
17 ok = {
18 mode = "redirect",
19 module = return_to == "area" and "area" or return_to == "home" and "index" or "member",
20 view = return_to == "area" and "show" or return_to == "home" and "index" or "show",
21 id = return_to == "area" and return_to_area_id or return_to ~= "home" and app.session.member_id or nil
22 }
23 },
24 content = function()
26 ui.section( function()
28 ui.sectionHead( function()
29 ui.heading { level = 1, content = _"Do you like to receive updates by email?" }
30 end )
33 ui.sectionRow( function()
35 ui.container{ content = function()
36 ui.tag{
37 tag = "input",
38 attr = {
39 id = "notify_level_all",
40 type = "radio", name = "disable_notifications", value = "false",
41 checked = not app.session.member.disable_notifications and "checked" or nil
42 }
43 }
44 ui.tag{
45 tag = "label", attr = { ['for'] = "notify_level_all" },
46 content = _"I like to receive notifications"
47 }
48 end }
50 slot.put("<br />")
52 ui.container{ content = function()
53 ui.tag{
54 tag = "input",
55 attr = {
56 id = "digest_on",
57 type = "radio", name = "digest", value = "true",
58 checked = not app.session.member.digest_dow and "checked" or nil
59 }
60 }
61 ui.tag{
62 tag = "label", attr = { ['for'] = "digest_on" },
63 content = _"Send me updates on issue phase changes and a regular digest"
64 }
66 ui.tag{ content = _"Day:" }
67 slot.put(" ")
68 ui.field.select{
69 name = "notification_dow",
70 foreign_records = {
71 daily = _"daily",
72 ["0"] = _"Sunday",
73 ["1"] = _"Monday",
74 ["2"] = _"Tuesday",
75 ["3"] = _"Wednesday",
76 ["4"] = _"Thursday",
77 ["5"] = _"Friday",
78 ["6"] = _"Saturday",
79 ["7"] = _"Sunday",
80 }
81 }
83 slot.put(" ")
85 ui.tag{ content = _"Hour:" }
86 slot.put(" ")
87 local foreign_records = {}
88 for i = 0, 23 do
89 foreign_records[#foreign_records+1] = {
90 id = i,
91 name = printf("%02d", i),
92 }
93 end
94 ui.field.select{
95 name = "notification_hour",
96 foreign_records = foreign_records,
97 foreign_id = "id",
98 foreign_name = "name"
99 }
100 end }
101 end }
103 ui.container{ content = function()
104 ui.tag{
105 tag = "input",
106 attr = {
107 id = "digest_off",
108 type = "radio", name = "digest", value = "false",
109 checked = not app.session.member.digest_dow and "checked" or nil
110 }
111 }
112 ui.tag{
113 tag = "label", attr = { ['for'] = "digest_off" },
114 content = _"Send me only updates on issue phase changes"
115 }
116 end }
120 ui.container{ content = function()
121 ui.tag{
122 tag = "input",
123 attr = {
124 id = "notify_level_none",
125 type = "radio", name = "disable_notifications", value = "true",
126 checked = app.session.member.disable_notifications and "checked" or nil
127 }
128 }
129 ui.tag{
130 tag = "label", attr = { ['for'] = "notify_level_none" },
131 content = _"I do not like to receive notifications by email"
132 }
133 end }
135 slot.put("<br />")
137 ui.tag{
138 tag = "input",
139 attr = {
140 type = "submit",
141 class = "btn btn-default",
142 value = _"Save"
143 },
144 content = ""
145 }
146 slot.put("<br /><br /><br />")
148 slot.put(" ")
149 if return_to == "home" then
150 ui.link {
151 module = "index", view = "index",
152 content = _"cancel"
153 }
154 else
155 ui.link {
156 module = "member", view = "show", id = app.session.member_id,
157 content = _"cancel"
158 }
159 end
160 end )
161 end )
163 end
164 }

Impressum / About Us