# HG changeset patch # User bsw # Date 1362858481 -3600 # Node ID c7215c18168bbb0a5a66a17d769fbf1e7c662ce8 # Parent 5d2a337a33e4fd814f892977679f26cd8caef932 Removed use of issue field "ranks_available" from views diff -r 5d2a337a33e4 -r c7215c18168b app/main/initiative/_list_element.lua --- a/app/main/initiative/_list_element.lua Sat Mar 09 20:47:26 2013 +0100 +++ b/app/main/initiative/_list_element.lua Sat Mar 09 20:48:01 2013 +0100 @@ -15,8 +15,8 @@ ui.container{ attr = { class = class }, content = function() ui.container{ attr = { class = "rank" }, content = function() - if initiative.issue.accepted and initiative.issue.closed - and initiative.issue.ranks_available or initiative.admitted == false + if initiative.issue.fully_frozen and initiative.issue.closed + or initiative.admitted == false then ui.field.rank{ attr = { class = "rank" }, value = initiative.rank, eligible = initiative.eligible } elseif not initiative.issue.closed then @@ -28,23 +28,19 @@ ui.container{ attr = { class = "bar" }, content = function() if initiative.issue.fully_frozen and initiative.issue.closed then - if initiative.issue.ranks_available then - if initiative.negative_votes and initiative.positive_votes then - local max_value = initiative.issue.voter_count - ui.bargraph{ - max_value = max_value, - width = 100, - bars = { - { color = "#0a5", value = initiative.positive_votes }, - { color = "#aaa", value = max_value - initiative.negative_votes - initiative.positive_votes }, - { color = "#a00", value = initiative.negative_votes }, - } + if initiative.negative_votes and initiative.positive_votes then + local max_value = initiative.issue.voter_count + ui.bargraph{ + max_value = max_value, + width = 100, + bars = { + { color = "#0a5", value = initiative.positive_votes }, + { color = "#aaa", value = max_value - initiative.negative_votes - initiative.positive_votes }, + { color = "#a00", value = initiative.negative_votes }, } - else - slot.put(" ") - end + } else - slot.put(_"Counting of votes") + slot.put(" ") end else local max_value = initiative.issue.population or 0 diff -r 5d2a337a33e4 -r c7215c18168b app/main/initiative/_show.lua --- a/app/main/initiative/_show.lua Sat Mar 09 20:47:26 2013 +0100 +++ b/app/main/initiative/_show.lua Sat Mar 09 20:48:01 2013 +0100 @@ -193,7 +193,7 @@ -- voting results - if initiative.issue.ranks_available and initiative.admitted then + if initiative.issue.fully_frozen and initiative.issue.closed and initiative.admitted then local class = initiative.winner and "admitted_info" or "not_admitted_info" ui.container{ attr = { class = class }, @@ -428,7 +428,7 @@ if app.session:has_access("all_pseudonymous") then - if initiative.issue.ranks_available then + if initiative.issue.fully_frozen and initiative.issue.closed then local members_selector = initiative.issue:get_reference_selector("direct_voters") :left_join("vote", nil, { "vote.initiative_id = ? AND vote.member_id = member.id", initiative.id }) :add_field("direct_voter.weight as voter_weight")