liquid_feedback_frontend
changeset 570:b904fc12cc1a
Show only units with voting privilege in member_home page
author | bsw |
---|---|
date | Tue Jun 19 23:18:39 2012 +0200 (2012-06-19) |
parents | 499ff506ccc0 |
children | 63eda58a870e |
files | app/main/index/_index_member.lua app/main/index/_member_home.lua |
line diff
1.1 --- a/app/main/index/_index_member.lua Tue Jun 19 22:59:58 2012 +0200 1.2 +++ b/app/main/index/_index_member.lua Tue Jun 19 23:18:39 2012 +0200 1.3 @@ -4,14 +4,13 @@ 1.4 view = "index" 1.5 } 1.6 1.7 -local areas_selector = app.session.member:get_reference_selector("areas") 1.8 tabs[#tabs+1] = { 1.9 name = "areas", 1.10 label = _"Home", 1.11 icon = { static = "icons/16/package.png" }, 1.12 module = "index", 1.13 view = "_member_home", 1.14 - params = { areas_selector = areas_selector, member = app.session.member, for_member = true }, 1.15 + params = { member = app.session.member } 1.16 } 1.17 1.18 tabs[#tabs+1] = {
2.1 --- a/app/main/index/_member_home.lua Tue Jun 19 22:59:58 2012 +0200 2.2 +++ b/app/main/index/_member_home.lua Tue Jun 19 23:18:39 2012 +0200 2.3 @@ -36,6 +36,9 @@ 2.4 local units = Unit:new_selector():exec() 2.5 2.6 for i, unit in ipairs(units) do 2.7 + if not member:has_voting_right_for_unit_id(unit.id) then 2.8 + break 2.9 + end 2.10 local trustee_member = Member:new_selector() 2.11 :join("delegation", nil, { "delegation.scope = 'unit' AND delegation.unit_id = ? AND delegation.trustee_id = member.id AND delegation.truster_id = ?", unit.id, member.id }) 2.12 :optional_object_mode() 2.13 @@ -50,7 +53,7 @@ 2.14 local area_count = areas_selector:count() 2.15 2.16 ui.container{ attr = { class = "member_area_list" }, content = function() 2.17 - ui.container{ attr = { class = "xunit_head" }, content = function() 2.18 + ui.container{ attr = { class = "unit_head" }, content = function() 2.19 ui.link{ 2.20 text = unit.name, 2.21 module = "unit", view = "show", id = unit.id