liquid_feedback_frontend
changeset 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 | 790ff702402f |
children | bd6a8bb9f35c |
files | app/main/member/_action/update_notify_level.lua app/main/member/edit.lua app/main/member/edit_images.lua app/main/member/settings_notification.lua |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/app/main/member/_action/update_notify_level.lua Wed Feb 29 11:51:39 2012 +0100 1.3 @@ -0,0 +1,2 @@ 1.4 +app.session.member.notify_level = param.get("notify_level") 1.5 +app.session.member:save()
2.1 --- a/app/main/member/edit.lua Tue Feb 28 22:50:48 2012 +0100 2.2 +++ b/app/main/member/edit.lua Wed Feb 29 11:51:39 2012 +0100 2.3 @@ -6,8 +6,8 @@ 2.4 ui.image{ static = "icons/16/cancel.png" } 2.5 slot.put(_"Cancel") 2.6 end, 2.7 - module = "index", 2.8 - view = "index" 2.9 + module = "member", 2.10 + view = "settings" 2.11 } 2.12 end) 2.13
3.1 --- a/app/main/member/edit_images.lua Tue Feb 28 22:50:48 2012 +0100 3.2 +++ b/app/main/member/edit_images.lua Wed Feb 29 11:51:39 2012 +0100 3.3 @@ -6,8 +6,8 @@ 3.4 ui.image{ static = "icons/16/cancel.png" } 3.5 slot.put(_"Cancel") 3.6 end, 3.7 - module = "index", 3.8 - view = "index" 3.9 + module = "member", 3.10 + view = "settings" 3.11 } 3.12 end) 3.13
4.1 --- a/app/main/member/settings_notification.lua Tue Feb 28 22:50:48 2012 +0100 4.2 +++ b/app/main/member/settings_notification.lua Wed Feb 29 11:51:39 2012 +0100 4.3 @@ -17,7 +17,7 @@ 4.4 ui.form{ 4.5 attr = { class = "vertical" }, 4.6 module = "member", 4.7 - action = "update_notification", 4.8 + action = "update_notify_level", 4.9 routing = { 4.10 ok = { 4.11 mode = "redirect", 4.12 @@ -31,7 +31,10 @@ 4.13 ui.container{ content = function() 4.14 ui.tag{ 4.15 tag = "input", 4.16 - attr = { type = "radio", name = "notification_level", value = "voting" } 4.17 + attr = { 4.18 + type = "radio", name = "notify_level", value = "voting", 4.19 + checked = app.session.member.notify_level == 'voting' and "checked" or nil 4.20 + } 4.21 } 4.22 ui.tag{ content = _"Voting phase" } 4.23 ui.tag{ tag = "ul", content = function() 4.24 @@ -42,7 +45,10 @@ 4.25 ui.container{ content = function() 4.26 ui.tag{ 4.27 tag = "input", 4.28 - attr = { type = "radio", name = "notification_level", value = "frozen" } 4.29 + attr = { 4.30 + type = "radio", name = "notify_level", value = "verification", 4.31 + checked = app.session.member.notify_level == 'verification' and "checked" or nil 4.32 + } 4.33 } 4.34 ui.tag{ content = _"Frozen and voting phase" } 4.35 ui.tag{ tag = "ul", content = function() 4.36 @@ -55,7 +61,10 @@ 4.37 ui.container{ content = function() 4.38 ui.tag{ 4.39 tag = "input", 4.40 - attr = { type = "radio", name = "notification_level", value = "discussion" } 4.41 + attr = { 4.42 + type = "radio", name = "notify_level", value = "discussion", 4.43 + checked = app.session.member.notify_level == 'discussion' and "checked" or nil 4.44 + } 4.45 } 4.46 ui.tag{ content = _"Discussion, frozen and voting phase" } 4.47 ui.tag{ tag = "ul", content = function() 4.48 @@ -72,7 +81,10 @@ 4.49 ui.container{ content = function() 4.50 ui.tag{ 4.51 tag = "input", 4.52 - attr = { type = "radio", name = "notification_level", value = "any" } 4.53 + attr = { 4.54 + type = "radio", name = "notify_level", value = "all", 4.55 + checked = app.session.member.notify_level == 'all' and "checked" or nil 4.56 + } 4.57 } 4.58 ui.tag{ content = _"Any phase" } 4.59 ui.tag{ tag = "ul", content = function() 4.60 @@ -90,14 +102,17 @@ 4.61 ui.container{ content = function() 4.62 ui.tag{ 4.63 tag = "input", 4.64 - attr = { type = "radio", name = "notification_level", value = "none" } 4.65 + attr = { 4.66 + type = "radio", name = "notify_level", value = "none", 4.67 + checked = app.session.member.notify_level == 'none' and "checked" or nil 4.68 + } 4.69 } 4.70 ui.tag{ content = _"No notifications at all" } 4.71 end } 4.72 4.73 4.74 4.75 - ui.submit{ value = _"Change display settings" } 4.76 + ui.submit{ value = _"Change notification settings" } 4.77 end 4.78 } 4.79