liquid_feedback_frontend

diff app/main/member/settings_notification.lua @ 348:9e6a23f11f32

Make notification settings work, unified redirect targets in settings
author bsw
date Wed Feb 29 11:51:39 2012 +0100 (2012-02-29)
parents ee477a136fd4
children 4e5bb26f0335
line diff
     1.1 --- a/app/main/member/settings_notification.lua	Tue Feb 28 22:50:48 2012 +0100
     1.2 +++ b/app/main/member/settings_notification.lua	Wed Feb 29 11:51:39 2012 +0100
     1.3 @@ -17,7 +17,7 @@
     1.4  ui.form{
     1.5    attr = { class = "vertical" },
     1.6    module = "member",
     1.7 -  action = "update_notification",
     1.8 +  action = "update_notify_level",
     1.9    routing = {
    1.10      ok = {
    1.11        mode = "redirect",
    1.12 @@ -31,7 +31,10 @@
    1.13      ui.container{ content = function()
    1.14        ui.tag{
    1.15          tag = "input", 
    1.16 -        attr = { type = "radio", name = "notification_level", value = "voting" }
    1.17 +        attr = {
    1.18 +          type = "radio", name = "notify_level", value = "voting",
    1.19 +          checked = app.session.member.notify_level == 'voting' and "checked" or nil
    1.20 +        }
    1.21        }
    1.22        ui.tag{ content = _"Voting phase" }
    1.23        ui.tag{ tag = "ul", content = function()
    1.24 @@ -42,7 +45,10 @@
    1.25      ui.container{ content = function()
    1.26        ui.tag{
    1.27          tag = "input", 
    1.28 -        attr = { type = "radio", name = "notification_level", value = "frozen" }
    1.29 +        attr = {
    1.30 +          type = "radio", name = "notify_level", value = "verification",
    1.31 +          checked = app.session.member.notify_level == 'verification' and "checked" or nil
    1.32 +        }
    1.33        }
    1.34        ui.tag{ content = _"Frozen and voting phase" }
    1.35        ui.tag{ tag = "ul", content = function()
    1.36 @@ -55,7 +61,10 @@
    1.37      ui.container{ content = function()
    1.38        ui.tag{
    1.39          tag = "input", 
    1.40 -        attr = { type = "radio", name = "notification_level", value = "discussion" }
    1.41 +        attr = {
    1.42 +          type = "radio", name = "notify_level", value = "discussion",
    1.43 +          checked = app.session.member.notify_level == 'discussion' and "checked" or nil
    1.44 +        }
    1.45        }
    1.46        ui.tag{ content = _"Discussion, frozen and voting phase" }
    1.47        ui.tag{ tag = "ul", content = function()
    1.48 @@ -72,7 +81,10 @@
    1.49      ui.container{ content = function()
    1.50        ui.tag{
    1.51          tag = "input", 
    1.52 -        attr = { type = "radio", name = "notification_level", value = "any" }
    1.53 +        attr = {
    1.54 +          type = "radio", name = "notify_level", value = "all",
    1.55 +          checked = app.session.member.notify_level == 'all' and "checked" or nil
    1.56 +        }
    1.57        }
    1.58        ui.tag{ content = _"Any phase" }
    1.59        ui.tag{ tag = "ul", content = function()
    1.60 @@ -90,14 +102,17 @@
    1.61      ui.container{ content = function()
    1.62        ui.tag{
    1.63          tag = "input", 
    1.64 -        attr = { type = "radio", name = "notification_level", value = "none" }
    1.65 +        attr = {
    1.66 +          type = "radio", name = "notify_level", value = "none",
    1.67 +          checked = app.session.member.notify_level == 'none' and "checked" or nil
    1.68 +        }
    1.69        }
    1.70        ui.tag{ content = _"No notifications at all" }
    1.71      end }
    1.72  
    1.73  
    1.74      
    1.75 -    ui.submit{ value = _"Change display settings" }
    1.76 +    ui.submit{ value = _"Change notification settings" }
    1.77    end
    1.78  }
    1.79   

Impressum / About Us