bsw@1045: local member = param.get ( "member", "table" ) or app.session.member bsw@1045: bsw@1045: local area = param.get ( "area", "table" ) bsw@1045: bsw@1045: local participating_trustee_id bsw@1045: local participating_trustee_name bsw@1045: if member then bsw@1045: if area.delegation_info.first_trustee_participation then bsw@1045: participating_trustee_id = area.delegation_info.first_trustee_id bsw@1045: participating_trustee_name = area.delegation_info.first_trustee_name bsw@1045: elseif area.delegation_info.other_trustee_participation then bsw@1045: participating_trustee_id = area.delegation_info.other_trustee_id bsw@1045: participating_trustee_name = area.delegation_info.other_trustee_name bsw@1045: end bsw@1045: end bsw@1045: bsw@1045: ui.sidebar ( "tab-whatcanido", function () bsw@1045: bsw@1045: ui.sidebarHeadWhatCanIDo() bsw@1045: bsw@1045: if member and not app.session.member:has_voting_right_for_unit_id(area.unit_id) then bsw@1045: ui.sidebarSection( _"You are not entitled to vote in this unit" ) bsw@1045: end bsw@1045: bsw@1045: if member and app.session.member:has_voting_right_for_unit_id(area.unit_id) then bsw@1045: if not area.delegation_info.own_participation then bsw@1045: ui.sidebarSection ( function () bsw@1045: bsw@1045: ui.heading { bsw@1045: level = 3, bsw@1045: content = _"I want to participate in this subject area" bsw@1045: } bsw@1045: ui.tag { tag = "ul", attr = { class = "ul" }, content = function () bsw@1045: ui.tag { tag = "li", content = function () bsw@1045: ui.tag { content = function () bsw@1045: ui.link { bsw@1045: module = "membership", action = "update", bsw@1045: routing = { default = { bsw@1045: mode = "redirect", module = "area", view = "show", id = area.id bsw@1045: } }, bsw@1045: params = { area_id = area.id }, bsw@1045: text = _"subscribe" bsw@1045: } bsw@1045: end } bsw@1045: end } bsw@1045: end } bsw@1045: end ) bsw@1045: end bsw@1045: bsw@1045: if area.delegation_info.own_participation then bsw@1045: ui.sidebarSection ( function () bsw@1045: ui.image{ attr = { class = "right" }, static = "icons/48/star.png" } bsw@1045: ui.heading { bsw@1045: level = 3, bsw@1045: content = _"You are subscribed for this subject area" bsw@1045: } bsw@1045: ui.tag { tag = "ul", attr = { class = "ul" }, content = function () bsw@1045: ui.tag { tag = "li", content = function () bsw@1045: ui.tag { content = function () bsw@1045: ui.link { bsw@1045: module = "membership", action = "update", bsw@1045: routing = { default = { bsw@1045: mode = "redirect", module = "area", view = "show", id = area.id bsw@1045: } }, bsw@1045: params = { area_id = area.id, delete = true }, bsw@1045: text = _"unsubscribe" bsw@1045: } bsw@1045: end } bsw@1045: end } bsw@1045: end } bsw@1045: end ) bsw@1045: end bsw@1045: bsw@1045: bsw@1045: ui.sidebarSection ( function () bsw@1045: bsw@1045: bsw@1045: if not area.delegation_info.first_trustee_id then bsw@1045: ui.heading{ level = 3, content = _"I want to delegate this subject area" } bsw@1045: else bsw@1045: ui.container { attr = { class = "right" }, content = function() bsw@1045: local member = Member:by_id(area.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 subject area" } bsw@1045: end bsw@1045: bsw@1045: ui.tag { tag = "ul", attr = { class = "ul" }, content = function () bsw@1045: if area.delegation_info.own_delegation_scope == "unit" then bsw@1045: ui.tag { tag = "li", content = function () bsw@1045: ui.link { bsw@1045: module = "delegation", view = "show", params = { bsw@1045: unit_id = area.unit_id, bsw@1045: }, bsw@1045: content = _("change/revoke delegation of organizational unit") bsw@1045: } bsw@1045: end } bsw@1045: end bsw@1045: bsw@1045: if area.delegation_info.own_delegation_scope == nil then bsw@1045: ui.tag { tag = "li", content = function () bsw@1045: ui.link { bsw@1045: module = "delegation", view = "show", params = { bsw@1045: area_id = area.id bsw@1045: }, bsw@1045: content = _"choose subject area delegatee" bsw@1045: } bsw@1045: end } bsw@1045: elseif area.delegation_info.own_delegation_scope == "area" then bsw@1045: ui.tag { tag = "li", content = function () bsw@1045: ui.link { bsw@1045: module = "delegation", view = "show", params = { bsw@1045: area_id = area.id bsw@1045: }, bsw@1045: content = _"change/revoke area delegation" bsw@1045: } bsw@1045: end } bsw@1045: else bsw@1045: ui.tag { tag = "li", content = function () bsw@1045: ui.link { bsw@1045: module = "delegation", view = "show", params = { bsw@1045: area_id = area.id bsw@1045: }, bsw@1045: content = _"change/revoke delegation only for this subject area" bsw@1045: } bsw@1045: end } bsw@1045: end bsw@1045: end } bsw@1045: end ) bsw@1045: bsw@1045: bsw@1045: bsw@1045: bsw@1045: if app.session.member:has_voting_right_for_unit_id ( area.unit_id ) then bsw@1045: ui.sidebarSection ( function () bsw@1045: ui.heading { bsw@1045: level = 3, bsw@1045: content = _("I want to start a new initiative", { bsw@1045: area_name = area.name bsw@1045: } ) bsw@1045: } bsw@1045: ui.tag { tag = "ul", attr = { class = "ul" }, content = function () bsw@1045: ui.tag { tag = "li", content = _"Take a look through the existing issues. Maybe someone else started a debate on your topic (and you can join it) or the topic has been decided already in the past." } bsw@1045: ui.tag { tag = "li", content = function () bsw@1045: ui.tag { content = function () bsw@1045: ui.tag { content = _"If you cannot find any appropriate existing issue, " } bsw@1045: ui.link { bsw@1045: module = "initiative", view = "new", bsw@1045: params = { area_id = area.id }, bsw@1045: text = _"start an initiative in a new issue" bsw@1045: } bsw@1045: end } bsw@1045: end } bsw@1045: end } bsw@1045: end ) bsw@1045: end bsw@1045: else bsw@1045: end bsw@1045: bsw@1045: end )