liquid_feedback_frontend

annotate app/main/member/settings_notification.lua @ 1253:235a36a08da1

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

Impressum / About Us