bsw@1045: local unit = param.get ( "unit", "table" ) bsw@1045: bsw@1045: ui.sidebar ( "tab-whatcanido", function () bsw@1045: bsw@1045: ui.sidebarHeadWhatCanIDo() bsw@1045: bsw@1045: if app.session.member then bsw@1045: bsw@1045: if app.session.member:has_voting_right_for_unit_id ( unit.id ) then bsw@1045: ui.sidebarSection( function () bsw@1045: bsw@1045: if not unit.delegation_info.first_trustee_id then bsw@1045: ui.heading{ level = 3, content = _"I want to delegate this organizational unit" } bsw@1045: ui.tag { tag = "ul", attr = { class = "ul" }, content = function () bsw@1045: ui.tag { tag = "li", content = function () bsw@1045: ui.link { bsw@1045: module = "delegation", view = "show", params = { bsw@1045: unit_id = unit.id, bsw@1045: }, bsw@1045: content = _("choose delegatee", { bsw@1045: unit_name = unit.name bsw@1045: }) bsw@1045: } bsw@1045: end } bsw@1045: end } bsw@1045: else bsw@1045: ui.container { attr = { class = "right" }, content = function() bsw@1045: local member = Member:by_id(unit.delegation_info.first_trustee_id) bsw@1045: execute.view{ bsw@1045: module = "member_image", bsw@1045: view = "_show", bsw@1045: params = { bsw@1045: member = member, bsw@1045: image_type = "avatar", bsw@1045: show_dummy = true bsw@1045: } bsw@1045: } bsw@1045: end } bsw@1045: ui.heading{ level = 3, content = _"You delegated this unit" } bsw@1045: bsw@1045: ui.tag { tag = "ul", attr = { class = "ul" }, content = function () bsw@1045: ui.tag { tag = "li", content = function () bsw@1045: ui.link { bsw@1045: module = "delegation", view = "show", params = { bsw@1045: unit_id = unit.id, bsw@1045: }, bsw@1045: content = _("change/revoke delegation", { bsw@1045: unit_name = unit.name bsw@1045: }) bsw@1045: } bsw@1045: end } bsw@1045: end } bsw@1045: end bsw@1045: end ) bsw@1045: bsw@1045: ui.sidebarSection( function() bsw@1045: ui.heading { level = 3, content = _"I want to start a new initiative" } bsw@1045: ui.tag { tag = "ul", attr = { class = "ul" }, content = function () bsw@1045: ui.tag { tag = "li", content = _"Open the appropriate subject area where your issue fits in and follow the instruction on that page." } bsw@1045: end } bsw@1045: end ) bsw@1045: bsw@1045: else bsw@1045: ui.sidebarSection( _"You are not entitled to vote in this unit" ) bsw@1045: end bsw@1045: bsw@1045: end bsw@1045: bsw@1045: end )