# HG changeset patch # User bsw # Date 1330512699 -3600 # Node ID 9e6a23f11f32f07a69758dd0541f58a9bf7c1d59 # Parent 790ff702402fac3ca9cb8d16b1f01c12a3f5f514 Make notification settings work, unified redirect targets in settings diff -r 790ff702402f -r 9e6a23f11f32 app/main/member/_action/update_notify_level.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/member/_action/update_notify_level.lua Wed Feb 29 11:51:39 2012 +0100 @@ -0,0 +1,2 @@ +app.session.member.notify_level = param.get("notify_level") +app.session.member:save() diff -r 790ff702402f -r 9e6a23f11f32 app/main/member/edit.lua --- a/app/main/member/edit.lua Tue Feb 28 22:50:48 2012 +0100 +++ b/app/main/member/edit.lua Wed Feb 29 11:51:39 2012 +0100 @@ -6,8 +6,8 @@ ui.image{ static = "icons/16/cancel.png" } slot.put(_"Cancel") end, - module = "index", - view = "index" + module = "member", + view = "settings" } end) diff -r 790ff702402f -r 9e6a23f11f32 app/main/member/edit_images.lua --- a/app/main/member/edit_images.lua Tue Feb 28 22:50:48 2012 +0100 +++ b/app/main/member/edit_images.lua Wed Feb 29 11:51:39 2012 +0100 @@ -6,8 +6,8 @@ ui.image{ static = "icons/16/cancel.png" } slot.put(_"Cancel") end, - module = "index", - view = "index" + module = "member", + view = "settings" } end) diff -r 790ff702402f -r 9e6a23f11f32 app/main/member/settings_notification.lua --- a/app/main/member/settings_notification.lua Tue Feb 28 22:50:48 2012 +0100 +++ b/app/main/member/settings_notification.lua Wed Feb 29 11:51:39 2012 +0100 @@ -17,7 +17,7 @@ ui.form{ attr = { class = "vertical" }, module = "member", - action = "update_notification", + action = "update_notify_level", routing = { ok = { mode = "redirect", @@ -31,7 +31,10 @@ ui.container{ content = function() ui.tag{ tag = "input", - attr = { type = "radio", name = "notification_level", value = "voting" } + attr = { + type = "radio", name = "notify_level", value = "voting", + checked = app.session.member.notify_level == 'voting' and "checked" or nil + } } ui.tag{ content = _"Voting phase" } ui.tag{ tag = "ul", content = function() @@ -42,7 +45,10 @@ ui.container{ content = function() ui.tag{ tag = "input", - attr = { type = "radio", name = "notification_level", value = "frozen" } + attr = { + type = "radio", name = "notify_level", value = "verification", + checked = app.session.member.notify_level == 'verification' and "checked" or nil + } } ui.tag{ content = _"Frozen and voting phase" } ui.tag{ tag = "ul", content = function() @@ -55,7 +61,10 @@ ui.container{ content = function() ui.tag{ tag = "input", - attr = { type = "radio", name = "notification_level", value = "discussion" } + attr = { + type = "radio", name = "notify_level", value = "discussion", + checked = app.session.member.notify_level == 'discussion' and "checked" or nil + } } ui.tag{ content = _"Discussion, frozen and voting phase" } ui.tag{ tag = "ul", content = function() @@ -72,7 +81,10 @@ ui.container{ content = function() ui.tag{ tag = "input", - attr = { type = "radio", name = "notification_level", value = "any" } + attr = { + type = "radio", name = "notify_level", value = "all", + checked = app.session.member.notify_level == 'all' and "checked" or nil + } } ui.tag{ content = _"Any phase" } ui.tag{ tag = "ul", content = function() @@ -90,14 +102,17 @@ ui.container{ content = function() ui.tag{ tag = "input", - attr = { type = "radio", name = "notification_level", value = "none" } + attr = { + type = "radio", name = "notify_level", value = "none", + checked = app.session.member.notify_level == 'none' and "checked" or nil + } } ui.tag{ content = _"No notifications at all" } end } - ui.submit{ value = _"Change display settings" } + ui.submit{ value = _"Change notification settings" } end }