liquid_feedback_frontend
diff app/main/timeline/_action/update.lua @ 11:77d58efe99fd
Version beta7
Important security fixes:
- Added missing HTML encoding to postal address of member
- Link to discussion URL only if it starts with http(s)://
Other bugfixes:
- Fixed wrong display of 2nd level delegating voters for an initiative
- Do not display invited initiators as initiators while voting
- Added missing translation
New features:
- Public message of the day
- Both direct and indirect supporter count is shown in tab heads
- Support shown in initiative lists
Language chooser at the login page has been added (again)
Important security fixes:
- Added missing HTML encoding to postal address of member
- Link to discussion URL only if it starts with http(s)://
Other bugfixes:
- Fixed wrong display of 2nd level delegating voters for an initiative
- Do not display invited initiators as initiators while voting
- Added missing translation
New features:
- Public message of the day
- Both direct and indirect supporter count is shown in tab heads
- Support shown in initiative lists
Language chooser at the login page has been added (again)
author | bsw |
---|---|
date | Fri Jan 22 12:00:00 2010 +0100 (2010-01-22) |
parents | |
children | 00d1004545f1 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/app/main/timeline/_action/update.lua Fri Jan 22 12:00:00 2010 +0100 1.3 @@ -0,0 +1,101 @@ 1.4 +execute.view{ 1.5 + module = "timeline", 1.6 + view = "_constants" 1.7 +} 1.8 + 1.9 +local options_string = param.get("options_string") 1.10 + 1.11 +if not options_string then 1.12 + local active_options = "" 1.13 + for event_ident, event_name in pairs(event_names) do 1.14 + if param.get("option_" .. event_ident, atom.boolean) then 1.15 + active_options = active_options .. event_ident .. ":" 1.16 + local filter_idents = {} 1.17 + for filter_ident, filter_name in pairs(filter_names) do 1.18 + if param.get("option_" .. event_ident .. "_" .. filter_ident, atom.boolean) then 1.19 + filter_idents[#filter_idents+1] = filter_ident 1.20 + end 1.21 + end 1.22 + if #filter_idents > 0 then 1.23 + active_options = active_options .. table.concat(filter_idents, "|") .. " " 1.24 + else 1.25 + active_options = active_options .. "* " 1.26 + end 1.27 + end 1.28 + end 1.29 + if #active_options > 0 then 1.30 + options_string = active_options 1.31 + end 1.32 +end 1.33 + 1.34 +if not options_string then 1.35 + options_string = "issue_created:* issue_finished_after_voting:* issue_accepted:* issue_voting_started:* suggestion_created:* issue_canceled:* initiative_created:* issue_finished_without_voting:* draft_created:* initiative_revoked:* issue_half_frozen:* " 1.36 +end 1.37 + 1.38 +local setting_key = "liquidfeedback_frontend_timeline_current_options" 1.39 +local setting = Setting:by_pk(app.session.member.id, setting_key) 1.40 + 1.41 +if not setting or setting.value ~= options_string then 1.42 + if not setting then 1.43 + setting = Setting:new() 1.44 + setting.member_id = app.session.member_id 1.45 + setting.key = setting_key 1.46 + end 1.47 + if options_string then 1.48 + setting.value = options_string 1.49 + setting:save() 1.50 + end 1.51 +end 1.52 + 1.53 +local date = param.get("date") 1.54 + 1.55 +if date and #date > 0 then 1.56 + local setting_key = "liquidfeedback_frontend_timeline_current_date" 1.57 + local setting = Setting:by_pk(app.session.member.id, setting_key) 1.58 + if not setting or setting.value ~= date then 1.59 + if not setting then 1.60 + setting = Setting:new() 1.61 + setting.member_id = app.session.member.id 1.62 + setting.key = setting_key 1.63 + end 1.64 + setting.value = date 1.65 + setting:save() 1.66 + end 1.67 +end 1.68 + 1.69 +local setting_key = "liquidfeedback_frontend_timeline_current_options" 1.70 +local setting = Setting:by_pk(app.session.member.id, setting_key) 1.71 + 1.72 +local timeline_params = {} 1.73 +if setting and setting.value then 1.74 + for event_ident, filter_idents in setting.value:gmatch("(%S+):(%S+)") do 1.75 + timeline_params["option_" .. event_ident] = true 1.76 + if filter_idents ~= "*" then 1.77 + for filter_ident in filter_idents:gmatch("([^\|]+)") do 1.78 + timeline_params["option_" .. event_ident .. "_" .. filter_ident] = true 1.79 + end 1.80 + end 1.81 + end 1.82 +end 1.83 + 1.84 +local setting_key = "liquidfeedback_frontend_timeline_current_date" 1.85 +local setting = Setting:by_pk(app.session.member.id, setting_key) 1.86 + 1.87 +if setting then 1.88 + timeline_params.date = setting.value 1.89 +end 1.90 + 1.91 +timeline_params.show_options = param.get("show_options", atom.boolean) 1.92 + 1.93 +if param.get("save", atom.boolean) then 1.94 + request.redirect{ 1.95 + module = "timeline", 1.96 + view = "save_filter" 1.97 + } 1.98 +else 1.99 + request.redirect{ 1.100 + module = "timeline", 1.101 + view = "index", 1.102 + params = timeline_params 1.103 + } 1.104 +end 1.105 \ No newline at end of file