liquid_feedback_frontend

view app/main/area/_list.lua @ 10:72c5e0ee7c98

Version beta6

Bugfixes:
- Security fix: Every user was able to change the discussion URL of an initiative
- Creation of new issues in areas without default policies is now possible
- Members can now be sorted in different ways
- No error when trying to compare a draft with itself
- Added missing local statement to variable initialization in app/main/delegation/new.lua
- CSS flaw in initiative action bar fixed

New features:
- Possiblity to invite other users to become initiator
- Revokation of initiatives implemented
- Number of suggestions, supporters, etc. is shown on corresponding tabs of initiative view
- Members can now be sorted by account creation (default sorting is "newest first")
- Configuration option to create an automatic discussion link for all issues
- First draft of global timeline feature (not accessible via link yet)
- Custom stylesheet URL for users marked as developers

In area listing the number of closed issues is shown too

Renamed "author" field of initiative to "last author"

Removed wrongly included file app/main/member/_show_thumb.lua.orig in the distribution

Help texts updated
author bsw
date Sun Jan 10 12:00:00 2010 +0100 (2010-01-10)
parents 0ee1e0c42d4c
children 00d1004545f1
line source
1 local areas_selector = param.get("areas_selector", "table")
3 areas_selector
4 :reset_fields()
5 :add_field("area.id", nil, { "grouped" })
6 :add_field("area.name", nil, { "grouped" })
7 :add_field("member_weight", nil, { "grouped" })
8 :add_field("direct_member_count", nil, { "grouped" })
9 :add_field("(SELECT COUNT(*) FROM issue WHERE issue.area_id = area.id AND issue.accepted ISNULL AND issue.closed ISNULL)", "issues_new_count")
10 :add_field("(SELECT COUNT(*) FROM issue WHERE issue.area_id = area.id AND issue.accepted NOTNULL AND issue.half_frozen ISNULL AND issue.closed ISNULL)", "issues_discussion_count")
11 :add_field("(SELECT COUNT(*) FROM issue WHERE issue.area_id = area.id AND issue.half_frozen NOTNULL AND issue.fully_frozen ISNULL AND issue.closed ISNULL)", "issues_frozen_count")
12 :add_field("(SELECT COUNT(*) FROM issue WHERE issue.area_id = area.id AND issue.fully_frozen NOTNULL AND issue.closed ISNULL)", "issues_voting_count")
13 :add_field({ "(SELECT COUNT(*) FROM issue LEFT JOIN direct_voter ON direct_voter.issue_id = issue.id AND direct_voter.member_id = ? WHERE issue.area_id = area.id AND issue.fully_frozen NOTNULL AND issue.closed ISNULL AND direct_voter.member_id ISNULL)", app.session.member.id }, "issues_to_vote_count")
14 :add_field("(SELECT COUNT(*) FROM issue WHERE issue.area_id = area.id AND issue.fully_frozen NOTNULL AND issue.closed NOTNULL)", "issues_finished_count")
15 :add_field("(SELECT COUNT(*) FROM issue WHERE issue.area_id = area.id AND issue.fully_frozen ISNULL AND issue.closed NOTNULL)", "issues_cancelled_count")
17 ui.order{
18 name = name,
19 selector = areas_selector,
20 options = {
21 {
22 name = "member_weight",
23 label = _"Population",
24 order_by = "area.member_weight DESC"
25 },
26 {
27 name = "direct_member_count",
28 label = _"Direct member count",
29 order_by = "area.direct_member_count DESC"
30 },
31 {
32 name = "az",
33 label = _"A-Z",
34 order_by = "area.name"
35 },
36 {
37 name = "za",
38 label = _"Z-A",
39 order_by = "area.name DESC"
40 }
41 },
42 content = function()
43 ui.list{
44 records = areas_selector:exec(),
45 columns = {
46 {
47 content = function(record)
48 if record.member_weight and record.direct_member_count then
49 local max_value = MemberCount:get()
50 ui.bargraph{
51 max_value = max_value,
52 width = 100,
53 bars = {
54 { color = "#444", value = record.direct_member_count },
55 { color = "#777", value = record.member_weight - record.direct_member_count },
56 { color = "#ddd", value = max_value - record.member_weight },
57 }
58 }
59 end
60 end
61 },
62 {
63 content = function(record)
64 ui.link{
65 text = record.name,
66 module = "area",
67 view = "show",
68 id = record.id
69 }
70 end
71 },
72 {
73 label = _"New",
74 field_attr = { style = "text-align: right;" },
75 content = function(record)
76 ui.link{
77 text = tostring(record.issues_new_count),
78 module = "area",
79 view = "show",
80 id = record.id,
81 params = { filter = "new" }
82 }
83 end
84 },
85 {
86 label = _"Discussion",
87 field_attr = { style = "text-align: right;" },
88 content = function(record)
89 ui.link{
90 text = tostring(record.issues_discussion_count),
91 module = "area",
92 view = "show",
93 id = record.id,
94 params = { filter = "accepted" }
95 }
96 end
97 },
98 {
99 label = _"Frozen",
100 field_attr = { style = "text-align: right;" },
101 content = function(record)
102 ui.link{
103 text = tostring(record.issues_frozen_count),
104 module = "area",
105 view = "show",
106 id = record.id,
107 params = { filter = "half_frozen" }
108 }
109 end
110 },
111 {
112 label = _"Voting",
113 field_attr = { style = "text-align: right;" },
114 content = function(record)
115 ui.link{
116 text = tostring(record.issues_voting_count),
117 module = "area",
118 view = "show",
119 id = record.id,
120 params = { filter = "frozen" }
121 }
122 end
123 },
124 {
125 label = _"Not yet voted",
126 field_attr = { style = "text-align: right;" },
127 content = function(record)
128 ui.link{
129 attr = { class = record.issues_to_vote_count > 0 and "not_voted" or nil },
130 text = tostring(record.issues_to_vote_count),
131 module = "area",
132 view = "show",
133 id = record.id,
134 params = { filter = "frozen", filter_voting = "not_voted" }
135 }
136 end
137 },
138 {
139 label = _"Finished",
140 field_attr = { style = "text-align: right;" },
141 content = function(record)
142 ui.link{
143 text = tostring(record.issues_finished_count),
144 module = "area",
145 view = "show",
146 id = record.id,
147 params = { filter = "finished", issue_list = "newest" }
148 }
149 end
150 },
151 {
152 label = _"Cancelled",
153 field_attr = { style = "text-align: right;" },
154 content = function(record)
155 ui.link{
156 text = tostring(record.issues_cancelled_count),
157 module = "area",
158 view = "show",
159 id = record.id,
160 params = { filter = "cancelled", issue_list = "newest" }
161 }
162 end
163 },
164 }
165 }
166 end
167 }
169 ui.bargraph_legend{
170 width = 25,
171 bars = {
172 { color = "#444", label = _"Direct membership" },
173 { color = "#777", label = _"Membership by delegation" },
174 { color = "#ddd", label = _"No membership at all" },
175 }
176 }

Impressum / About Us