liquid_feedback_frontend
diff app/main/area/_action/update_ignore.lua @ 1254:55132e0324a4
Added missing files for new notification system
author | bsw |
---|---|
date | Sun Apr 17 16:14:21 2016 +0200 (2016-04-17) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/app/main/area/_action/update_ignore.lua Sun Apr 17 16:14:21 2016 +0200 1.3 @@ -0,0 +1,21 @@ 1.4 +local area_id = assert(param.get("area_id", atom.integer), "no area id given") 1.5 + 1.6 + 1.7 +local ignored_area = IgnoredArea:by_pk(app.session.member_id, area_id) 1.8 + 1.9 +if param.get("delete", atom.boolean) then 1.10 + if ignored_area then 1.11 + ignored_area:destroy() 1.12 + slot.select("notice", function() ui.tag{ content = _"You have been subscribed for update emails about this subject area" } end) 1.13 + end 1.14 + return 1.15 +end 1.16 + 1.17 +if not ignored_area then 1.18 + local ignored_area = IgnoredArea:new() 1.19 + ignored_area.member_id = app.session.member_id 1.20 + ignored_area.area_id = area_id 1.21 + ignored_area:save() 1.22 + slot.select("notice", function() ui.tag{ content = _"You will no longer receive update emails about this subject area" } end ) 1.23 + 1.24 +end