liquid_feedback_frontend
view app/main/timeline/_action/save.lua @ 145:90520c9fca44
implement area filter in timeline
allows the user to ignore any area in the timeline filter.
better display in javascript off
allows the user to ignore any area in the timeline filter.
better display in javascript off
| author | Daniel Poelzleithner <poelzi@poelzi.org> |
|---|---|
| date | Thu Oct 07 00:35:48 2010 +0200 (2010-10-07) |
| parents | 7c3e8a1678fc |
| children |
line source
1 local id = param.get("id", atom.number)
3 local setting_key = "liquidfeedback_frontend_timeline_current_options"
4 local setting = Setting:by_pk(app.session.member.id, setting_key)
5 local options_string = setting.value
7 local timeline_filter
9 local subkey = param.get("name")
11 if not subkey or subkey == "" then
12 slot.put_into("error", _"This name is really too short!")
13 request.redirect{
14 module = "timeline",
15 view = "save_filter",
16 }
17 return
18 end
20 app.session.member:set_setting_map("timeline_filters", subkey, options_string)
22 local timeline_params = {}
23 if options_string then
24 for event_ident, filter_idents in setting.value:gmatch("(%S+):(%S+)") do
25 timeline_params["option_" .. event_ident] = true
26 if filter_idents ~= "*" then
27 for filter_ident in filter_idents:gmatch("([^\|]+)") do
28 timeline_params["option_" .. event_ident .. "_" .. filter_ident] = true
29 end
30 end
31 end
32 end
34 local setting_key = "liquidfeedback_frontend_timeline_current_date"
35 local setting = Setting:by_pk(app.session.member.id, setting_key)
37 if setting then
38 timeline_params.date = setting.value
39 end
41 request.redirect{
42 module = "timeline",
43 view = "index",
44 params = timeline_params
45 }
