liquid_feedback_frontend
view app/main/member/settings_notification.lua @ 1250:84f6e17c7ceb
Completed support for new notification system
author | bsw |
---|---|
date | Sun Apr 17 15:03:44 2016 +0200 (2016-04-17) |
parents | c0fd12b97d65 |
children | 1d645a8d20fc |
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 = "notify_level_none",
57 type = "radio", name = "disable_notifications", value = "true",
58 checked = app.session.member.disable_notifications and "checked" or nil
59 }
60 }
61 ui.tag{
62 tag = "label", attr = { ['for'] = "notify_level_none" },
63 content = _"I do not like to receive notifications by email"
64 }
65 end }
67 slot.put("<br />")
69 ui.tag{
70 tag = "input",
71 attr = {
72 type = "submit",
73 class = "btn btn-default",
74 value = _"Save"
75 },
76 content = ""
77 }
78 slot.put("<br /><br /><br />")
80 slot.put(" ")
81 if return_to == "home" then
82 ui.link {
83 module = "index", view = "index",
84 content = _"cancel"
85 }
86 else
87 ui.link {
88 module = "member", view = "show", id = app.session.member_id,
89 content = _"cancel"
90 }
91 end
92 end )
93 end )
95 end
96 }