liquid_feedback_frontend

diff app/main/policy/show.lua @ 900:832c8d0f3c7e

Handle policies without issue quorum in policy views correctly
author bsw
date Tue Aug 21 00:33:17 2012 +0200 (2012-08-21)
parents c587d8762e62
children eb16d41929bd
line diff
     1.1 --- a/app/main/policy/show.lua	Tue Aug 21 00:25:57 2012 +0200
     1.2 +++ b/app/main/policy/show.lua	Tue Aug 21 00:33:17 2012 +0200
     1.3 @@ -6,17 +6,23 @@
     1.4    attr = { class = "vertical" },
     1.5    record = policy,
     1.6    content = function()
     1.7 -    ui.field.text{ label = _"Name", value = policy.name }
     1.8 -
     1.9 -    ui.field.text{ label = _"New", value = "≤ " .. policy.admission_time }
    1.10 +    if policy.polling then
    1.11 +      ui.field.text{ label = _"New" .. ":", value = _"without" }
    1.12 +    else
    1.13 +      ui.field.text{ label = _"New" .. ":", value = "≤ " .. policy.admission_time }
    1.14 +    end
    1.15      ui.field.text{ label = _"Discussion", value = policy.discussion_time }
    1.16      ui.field.text{ label = _"Frozen", value = policy.verification_time }
    1.17      ui.field.text{ label = _"Voting", value = policy.voting_time }
    1.18  
    1.19 -    ui.field.text{
    1.20 -      label = _"Issue quorum",
    1.21 -      value = "≥ " .. tostring(policy.issue_quorum_num) .. "/" .. tostring(policy.issue_quorum_den)
    1.22 -    }
    1.23 +    if policy.polling then
    1.24 +      ui.field.text{ label = _"Issue quorum" .. ":", value = _"without" }
    1.25 +    else
    1.26 +      ui.field.text{
    1.27 +        label = _"Issue quorum",
    1.28 +        value = "≥ " .. tostring(policy.issue_quorum_num) .. "/" .. tostring(policy.issue_quorum_den)
    1.29 +      }
    1.30 +    end
    1.31      ui.field.text{
    1.32        label = _"Initiative quorum",
    1.33        value = "≥ " .. tostring(policy.initiative_quorum_num) .. "/" .. tostring(policy.initiative_quorum_den)
    1.34 @@ -52,15 +58,17 @@
    1.35        label = _"Options",
    1.36        value = table.concat(texts, ", ")
    1.37      }
    1.38 -    ui.container{
    1.39 -      attr = { class = "suggestion_content wiki" },
    1.40 -      content = function()
    1.41 -        ui.tag{
    1.42 -          tag = "p",
    1.43 -          content = policy.description
    1.44 -        }
    1.45 -      end
    1.46 -    }
    1.47 +    if policy.description and #policy.description > 0 then
    1.48 +      ui.container{
    1.49 +        attr = { class = "suggestion_content wiki" },
    1.50 +        content = function()
    1.51 +          ui.tag{
    1.52 +            tag = "p",
    1.53 +            content = policy.description
    1.54 +          }
    1.55 +        end
    1.56 +      }
    1.57 +    end
    1.58  
    1.59    end
    1.60  }

Impressum / About Us