# HG changeset patch # User bsw # Date 1460965339 -7200 # Node ID 0bd5142b9c5e5458eb2d4ffb1004de1db04679ac # Parent 5b97578192bc5e6a9f29b02137fc6b6b5d82b0f2 Fix syntax errors, added default hiding to notification settings diff -r 5b97578192bc -r 0bd5142b9c5e app/main/member/settings_notification.lua --- a/app/main/member/settings_notification.lua Mon Apr 18 09:38:27 2016 +0200 +++ b/app/main/member/settings_notification.lua Mon Apr 18 09:42:19 2016 +0200 @@ -29,7 +29,6 @@ ui.heading { level = 1, content = _"Do you like to receive updates by email?" } end ) - ui.sectionRow( function() ui.container{ content = function() @@ -38,7 +37,7 @@ attr = { id = "notify_level_all", type = "radio", name = "disable_notifications", value = "false", - checked = not app.session.member.disable_notifications and "checked" or nil + checked = not app.session.member.disable_notifications and "checked" or nil, onchange = [[ $(".view_on_notify_level_all_false")[this.checked ? "show" : "hide"](400) ]] } } @@ -60,7 +59,7 @@ attr = { id = "digest_on", type = "radio", name = "digest", value = "true", - checked = app.session.member.notification_hour ~= nil and "checked" or nil + checked = app.session.member.notification_hour ~= nil and "checked" or nil, onchange = [[ $(".view_on_digest_true")[this.checked ? "show" : "hide"](400) ]] } } @@ -120,7 +119,7 @@ attr = { id = "digest_off", type = "radio", name = "digest", value = "false", - checked = app.session.member.notification_dow == nil and app.session.member.notification_hour == nil and "checked" or nil + checked = app.session.member.notification_dow == nil and app.session.member.notification_hour == nil and "checked" or nil, onchange = [[ $(".view_on_digest_true")[this.checked ? "hide" : "show"](400) ]] } } @@ -149,6 +148,14 @@ } end } + if app.session.member.disable_notifications then + ui.script{ script = [[ $(".view_on_notify_level_all_false").hide() ]] } + end + + if app.session.member.notification_hour == nil then + ui.script{ script = [[ $(".view_on_digest_true").hide() ]] } + end + slot.put("
") ui.tag{