liquid_feedback_frontend

diff app/main/suggestion/_list.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 f460555c9896
children 6c88b4bfb56c
line diff
     1.1 --- a/app/main/suggestion/_list.lua	Thu Feb 16 14:08:55 2012 +0100
     1.2 +++ b/app/main/suggestion/_list.lua	Thu Feb 16 15:01:49 2012 +0100
     1.3 @@ -116,7 +116,8 @@
     1.4                  ui.container{
     1.5                    attr = { class = "suggestion_my_opinion" },
     1.6                    content = function()
     1.7 -                    if app.session.member_id then
     1.8 +                    local has_voting_right = app.session.member:has_voting_right_for_unit_id(initiative.issue.area.unit_id)
     1.9 +                    if app.session.member_id and has_voting_right then
    1.10                        if initiative.issue.state == "voting" or initiative.issue.state == "closed" then
    1.11                          if degree == -2 then
    1.12                            ui.tag{
    1.13 @@ -225,6 +226,8 @@
    1.14                            partial = partial
    1.15                          }
    1.16                        end
    1.17 +                    elseif app.session.member_id then
    1.18 +                      ui.field.text{ value = _"[No voting privilege]" }
    1.19                      else
    1.20                        ui.field.text{ value = _"[Registered members only]" }
    1.21                      end

Impressum / About Us