liquid_feedback_frontend
changeset 269:55c2806c7113
Removed unnecessary filter option in area list
author | bsw |
---|---|
date | Tue Feb 07 19:59:24 2012 +0100 (2012-02-07) |
parents | 1f7b38584c0d |
children | 08a5e1226da2 |
files | app/main/area/_list.lua |
line diff
1.1 --- a/app/main/area/_list.lua Tue Feb 07 19:26:24 2012 +0100 1.2 +++ b/app/main/area/_list.lua Tue Feb 07 19:59:24 2012 +0100 1.3 @@ -26,226 +26,197 @@ 1.4 local label_attr = { style = "text-align: right; width: 4em;" } 1.5 local field_attr = { style = "text-align: right; width: 4em;" } 1.6 1.7 -ui.filters{ 1.8 - label = _"Change order", 1.9 - selector = areas_selector, 1.10 - { 1.11 - label = _"Order by", 1.12 +ui.list{ 1.13 + attr = { class = "area_list" }, 1.14 + records = areas_selector:exec(), 1.15 + columns = { 1.16 + { 1.17 + content = function(record) 1.18 + if record.is_member then 1.19 + local text = _"Member of area" 1.20 + ui.image{ 1.21 + attr = { title = text, alt = text, style = "vertical-align: middle;" }, 1.22 + static = "icons/16/user_gray.png", 1.23 + } 1.24 + end 1.25 + end 1.26 + }, 1.27 { 1.28 - name = "member_weight", 1.29 - label = _"Population", 1.30 - selector_modifier = function(selector) selector:add_order_by("area.member_weight DESC") end 1.31 + content = function(record) 1.32 + if record.area_delegation_name then 1.33 + local text = _("Area delegated to '#{name}'", { name = record.area_delegation_name }) 1.34 + ui.image{ 1.35 + attr = { title = text, alt = text, style = "vertical-align: middle;" }, 1.36 + static = "icons/16/link.png", 1.37 + } 1.38 + end 1.39 + end 1.40 + }, 1.41 + { 1.42 + content = function(record) 1.43 + if record.member_weight and record.direct_member_count then 1.44 + local max_value = MemberCount:get() 1.45 + ui.bargraph{ 1.46 + max_value = max_value, 1.47 + width = 100, 1.48 + bars = { 1.49 + { color = "#444", value = record.direct_member_count }, 1.50 + { color = "#777", value = record.member_weight - record.direct_member_count }, 1.51 + { color = "#ddd", value = max_value - record.member_weight }, 1.52 + } 1.53 + } 1.54 + end 1.55 + end 1.56 }, 1.57 { 1.58 - name = "direct_member_count", 1.59 - label = _"Direct member count", 1.60 - selector_modifier = function(selector) selector:add_order_by("area.direct_member_count DESC") end 1.61 + content = function(record) 1.62 + ui.link{ 1.63 + text = record.name, 1.64 + module = "area", 1.65 + view = "show", 1.66 + id = record.id 1.67 + } 1.68 + end 1.69 }, 1.70 { 1.71 - name = "az", 1.72 - label = _"A-Z", 1.73 - selector_modifier = function(selector) selector:add_order_by("area.name") end 1.74 + label = function() 1.75 + local title = _"New" 1.76 + ui.image{ 1.77 + attr = { title = title, alt = title }, 1.78 + static = "icons/16/new.png" 1.79 + } 1.80 + end, 1.81 + field_attr = field_attr, 1.82 + label_attr = label_attr, 1.83 + content = function(record) 1.84 + ui.link{ 1.85 + text = tostring(record.issues_new_count), 1.86 + module = "area", 1.87 + view = "show", 1.88 + id = record.id, 1.89 + params = { filter = "new", tab = "issues" } 1.90 + } 1.91 + end 1.92 + }, 1.93 + { 1.94 + label = function() 1.95 + local title = _"Discussion" 1.96 + ui.image{ 1.97 + attr = { title = title, alt = title }, 1.98 + static = "icons/16/comments.png" 1.99 + } 1.100 + end, 1.101 + field_attr = field_attr, 1.102 + label_attr = label_attr, 1.103 + content = function(record) 1.104 + ui.link{ 1.105 + text = tostring(record.issues_discussion_count), 1.106 + module = "area", 1.107 + view = "show", 1.108 + id = record.id, 1.109 + params = { filter = "accepted", tab = "issues" } 1.110 + } 1.111 + end 1.112 }, 1.113 { 1.114 - name = "za", 1.115 - label = _"Z-A", 1.116 - selector_modifier = function(selector) selector:add_order_by("area.name DESC") end 1.117 - } 1.118 - }, 1.119 - content = function() 1.120 - ui.list{ 1.121 - attr = { class = "area_list" }, 1.122 - records = areas_selector:exec(), 1.123 - columns = { 1.124 - { 1.125 - content = function(record) 1.126 - if record.is_member then 1.127 - local text = _"Member of area" 1.128 - ui.image{ 1.129 - attr = { title = text, alt = text, style = "vertical-align: middle;" }, 1.130 - static = "icons/16/user_gray.png", 1.131 - } 1.132 - end 1.133 - end 1.134 - }, 1.135 - { 1.136 - content = function(record) 1.137 - if record.area_delegation_name then 1.138 - local text = _("Area delegated to '#{name}'", { name = record.area_delegation_name }) 1.139 - ui.image{ 1.140 - attr = { title = text, alt = text, style = "vertical-align: middle;" }, 1.141 - static = "icons/16/link.png", 1.142 - } 1.143 - end 1.144 - end 1.145 - }, 1.146 - { 1.147 - content = function(record) 1.148 - if record.member_weight and record.direct_member_count then 1.149 - local max_value = MemberCount:get() 1.150 - ui.bargraph{ 1.151 - max_value = max_value, 1.152 - width = 100, 1.153 - bars = { 1.154 - { color = "#444", value = record.direct_member_count }, 1.155 - { color = "#777", value = record.member_weight - record.direct_member_count }, 1.156 - { color = "#ddd", value = max_value - record.member_weight }, 1.157 - } 1.158 - } 1.159 - end 1.160 - end 1.161 - }, 1.162 - { 1.163 - content = function(record) 1.164 - ui.link{ 1.165 - text = record.name, 1.166 - module = "area", 1.167 - view = "show", 1.168 - id = record.id 1.169 - } 1.170 - end 1.171 - }, 1.172 - { 1.173 - label = function() 1.174 - local title = _"New" 1.175 - ui.image{ 1.176 - attr = { title = title, alt = title }, 1.177 - static = "icons/16/new.png" 1.178 - } 1.179 - end, 1.180 - field_attr = field_attr, 1.181 - label_attr = label_attr, 1.182 - content = function(record) 1.183 - ui.link{ 1.184 - text = tostring(record.issues_new_count), 1.185 - module = "area", 1.186 - view = "show", 1.187 - id = record.id, 1.188 - params = { filter = "new", tab = "issues" } 1.189 - } 1.190 - end 1.191 - }, 1.192 - { 1.193 - label = function() 1.194 - local title = _"Discussion" 1.195 - ui.image{ 1.196 - attr = { title = title, alt = title }, 1.197 - static = "icons/16/comments.png" 1.198 - } 1.199 - end, 1.200 - field_attr = field_attr, 1.201 - label_attr = label_attr, 1.202 - content = function(record) 1.203 - ui.link{ 1.204 - text = tostring(record.issues_discussion_count), 1.205 - module = "area", 1.206 - view = "show", 1.207 - id = record.id, 1.208 - params = { filter = "accepted", tab = "issues" } 1.209 + label = function() 1.210 + local title = _"Frozen" 1.211 + ui.image{ 1.212 + attr = { title = title, alt = title }, 1.213 + static = "icons/16/lock.png" 1.214 + } 1.215 + end, 1.216 + field_attr = field_attr, 1.217 + label_attr = label_attr, 1.218 + content = function(record) 1.219 + ui.link{ 1.220 + text = tostring(record.issues_frozen_count), 1.221 + module = "area", 1.222 + view = "show", 1.223 + id = record.id, 1.224 + params = { filter = "half_frozen", tab = "issues" } 1.225 + } 1.226 + end 1.227 + }, 1.228 + { 1.229 + label = function() 1.230 + local title = _"Voting" 1.231 + ui.image{ 1.232 + attr = { title = title, alt = title }, 1.233 + static = "icons/16/email_open.png" 1.234 + } 1.235 + end, 1.236 + field_attr = field_attr, 1.237 + label_attr = label_attr, 1.238 + content = function(record) 1.239 + ui.link{ 1.240 + text = tostring(record.issues_voting_count), 1.241 + module = "area", 1.242 + view = "show", 1.243 + id = record.id, 1.244 + params = { filter = "frozen", tab = "issues" } 1.245 + } 1.246 + end 1.247 + }, 1.248 + { 1.249 + label = function() 1.250 + local title = _"Finished" 1.251 + ui.image{ 1.252 + attr = { title = title, alt = title }, 1.253 + static = "icons/16/tick.png" 1.254 + } 1.255 + end, 1.256 + field_attr = field_attr, 1.257 + label_attr = label_attr, 1.258 + content = function(record) 1.259 + ui.link{ 1.260 + text = tostring(record.issues_finished_count), 1.261 + module = "area", 1.262 + view = "show", 1.263 + id = record.id, 1.264 + params = { filter = "finished", issue_list = "newest", tab = "issues" } 1.265 + } 1.266 + end 1.267 + }, 1.268 + { 1.269 + label = function() 1.270 + local title = _"Cancelled" 1.271 + ui.image{ 1.272 + attr = { title = title, alt = title }, 1.273 + static = "icons/16/cross.png" 1.274 + } 1.275 + end, 1.276 + field_attr = field_attr, 1.277 + label_attr = label_attr, 1.278 + content = function(record) 1.279 + ui.link{ 1.280 + text = tostring(record.issues_cancelled_count), 1.281 + module = "area", 1.282 + view = "show", 1.283 + id = record.id, 1.284 + params = { filter = "cancelled", issue_list = "newest", tab = "issues" } 1.285 + } 1.286 + end 1.287 + }, 1.288 + { 1.289 + content = function(record) 1.290 + if record.issues_to_vote_count > 0 then 1.291 + ui.link{ 1.292 + attr = { class = "not_voted" }, 1.293 + text = _"Not yet voted" .. ": " .. tostring(record.issues_to_vote_count), 1.294 + module = "area", 1.295 + view = "show", 1.296 + id = record.id, 1.297 + params = { 1.298 + filter = "frozen", 1.299 + filter_voting = "not_voted", 1.300 + tab = "issues" 1.301 } 1.302 - end 1.303 - }, 1.304 - { 1.305 - label = function() 1.306 - local title = _"Frozen" 1.307 - ui.image{ 1.308 - attr = { title = title, alt = title }, 1.309 - static = "icons/16/lock.png" 1.310 - } 1.311 - end, 1.312 - field_attr = field_attr, 1.313 - label_attr = label_attr, 1.314 - content = function(record) 1.315 - ui.link{ 1.316 - text = tostring(record.issues_frozen_count), 1.317 - module = "area", 1.318 - view = "show", 1.319 - id = record.id, 1.320 - params = { filter = "half_frozen", tab = "issues" } 1.321 - } 1.322 - end 1.323 - }, 1.324 - { 1.325 - label = function() 1.326 - local title = _"Voting" 1.327 - ui.image{ 1.328 - attr = { title = title, alt = title }, 1.329 - static = "icons/16/email_open.png" 1.330 - } 1.331 - end, 1.332 - field_attr = field_attr, 1.333 - label_attr = label_attr, 1.334 - content = function(record) 1.335 - ui.link{ 1.336 - text = tostring(record.issues_voting_count), 1.337 - module = "area", 1.338 - view = "show", 1.339 - id = record.id, 1.340 - params = { filter = "frozen", tab = "issues" } 1.341 - } 1.342 - end 1.343 - }, 1.344 - { 1.345 - label = function() 1.346 - local title = _"Finished" 1.347 - ui.image{ 1.348 - attr = { title = title, alt = title }, 1.349 - static = "icons/16/tick.png" 1.350 - } 1.351 - end, 1.352 - field_attr = field_attr, 1.353 - label_attr = label_attr, 1.354 - content = function(record) 1.355 - ui.link{ 1.356 - text = tostring(record.issues_finished_count), 1.357 - module = "area", 1.358 - view = "show", 1.359 - id = record.id, 1.360 - params = { filter = "finished", issue_list = "newest", tab = "issues" } 1.361 - } 1.362 - end 1.363 - }, 1.364 - { 1.365 - label = function() 1.366 - local title = _"Cancelled" 1.367 - ui.image{ 1.368 - attr = { title = title, alt = title }, 1.369 - static = "icons/16/cross.png" 1.370 - } 1.371 - end, 1.372 - field_attr = field_attr, 1.373 - label_attr = label_attr, 1.374 - content = function(record) 1.375 - ui.link{ 1.376 - text = tostring(record.issues_cancelled_count), 1.377 - module = "area", 1.378 - view = "show", 1.379 - id = record.id, 1.380 - params = { filter = "cancelled", issue_list = "newest", tab = "issues" } 1.381 - } 1.382 - end 1.383 - }, 1.384 - { 1.385 - content = function(record) 1.386 - if record.issues_to_vote_count > 0 then 1.387 - ui.link{ 1.388 - attr = { class = "not_voted" }, 1.389 - text = _"Not yet voted" .. ": " .. tostring(record.issues_to_vote_count), 1.390 - module = "area", 1.391 - view = "show", 1.392 - id = record.id, 1.393 - params = { 1.394 - filter = "frozen", 1.395 - filter_voting = "not_voted", 1.396 - tab = "issues" 1.397 - } 1.398 - } 1.399 - end 1.400 - end 1.401 - }, 1.402 - } 1.403 - } 1.404 - end 1.405 + } 1.406 + end 1.407 + end 1.408 + }, 1.409 + } 1.410 } 1.411 1.412 ui.bargraph_legend{