liquid_feedback_frontend
diff app/main/delegation/_show_box.lua @ 281:b77e6a17ca77
Check unit voting right where neccessary, hide action buttons for units without voting right
author | bsw |
---|---|
date | Thu Feb 16 15:01:49 2012 +0100 (2012-02-16) |
parents | bde068b37608 |
children | 56c13151d0b8 |
line diff
1.1 --- a/app/main/delegation/_show_box.lua Thu Feb 16 14:08:55 2012 +0100 1.2 +++ b/app/main/delegation/_show_box.lua Thu Feb 16 15:01:49 2012 +0100 1.3 @@ -1,4 +1,19 @@ 1.4 function change_delegation(scope, unit_id, area_id, issue, delegation, initiative_id) 1.5 + local check_unit_id 1.6 + if unit_id then 1.7 + check_unit_id = unit_id 1.8 + elseif area_id then 1.9 + local area = Area:by_id(area_id) 1.10 + check_unit_id = area.unit_id 1.11 + else 1.12 + local area = Area:by_id(issue.area_id) 1.13 + check_unit_id = area.unit_id 1.14 + end 1.15 + 1.16 + if not app.session.member:has_voting_right_for_unit_id(check_unit_id) then 1.17 + return 1.18 + end 1.19 + 1.20 local image 1.21 local text 1.22 if scope == "unit" and delegation and delegation.unit_id then