# HG changeset patch # User bsw # Date 1328641164 -3600 # Node ID 55c2806c7113795fdde2f2170e166b785e771854 # Parent 1f7b38584c0d8a6b93597283e80a2b86f3d160a6 Removed unnecessary filter option in area list diff -r 1f7b38584c0d -r 55c2806c7113 app/main/area/_list.lua --- a/app/main/area/_list.lua Tue Feb 07 19:26:24 2012 +0100 +++ b/app/main/area/_list.lua Tue Feb 07 19:59:24 2012 +0100 @@ -26,226 +26,197 @@ local label_attr = { style = "text-align: right; width: 4em;" } local field_attr = { style = "text-align: right; width: 4em;" } -ui.filters{ - label = _"Change order", - selector = areas_selector, - { - label = _"Order by", +ui.list{ + attr = { class = "area_list" }, + records = areas_selector:exec(), + columns = { + { + content = function(record) + if record.is_member then + local text = _"Member of area" + ui.image{ + attr = { title = text, alt = text, style = "vertical-align: middle;" }, + static = "icons/16/user_gray.png", + } + end + end + }, { - name = "member_weight", - label = _"Population", - selector_modifier = function(selector) selector:add_order_by("area.member_weight DESC") end + content = function(record) + if record.area_delegation_name then + local text = _("Area delegated to '#{name}'", { name = record.area_delegation_name }) + ui.image{ + attr = { title = text, alt = text, style = "vertical-align: middle;" }, + static = "icons/16/link.png", + } + end + end + }, + { + content = function(record) + if record.member_weight and record.direct_member_count then + local max_value = MemberCount:get() + ui.bargraph{ + max_value = max_value, + width = 100, + bars = { + { color = "#444", value = record.direct_member_count }, + { color = "#777", value = record.member_weight - record.direct_member_count }, + { color = "#ddd", value = max_value - record.member_weight }, + } + } + end + end }, { - name = "direct_member_count", - label = _"Direct member count", - selector_modifier = function(selector) selector:add_order_by("area.direct_member_count DESC") end + content = function(record) + ui.link{ + text = record.name, + module = "area", + view = "show", + id = record.id + } + end }, { - name = "az", - label = _"A-Z", - selector_modifier = function(selector) selector:add_order_by("area.name") end + label = function() + local title = _"New" + ui.image{ + attr = { title = title, alt = title }, + static = "icons/16/new.png" + } + end, + field_attr = field_attr, + label_attr = label_attr, + content = function(record) + ui.link{ + text = tostring(record.issues_new_count), + module = "area", + view = "show", + id = record.id, + params = { filter = "new", tab = "issues" } + } + end + }, + { + label = function() + local title = _"Discussion" + ui.image{ + attr = { title = title, alt = title }, + static = "icons/16/comments.png" + } + end, + field_attr = field_attr, + label_attr = label_attr, + content = function(record) + ui.link{ + text = tostring(record.issues_discussion_count), + module = "area", + view = "show", + id = record.id, + params = { filter = "accepted", tab = "issues" } + } + end }, { - name = "za", - label = _"Z-A", - selector_modifier = function(selector) selector:add_order_by("area.name DESC") end - } - }, - content = function() - ui.list{ - attr = { class = "area_list" }, - records = areas_selector:exec(), - columns = { - { - content = function(record) - if record.is_member then - local text = _"Member of area" - ui.image{ - attr = { title = text, alt = text, style = "vertical-align: middle;" }, - static = "icons/16/user_gray.png", - } - end - end - }, - { - content = function(record) - if record.area_delegation_name then - local text = _("Area delegated to '#{name}'", { name = record.area_delegation_name }) - ui.image{ - attr = { title = text, alt = text, style = "vertical-align: middle;" }, - static = "icons/16/link.png", - } - end - end - }, - { - content = function(record) - if record.member_weight and record.direct_member_count then - local max_value = MemberCount:get() - ui.bargraph{ - max_value = max_value, - width = 100, - bars = { - { color = "#444", value = record.direct_member_count }, - { color = "#777", value = record.member_weight - record.direct_member_count }, - { color = "#ddd", value = max_value - record.member_weight }, - } - } - end - end - }, - { - content = function(record) - ui.link{ - text = record.name, - module = "area", - view = "show", - id = record.id - } - end - }, - { - label = function() - local title = _"New" - ui.image{ - attr = { title = title, alt = title }, - static = "icons/16/new.png" - } - end, - field_attr = field_attr, - label_attr = label_attr, - content = function(record) - ui.link{ - text = tostring(record.issues_new_count), - module = "area", - view = "show", - id = record.id, - params = { filter = "new", tab = "issues" } - } - end - }, - { - label = function() - local title = _"Discussion" - ui.image{ - attr = { title = title, alt = title }, - static = "icons/16/comments.png" - } - end, - field_attr = field_attr, - label_attr = label_attr, - content = function(record) - ui.link{ - text = tostring(record.issues_discussion_count), - module = "area", - view = "show", - id = record.id, - params = { filter = "accepted", tab = "issues" } + label = function() + local title = _"Frozen" + ui.image{ + attr = { title = title, alt = title }, + static = "icons/16/lock.png" + } + end, + field_attr = field_attr, + label_attr = label_attr, + content = function(record) + ui.link{ + text = tostring(record.issues_frozen_count), + module = "area", + view = "show", + id = record.id, + params = { filter = "half_frozen", tab = "issues" } + } + end + }, + { + label = function() + local title = _"Voting" + ui.image{ + attr = { title = title, alt = title }, + static = "icons/16/email_open.png" + } + end, + field_attr = field_attr, + label_attr = label_attr, + content = function(record) + ui.link{ + text = tostring(record.issues_voting_count), + module = "area", + view = "show", + id = record.id, + params = { filter = "frozen", tab = "issues" } + } + end + }, + { + label = function() + local title = _"Finished" + ui.image{ + attr = { title = title, alt = title }, + static = "icons/16/tick.png" + } + end, + field_attr = field_attr, + label_attr = label_attr, + content = function(record) + ui.link{ + text = tostring(record.issues_finished_count), + module = "area", + view = "show", + id = record.id, + params = { filter = "finished", issue_list = "newest", tab = "issues" } + } + end + }, + { + label = function() + local title = _"Cancelled" + ui.image{ + attr = { title = title, alt = title }, + static = "icons/16/cross.png" + } + end, + field_attr = field_attr, + label_attr = label_attr, + content = function(record) + ui.link{ + text = tostring(record.issues_cancelled_count), + module = "area", + view = "show", + id = record.id, + params = { filter = "cancelled", issue_list = "newest", tab = "issues" } + } + end + }, + { + content = function(record) + if record.issues_to_vote_count > 0 then + ui.link{ + attr = { class = "not_voted" }, + text = _"Not yet voted" .. ": " .. tostring(record.issues_to_vote_count), + module = "area", + view = "show", + id = record.id, + params = { + filter = "frozen", + filter_voting = "not_voted", + tab = "issues" } - end - }, - { - label = function() - local title = _"Frozen" - ui.image{ - attr = { title = title, alt = title }, - static = "icons/16/lock.png" - } - end, - field_attr = field_attr, - label_attr = label_attr, - content = function(record) - ui.link{ - text = tostring(record.issues_frozen_count), - module = "area", - view = "show", - id = record.id, - params = { filter = "half_frozen", tab = "issues" } - } - end - }, - { - label = function() - local title = _"Voting" - ui.image{ - attr = { title = title, alt = title }, - static = "icons/16/email_open.png" - } - end, - field_attr = field_attr, - label_attr = label_attr, - content = function(record) - ui.link{ - text = tostring(record.issues_voting_count), - module = "area", - view = "show", - id = record.id, - params = { filter = "frozen", tab = "issues" } - } - end - }, - { - label = function() - local title = _"Finished" - ui.image{ - attr = { title = title, alt = title }, - static = "icons/16/tick.png" - } - end, - field_attr = field_attr, - label_attr = label_attr, - content = function(record) - ui.link{ - text = tostring(record.issues_finished_count), - module = "area", - view = "show", - id = record.id, - params = { filter = "finished", issue_list = "newest", tab = "issues" } - } - end - }, - { - label = function() - local title = _"Cancelled" - ui.image{ - attr = { title = title, alt = title }, - static = "icons/16/cross.png" - } - end, - field_attr = field_attr, - label_attr = label_attr, - content = function(record) - ui.link{ - text = tostring(record.issues_cancelled_count), - module = "area", - view = "show", - id = record.id, - params = { filter = "cancelled", issue_list = "newest", tab = "issues" } - } - end - }, - { - content = function(record) - if record.issues_to_vote_count > 0 then - ui.link{ - attr = { class = "not_voted" }, - text = _"Not yet voted" .. ": " .. tostring(record.issues_to_vote_count), - module = "area", - view = "show", - id = record.id, - params = { - filter = "frozen", - filter_voting = "not_voted", - tab = "issues" - } - } - end - end - }, - } - } - end + } + end + end + }, + } } ui.bargraph_legend{