liquid_feedback_frontend

changeset 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 5d2a337a33e4
children 7d0592d4cf0f
files app/main/initiative/_list_element.lua app/main/initiative/_show.lua
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
     2.1 --- a/app/main/initiative/_show.lua	Sat Mar 09 20:47:26 2013 +0100
     2.2 +++ b/app/main/initiative/_show.lua	Sat Mar 09 20:48:01 2013 +0100
     2.3 @@ -193,7 +193,7 @@
     2.4  
     2.5    
     2.6    -- voting results
     2.7 -  if initiative.issue.ranks_available and initiative.admitted then
     2.8 +  if initiative.issue.fully_frozen and initiative.issue.closed and initiative.admitted then
     2.9      local class = initiative.winner and "admitted_info" or "not_admitted_info"
    2.10      ui.container{
    2.11        attr = { class = class },
    2.12 @@ -428,7 +428,7 @@
    2.13  
    2.14  
    2.15    if app.session:has_access("all_pseudonymous") then
    2.16 -    if initiative.issue.ranks_available then
    2.17 +    if initiative.issue.fully_frozen and initiative.issue.closed then
    2.18        local members_selector = initiative.issue:get_reference_selector("direct_voters")
    2.19              :left_join("vote", nil, { "vote.initiative_id = ? AND vote.member_id = member.id", initiative.id })
    2.20              :add_field("direct_voter.weight as voter_weight")

Impressum / About Us