liquid_feedback_frontend

view env/ui/filter.lua @ 2:5c601807d397

Version alpha3

Dark green part of issue supporter bargraph represents all satisfied supporters, regardless of having seen the latest draft

Wiki formatting for drafts

Showing differences between two drafts of the same initiative

Display of outgoing delegation chains

Many other improvements
author bsw
date Mon Nov 23 12:00:00 2009 +0100 (2009-11-23)
parents
children
line source
1 function ui.filter(args)
2 local name = args.name or "filter"
3 local current_filter = atom.string:load(cgi.params[name]) or args.filters[1].name
4 local id = param.get_id_cgi()
5 local params = param.get_all_cgi()
6 ui.container{
7 attr = { class = "ui_filter" },
8 content = function()
9 ui.container{
10 attr = { class = "ui_filter_head" },
11 content = function()
12 slot.put(_"Filter")
13 slot.put(": ")
14 for i, filter in ipairs(args.filters) do
15 params[name] = filter.name
16 local attr = {}
17 if current_filter == filter.name then
18 attr.class = "active"
19 filter.selector_modifier(args.selector, true)
20 end
21 ui.link{
22 attr = attr,
23 module = request.get_module(),
24 view = request.get_view(),
25 id = id,
26 params = params,
27 content = filter.label
28 }
29 end
30 end
31 }
32 ui.container{
33 attr = { class = "ui_filter_content" },
34 content = function()
35 args.content()
36 end
37 }
38 end
39 }
40 end

Impressum / About Us