liquid_feedback_frontend
diff app/main/unit/_head.lua @ 529:5ca9de94cb13
Delegation preview when setting delegation, optical enhancements, typos fixed
author | bsw |
---|---|
date | Sun May 20 19:43:01 2012 +0200 (2012-05-20) |
parents | 305329da1c75 |
children | f52f918b38b8 |
line diff
1.1 --- a/app/main/unit/_head.lua Fri May 18 21:03:10 2012 +0200 1.2 +++ b/app/main/unit/_head.lua Sun May 20 19:43:01 2012 +0200 1.3 @@ -1,5 +1,9 @@ 1.4 local unit = param.get("unit", "table") 1.5 1.6 +local show_content = param.get("show_content", atom.boolean) 1.7 + 1.8 +unit:load_delegation_info_once_for_member_id(app.session.member_id) 1.9 + 1.10 ui.container{ attr = { class = "unit_head" }, content = function() 1.11 1.12 execute.view{ module = "delegation", view = "_info", params = { unit = unit } } 1.13 @@ -18,11 +22,21 @@ 1.14 end 1.15 end } 1.16 1.17 - ui.container{ attr = { class = "content" }, content = function() 1.18 + if show_content then 1.19 + ui.container{ attr = { class = "content" }, content = function() 1.20 1.21 - if app.session.member_id and app.session.member:has_voting_right_for_unit_id(unit.id) then 1.22 - ui.tag{ content = _"You have voting privileges for this unit" } 1.23 - end 1.24 - end } 1.25 - 1.26 + if app.session.member_id and app.session.member:has_voting_right_for_unit_id(unit.id) then 1.27 + ui.tag{ content = _"You have voting privileges for this unit" } 1.28 + slot.put(" · ") 1.29 + if unit.delegation_info.first_trustee_id == nil then 1.30 + ui.link{ text = _"Delegate unit", module = "delegation", view = "show", params = { unit_id = unit.id } } 1.31 + else 1.32 + ui.link{ text = _"Change unit delegation", module = "delegation", view = "show", params = { unit_id = unit.id } } 1.33 + end 1.34 + end 1.35 + end } 1.36 + else 1.37 + slot.put("<br />") 1.38 + end 1.39 + 1.40 end }