liquid_feedback_frontend

diff app/main/supporter/_show_box.lua @ 281:b77e6a17ca77

Check unit voting right where neccessary, hide action buttons for units without voting right
author bsw
date Thu Feb 16 15:01:49 2012 +0100 (2012-02-16)
parents 808269b7f41c
children 955bd41e1559
line diff
     1.1 --- a/app/main/supporter/_show_box.lua	Thu Feb 16 14:08:55 2012 +0100
     1.2 +++ b/app/main/supporter/_show_box.lua	Thu Feb 16 15:01:49 2012 +0100
     1.3 @@ -64,21 +64,18 @@
     1.4                routing = routing,
     1.5                partial = partial
     1.6              }
     1.7 -          else
     1.8 -
     1.9 -            if not initiative.revoked then
    1.10 -              local params = param.get_all_cgi()
    1.11 -              params.dyn = nil
    1.12 -              ui.link{
    1.13 -                image   = { static = "icons/16/thumb_up_green.png" },
    1.14 -                text    = _"Support this initiative",
    1.15 -                module  = "initiative",
    1.16 -                action  = "add_support",
    1.17 -                id      = initiative.id,
    1.18 -                routing = routing,
    1.19 -                partial = partial
    1.20 -              }
    1.21 -            end
    1.22 +          elseif not initiative.revoked and app.session.member:has_voting_right_for_unit_id(initiative.issue.area.unit_id) then
    1.23 +            local params = param.get_all_cgi()
    1.24 +            params.dyn = nil
    1.25 +            ui.link{
    1.26 +              image   = { static = "icons/16/thumb_up_green.png" },
    1.27 +              text    = _"Support this initiative",
    1.28 +              module  = "initiative",
    1.29 +              action  = "add_support",
    1.30 +              id      = initiative.id,
    1.31 +              routing = routing,
    1.32 +              partial = partial
    1.33 +            }
    1.34            end
    1.35          end
    1.36  

Impressum / About Us