liquid_feedback_frontend
changeset 1282:0bd5142b9c5e
Fix syntax errors, added default hiding to notification settings
author | bsw |
---|---|
date | Mon Apr 18 09:42:19 2016 +0200 (2016-04-18) |
parents | 5b97578192bc |
children | 37359fcc2bd9 |
files | app/main/member/settings_notification.lua |
line diff
1.1 --- a/app/main/member/settings_notification.lua Mon Apr 18 09:38:27 2016 +0200 1.2 +++ b/app/main/member/settings_notification.lua Mon Apr 18 09:42:19 2016 +0200 1.3 @@ -29,7 +29,6 @@ 1.4 ui.heading { level = 1, content = _"Do you like to receive updates by email?" } 1.5 end ) 1.6 1.7 - 1.8 ui.sectionRow( function() 1.9 1.10 ui.container{ content = function() 1.11 @@ -38,7 +37,7 @@ 1.12 attr = { 1.13 id = "notify_level_all", 1.14 type = "radio", name = "disable_notifications", value = "false", 1.15 - checked = not app.session.member.disable_notifications and "checked" or nil 1.16 + checked = not app.session.member.disable_notifications and "checked" or nil, 1.17 onchange = [[ $(".view_on_notify_level_all_false")[this.checked ? "show" : "hide"](400) ]] 1.18 } 1.19 } 1.20 @@ -60,7 +59,7 @@ 1.21 attr = { 1.22 id = "digest_on", 1.23 type = "radio", name = "digest", value = "true", 1.24 - checked = app.session.member.notification_hour ~= nil and "checked" or nil 1.25 + checked = app.session.member.notification_hour ~= nil and "checked" or nil, 1.26 onchange = [[ $(".view_on_digest_true")[this.checked ? "show" : "hide"](400) ]] 1.27 } 1.28 } 1.29 @@ -120,7 +119,7 @@ 1.30 attr = { 1.31 id = "digest_off", 1.32 type = "radio", name = "digest", value = "false", 1.33 - checked = app.session.member.notification_dow == nil and app.session.member.notification_hour == nil and "checked" or nil 1.34 + checked = app.session.member.notification_dow == nil and app.session.member.notification_hour == nil and "checked" or nil, 1.35 onchange = [[ $(".view_on_digest_true")[this.checked ? "hide" : "show"](400) ]] 1.36 } 1.37 } 1.38 @@ -149,6 +148,14 @@ 1.39 } 1.40 end } 1.41 1.42 + if app.session.member.disable_notifications then 1.43 + ui.script{ script = [[ $(".view_on_notify_level_all_false").hide() ]] } 1.44 + end 1.45 + 1.46 + if app.session.member.notification_hour == nil then 1.47 + ui.script{ script = [[ $(".view_on_digest_true").hide() ]] } 1.48 + end 1.49 + 1.50 slot.put("<br />") 1.51 1.52 ui.tag{