bsw@525: local unit = param.get("unit", "table") bsw@774: local member = param.get("member", "table") bsw@525: bsw@529: local show_content = param.get("show_content", atom.boolean) bsw@529: bsw@814: if app.session.member_id then bsw@814: unit:load_delegation_info_once_for_member_id(app.session.member_id) bsw@814: end bsw@529: bsw@526: ui.container{ attr = { class = "unit_head" }, content = function() bsw@525: bsw@774: execute.view{ module = "delegation", view = "_info", params = { unit = unit, member = member } } bsw@525: bsw@526: ui.container{ attr = { class = "title" }, content = function() bsw@526: if not config.single_unit_id then bsw@526: ui.link{ bsw@526: module = "unit", view = "show", id = unit.id, bsw@526: attr = { class = "unit_name" }, content = unit.name bsw@526: } bsw@526: else bsw@526: ui.link{ bsw@526: module = "unit", view = "show", id = unit.id, bsw@729: attr = { class = "unit_name" }, content = _"LiquidFeedback" .. " · " .. config.instance_name bsw@526: } bsw@526: end bsw@525: end } bsw@525: bsw@529: if show_content then bsw@529: ui.container{ attr = { class = "content" }, content = function() bsw@526: bsw@774: if member and member:has_voting_right_for_unit_id(unit.id) then bsw@774: if app.session.member_id == member.id then bsw@774: ui.tag{ content = _"You have voting privileges for this unit" } bsw@774: slot.put(" · ") bsw@774: if unit.delegation_info.first_trustee_id == nil then bsw@774: ui.link{ text = _"Delegate unit", module = "delegation", view = "show", params = { unit_id = unit.id } } bsw@774: else bsw@774: ui.link{ text = _"Change unit delegation", module = "delegation", view = "show", params = { unit_id = unit.id } } bsw@774: end bsw@529: else bsw@774: ui.tag{ content = _"Member has voting privileges for this unit" } bsw@529: end bsw@529: end bsw@529: end } bsw@529: else bsw@529: slot.put("
") bsw@529: end bsw@529: bsw@526: end }