liquid_feedback_frontend
view app/main/unit/_sidebar_whatcanido.lua @ 1059:3f52e99b444d
Added missing feature database download again
| author | bsw | 
|---|---|
| date | Wed Jul 16 21:49:21 2014 +0200 (2014-07-16) | 
| parents | 701a5cf6b067 | 
| children | 32cc544d5a5b | 
 line source
     1 local unit = param.get ( "unit", "table" )
     3 ui.sidebar ( "tab-whatcanido", function ()
     5   ui.sidebarHeadWhatCanIDo()
     7   if app.session.member then
     9     if app.session.member:has_voting_right_for_unit_id ( unit.id ) then
    10       ui.sidebarSection( function ()
    12         if not unit.delegation_info.first_trustee_id then
    13           ui.heading{ level = 3, content = _"I want to delegate this organizational unit" }
    14           ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
    15             ui.tag { tag = "li", content = function ()
    16               ui.link {
    17                 module = "delegation", view = "show", params = {
    18                   unit_id = unit.id,
    19                 },
    20                 content = _("choose delegatee", {
    21                   unit_name = unit.name
    22                 })
    23               }
    24             end }
    25           end }
    26         else
    27           ui.container { attr = { class = "right" }, content = function()
    28             local member = Member:by_id(unit.delegation_info.first_trustee_id)
    29             execute.view{
    30               module = "member_image",
    31               view = "_show",
    32               params = {
    33                 member = member,
    34                 image_type = "avatar",
    35                 show_dummy = true
    36               }
    37             }
    38           end }
    39           ui.heading{ level = 3, content = _"You delegated this unit" }
    41           ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
    42             ui.tag { tag = "li", content = function ()
    43               ui.link {
    44                 module = "delegation", view = "show", params = {
    45                   unit_id = unit.id,
    46                 },
    47                 content = _("change/revoke delegation", {
    48                   unit_name = unit.name
    49                 })
    50               }
    51             end }
    52           end }
    53         end
    54       end )
    56       ui.sidebarSection( function()
    57         ui.heading { level = 3, content = _"I want to start a new initiative" }
    58         ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
    59           ui.tag { tag = "li", content = _"Open the appropriate subject area where your issue fits in and follow the instruction on that page." }
    60         end } 
    61       end )
    63     else
    64       ui.sidebarSection( _"You are not entitled to vote in this unit" )
    65     end
    67   end
    69 end )
