liquid_feedback_frontend
view app/main/area/_list.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
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 | 3bfb2fcf7ab9 |
children | 80c215dbf076 |
line source
1 local areas_selector = param.get("areas_selector", "table")
3 ui.order{
4 name = name,
5 selector = areas_selector,
6 options = {
7 {
8 name = "member_weight",
9 label = _"Population",
10 order_by = "area.member_weight DESC"
11 },
12 {
13 name = "direct_member_count",
14 label = _"Direct member count",
15 order_by = "area.direct_member_count DESC"
16 },
17 {
18 name = "az",
19 label = _"A-Z",
20 order_by = "area.name"
21 },
22 {
23 name = "za",
24 label = _"Z-A",
25 order_by = "area.name DESC"
26 }
27 },
28 content = function()
29 ui.list{
30 records = areas_selector:exec(),
31 columns = {
32 {
33 content = function(record)
34 if record.member_weight and record.direct_member_count then
35 local max_value = MemberCount:get()
36 ui.bargraph{
37 max_value = max_value,
38 width = 200,
39 bars = {
40 { color = "#444", value = record.direct_member_count },
41 { color = "#777", value = record.member_weight - record.direct_member_count },
42 { color = "#ddd", value = max_value - record.member_weight },
43 }
44 }
45 end
46 end
47 },
48 {
49 content = function(record)
50 ui.link{
51 text = record.name,
52 module = "area",
53 view = "show",
54 id = record.id
55 }
56 end
57 }
58 }
59 }
60 end
61 }