liquid_feedback_frontend

changeset 255:428c545ae819

Fixed error when issue population is not calculated already.
author bsw
date Mon Jan 09 21:23:18 2012 +0100 (2012-01-09)
parents 7b5b2449d2d5
children d28594eb0d42
files app/main/issue/_details.lua
line diff
     1.1 --- a/app/main/issue/_details.lua	Mon Jan 09 20:03:48 2012 +0100
     1.2 +++ b/app/main/issue/_details.lua	Mon Jan 09 21:23:18 2012 +0100
     1.3 @@ -14,10 +14,12 @@
     1.4        label = _"Issue quorum",
     1.5        value = format.percentage(policy.issue_quorum_num / policy.issue_quorum_den)
     1.6      }
     1.7 -    ui.field.text{
     1.8 -      label = _"Currently required",
     1.9 -      value = math.ceil(issue.population * policy.issue_quorum_num / policy.issue_quorum_den)
    1.10 -    }
    1.11 +    if issue.population then
    1.12 +      ui.field.text{
    1.13 +        label = _"Currently required",
    1.14 +        value = math.ceil(issue.population * policy.issue_quorum_num / policy.issue_quorum_den)
    1.15 +      }
    1.16 +    end
    1.17      ui.field.timestamp{  label = _"Accepted at",           name = "accepted" }
    1.18      ui.field.text{       label = _"Discussion time",       value = issue.discussion_time }
    1.19      ui.field.vote_now{   label = _"Vote now",              name = "vote_now" }
    1.20 @@ -28,10 +30,12 @@
    1.21        label   = _"Initiative quorum",
    1.22        value = format.percentage(policy.initiative_quorum_num / policy.initiative_quorum_den)
    1.23      }
    1.24 -    ui.field.text{
    1.25 -      label   = _"Currently required",
    1.26 -      value = math.ceil(issue.population * (issue.policy.initiative_quorum_num / issue.policy.initiative_quorum_den)),
    1.27 -    }
    1.28 +    if issue.population then
    1.29 +      ui.field.text{
    1.30 +        label   = _"Currently required",
    1.31 +        value = math.ceil(issue.population * (issue.policy.initiative_quorum_num / issue.policy.initiative_quorum_den)),
    1.32 +      }
    1.33 +    end
    1.34      ui.field.timestamp{  label = _"Fully frozen at",       name = "fully_frozen" }
    1.35      ui.field.text{       label = _"Voting time",           value = issue.voting_time }
    1.36      ui.field.timestamp{  label = _"Closed",                name = "closed" }

Impressum / About Us