liquid_feedback_frontend

diff app/main/initiative/_list_element.lua @ 975:c7215c18168b

Removed use of issue field "ranks_available" from views
author bsw
date Sat Mar 09 20:48:01 2013 +0100 (2013-03-09)
parents ae9ab3edff89
children 701a5cf6b067
line diff
     1.1 --- a/app/main/initiative/_list_element.lua	Sat Mar 09 20:47:26 2013 +0100
     1.2 +++ b/app/main/initiative/_list_element.lua	Sat Mar 09 20:48:01 2013 +0100
     1.3 @@ -15,8 +15,8 @@
     1.4  ui.container{ attr = { class = class }, content = function()
     1.5  
     1.6    ui.container{ attr = { class = "rank" }, content = function()
     1.7 -    if initiative.issue.accepted and initiative.issue.closed
     1.8 -      and initiative.issue.ranks_available or initiative.admitted == false
     1.9 +    if initiative.issue.fully_frozen and initiative.issue.closed
    1.10 +      or initiative.admitted == false
    1.11      then 
    1.12        ui.field.rank{ attr = { class = "rank" }, value = initiative.rank, eligible = initiative.eligible }
    1.13      elseif not initiative.issue.closed then
    1.14 @@ -28,23 +28,19 @@
    1.15  
    1.16    ui.container{ attr = { class = "bar" }, content = function()
    1.17      if initiative.issue.fully_frozen and initiative.issue.closed then
    1.18 -      if initiative.issue.ranks_available then 
    1.19 -        if initiative.negative_votes and initiative.positive_votes then
    1.20 -          local max_value = initiative.issue.voter_count
    1.21 -          ui.bargraph{
    1.22 -            max_value = max_value,
    1.23 -            width = 100,
    1.24 -            bars = {
    1.25 -              { color = "#0a5", value = initiative.positive_votes },
    1.26 -              { color = "#aaa", value = max_value - initiative.negative_votes - initiative.positive_votes },
    1.27 -              { color = "#a00", value = initiative.negative_votes },
    1.28 -            }
    1.29 +      if initiative.negative_votes and initiative.positive_votes then
    1.30 +        local max_value = initiative.issue.voter_count
    1.31 +        ui.bargraph{
    1.32 +          max_value = max_value,
    1.33 +          width = 100,
    1.34 +          bars = {
    1.35 +            { color = "#0a5", value = initiative.positive_votes },
    1.36 +            { color = "#aaa", value = max_value - initiative.negative_votes - initiative.positive_votes },
    1.37 +            { color = "#a00", value = initiative.negative_votes },
    1.38            }
    1.39 -        else
    1.40 -          slot.put(" ")
    1.41 -        end
    1.42 +        }
    1.43        else
    1.44 -        slot.put(_"Counting of votes")
    1.45 +         slot.put(" ")
    1.46        end
    1.47      else
    1.48        local max_value = initiative.issue.population or 0

Impressum / About Us