| rev | line source | 
| bsw@1045 | 1 local member = param.get ( "member", "table" ) or app.session.member | 
| bsw@1045 | 2 | 
| bsw@1045 | 3 local area = param.get ( "area", "table" ) | 
| bsw@1045 | 4 | 
| bsw@1045 | 5 local participating_trustee_id | 
| bsw@1045 | 6 local participating_trustee_name | 
| bsw@1045 | 7 if member then | 
| bsw@1045 | 8   if area.delegation_info.first_trustee_participation then | 
| bsw@1045 | 9     participating_trustee_id = area.delegation_info.first_trustee_id | 
| bsw@1045 | 10     participating_trustee_name = area.delegation_info.first_trustee_name | 
| bsw@1045 | 11   elseif area.delegation_info.other_trustee_participation then | 
| bsw@1045 | 12     participating_trustee_id = area.delegation_info.other_trustee_id | 
| bsw@1045 | 13     participating_trustee_name = area.delegation_info.other_trustee_name | 
| bsw@1045 | 14   end | 
| bsw@1045 | 15 end | 
| bsw@1045 | 16 | 
| bsw@1045 | 17 ui.sidebar ( "tab-whatcanido", function () | 
| bsw@1045 | 18 | 
| bsw@1045 | 19   ui.sidebarHeadWhatCanIDo() | 
| bsw@1045 | 20 | 
| bsw@1045 | 21   if member and not app.session.member:has_voting_right_for_unit_id(area.unit_id) then | 
| bsw@1045 | 22     ui.sidebarSection( _"You are not entitled to vote in this unit" ) | 
| bsw@1045 | 23   end | 
| bsw@1045 | 24 | 
| bsw@1045 | 25   if member and app.session.member:has_voting_right_for_unit_id(area.unit_id) then | 
| bsw@1045 | 26     if not area.delegation_info.own_participation then | 
| bsw@1045 | 27       ui.sidebarSection ( function () | 
| bsw@1045 | 28 | 
| bsw@1045 | 29         ui.heading { | 
| bsw@1045 | 30           level = 3, | 
| bsw@1045 | 31           content = _"I want to participate in this subject area" | 
| bsw@1045 | 32         } | 
| bsw@1045 | 33         ui.tag { tag = "ul", attr = { class = "ul" }, content = function () | 
| bsw@1045 | 34           ui.tag { tag = "li", content = function () | 
| bsw@1045 | 35             ui.tag { content = function () | 
| bsw@1045 | 36               ui.link { | 
| bsw@1045 | 37                 module = "membership", action = "update", | 
| bsw@1045 | 38                 routing = { default = { | 
| bsw@1045 | 39                   mode = "redirect", module = "area", view = "show", id = area.id | 
| bsw@1045 | 40                 } }, | 
| bsw@1045 | 41                 params = { area_id = area.id }, | 
| bsw@1045 | 42                 text = _"subscribe" | 
| bsw@1045 | 43               } | 
| bsw@1045 | 44             end } | 
| bsw@1045 | 45           end } | 
| bsw@1045 | 46         end } | 
| bsw@1045 | 47       end ) | 
| bsw@1045 | 48     end | 
| bsw@1045 | 49 | 
| bsw@1045 | 50     if area.delegation_info.own_participation then | 
| bsw@1045 | 51       ui.sidebarSection ( function () | 
| bsw@1045 | 52         ui.image{ attr = { class = "right" }, static = "icons/48/star.png" } | 
| bsw@1045 | 53         ui.heading { | 
| bsw@1045 | 54           level = 3, | 
| bsw@1045 | 55           content = _"You are subscribed for this subject area" | 
| bsw@1045 | 56         } | 
| bsw@1045 | 57         ui.tag { tag = "ul", attr = { class = "ul" }, content = function () | 
| bsw@1045 | 58           ui.tag { tag = "li", content = function () | 
| bsw@1045 | 59             ui.tag { content = function () | 
| bsw@1045 | 60               ui.link { | 
| bsw@1045 | 61                 module = "membership", action = "update", | 
| bsw@1045 | 62                 routing = { default = { | 
| bsw@1045 | 63                   mode = "redirect", module = "area", view = "show", id = area.id | 
| bsw@1045 | 64                 } }, | 
| bsw@1045 | 65                 params = { area_id = area.id, delete = true }, | 
| bsw@1045 | 66                 text = _"unsubscribe" | 
| bsw@1045 | 67               } | 
| bsw@1045 | 68             end } | 
| bsw@1045 | 69           end } | 
| bsw@1045 | 70         end } | 
| bsw@1045 | 71       end ) | 
| bsw@1045 | 72     end | 
| bsw@1045 | 73 | 
| bsw@1045 | 74 | 
| bsw@1045 | 75     ui.sidebarSection ( function () | 
| bsw@1045 | 76 | 
| bsw@1045 | 77 | 
| bsw@1045 | 78       if not area.delegation_info.first_trustee_id then | 
| bsw@1045 | 79         ui.heading{ level = 3, content = _"I want to delegate this subject area" } | 
| bsw@1045 | 80       else | 
| bsw@1045 | 81         ui.container { attr = { class = "right" }, content = function() | 
| bsw@1045 | 82           local member = Member:by_id(area.delegation_info.first_trustee_id) | 
| bsw@1045 | 83           execute.view{ | 
| bsw@1045 | 84             module = "member_image", | 
| bsw@1045 | 85             view = "_show", | 
| bsw@1045 | 86             params = { | 
| bsw@1045 | 87               member = member, | 
| bsw@1045 | 88               image_type = "avatar", | 
| bsw@1045 | 89               show_dummy = true | 
| bsw@1045 | 90             } | 
| bsw@1045 | 91           } | 
| bsw@1045 | 92         end } | 
| bsw@1045 | 93         ui.heading{ level = 3, content = _"You delegated this subject area" } | 
| bsw@1045 | 94       end | 
| bsw@1045 | 95 | 
| bsw@1045 | 96       ui.tag { tag = "ul", attr = { class = "ul" }, content = function () | 
| bsw@1045 | 97         if area.delegation_info.own_delegation_scope == "unit" then | 
| bsw@1045 | 98           ui.tag { tag = "li", content = function () | 
| bsw@1045 | 99             ui.link { | 
| bsw@1045 | 100               module = "delegation", view = "show", params = { | 
| bsw@1045 | 101                 unit_id = area.unit_id, | 
| bsw@1045 | 102               }, | 
| bsw@1045 | 103               content = _("change/revoke delegation of organizational unit") | 
| bsw@1045 | 104             } | 
| bsw@1045 | 105           end } | 
| bsw@1045 | 106         end | 
| bsw@1045 | 107 | 
| bsw@1045 | 108         if area.delegation_info.own_delegation_scope == nil then | 
| bsw@1045 | 109           ui.tag { tag = "li", content = function () | 
| bsw@1045 | 110             ui.link { | 
| bsw@1045 | 111               module = "delegation", view = "show", params = { | 
| bsw@1045 | 112                 area_id = area.id | 
| bsw@1045 | 113               }, | 
| bsw@1045 | 114               content = _"choose subject area delegatee" | 
| bsw@1045 | 115             } | 
| bsw@1045 | 116           end } | 
| bsw@1045 | 117         elseif area.delegation_info.own_delegation_scope == "area" then | 
| bsw@1045 | 118           ui.tag { tag = "li", content = function () | 
| bsw@1045 | 119             ui.link { | 
| bsw@1045 | 120               module = "delegation", view = "show", params = { | 
| bsw@1045 | 121                 area_id = area.id | 
| bsw@1045 | 122               }, | 
| bsw@1045 | 123               content = _"change/revoke area delegation" | 
| bsw@1045 | 124             } | 
| bsw@1045 | 125           end } | 
| bsw@1045 | 126         else | 
| bsw@1045 | 127           ui.tag { tag = "li", content = function () | 
| bsw@1045 | 128             ui.link { | 
| bsw@1045 | 129               module = "delegation", view = "show", params = { | 
| bsw@1045 | 130                 area_id = area.id | 
| bsw@1045 | 131               }, | 
| bsw@1045 | 132               content = _"change/revoke delegation only for this subject area" | 
| bsw@1045 | 133             } | 
| bsw@1045 | 134           end } | 
| bsw@1045 | 135         end | 
| bsw@1045 | 136       end } | 
| bsw@1045 | 137     end ) | 
| bsw@1045 | 138 | 
| bsw@1045 | 139 | 
| bsw@1045 | 140 | 
| bsw@1045 | 141 | 
| bsw@1045 | 142     if app.session.member:has_voting_right_for_unit_id ( area.unit_id ) then | 
| bsw@1045 | 143       ui.sidebarSection ( function () | 
| bsw@1045 | 144         ui.heading { | 
| bsw@1045 | 145           level = 3, | 
| bsw@1045 | 146           content = _("I want to start a new initiative", { | 
| bsw@1045 | 147             area_name = area.name | 
| bsw@1045 | 148           } ) | 
| bsw@1045 | 149         } | 
| bsw@1045 | 150         ui.tag { tag = "ul", attr = { class = "ul" }, content = function () | 
| bsw@1045 | 151           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 | 152           ui.tag { tag = "li", content = function () | 
| bsw@1045 | 153             ui.tag { content = function () | 
| bsw@1045 | 154               ui.tag { content = _"If you cannot find any appropriate existing issue, " } | 
| bsw@1045 | 155               ui.link { | 
| bsw@1045 | 156                 module = "initiative", view = "new", | 
| bsw@1045 | 157                 params = { area_id = area.id }, | 
| bsw@1045 | 158                 text = _"start an initiative in a new issue" | 
| bsw@1045 | 159               } | 
| bsw@1045 | 160             end } | 
| bsw@1045 | 161           end } | 
| bsw@1045 | 162         end } | 
| bsw@1045 | 163       end ) | 
| bsw@1045 | 164     end | 
| bsw@1045 | 165   else | 
| bsw@1045 | 166   end | 
| bsw@1045 | 167 | 
| bsw@1045 | 168 end ) |