liquid_feedback_frontend
diff app/main/unit/_head.lua @ 774:a3eb6ca34484
Completed membership/privilege tab in member page
author | bsw |
---|---|
date | Thu Jun 28 23:57:02 2012 +0200 (2012-06-28) |
parents | f52f918b38b8 |
children | b68880106e7e |
line diff
1.1 --- a/app/main/unit/_head.lua Thu Jun 28 23:44:09 2012 +0200 1.2 +++ b/app/main/unit/_head.lua Thu Jun 28 23:57:02 2012 +0200 1.3 @@ -1,4 +1,5 @@ 1.4 local unit = param.get("unit", "table") 1.5 +local member = param.get("member", "table") 1.6 1.7 local show_content = param.get("show_content", atom.boolean) 1.8 1.9 @@ -6,7 +7,7 @@ 1.10 1.11 ui.container{ attr = { class = "unit_head" }, content = function() 1.12 1.13 - execute.view{ module = "delegation", view = "_info", params = { unit = unit } } 1.14 + execute.view{ module = "delegation", view = "_info", params = { unit = unit, member = member } } 1.15 1.16 ui.container{ attr = { class = "title" }, content = function() 1.17 if not config.single_unit_id then 1.18 @@ -25,13 +26,17 @@ 1.19 if show_content then 1.20 ui.container{ attr = { class = "content" }, content = function() 1.21 1.22 - if app.session.member_id and app.session.member:has_voting_right_for_unit_id(unit.id) then 1.23 - ui.tag{ content = _"You have voting privileges for this unit" } 1.24 - slot.put(" · ") 1.25 - if unit.delegation_info.first_trustee_id == nil then 1.26 - ui.link{ text = _"Delegate unit", module = "delegation", view = "show", params = { unit_id = unit.id } } 1.27 + if member and member:has_voting_right_for_unit_id(unit.id) then 1.28 + if app.session.member_id == member.id then 1.29 + ui.tag{ content = _"You have voting privileges for this unit" } 1.30 + slot.put(" · ") 1.31 + if unit.delegation_info.first_trustee_id == nil then 1.32 + ui.link{ text = _"Delegate unit", module = "delegation", view = "show", params = { unit_id = unit.id } } 1.33 + else 1.34 + ui.link{ text = _"Change unit delegation", module = "delegation", view = "show", params = { unit_id = unit.id } } 1.35 + end 1.36 else 1.37 - ui.link{ text = _"Change unit delegation", module = "delegation", view = "show", params = { unit_id = unit.id } } 1.38 + ui.tag{ content = _"Member has voting privileges for this unit" } 1.39 end 1.40 end 1.41 end }