liquid_feedback_frontend

diff app/main/initiative/_details.lua @ 718:cc64a4fc6ab6

Cleaned up initiative page
author bsw
date Wed Jun 27 14:37:46 2012 +0200 (2012-06-27)
parents aec9df5b4cd3
children 319161d5a904
line diff
     1.1 --- a/app/main/initiative/_details.lua	Wed Jun 27 12:35:34 2012 +0200
     1.2 +++ b/app/main/initiative/_details.lua	Wed Jun 27 14:37:46 2012 +0200
     1.3 @@ -1,12 +1,30 @@
     1.4  local initiative = param.get("initiative", "table")
     1.5  
     1.6 -ui.container{ content = _"Initiative details" }
     1.7 -
     1.8  ui.form{
     1.9    attr = { class = "vertical" },
    1.10    record = initiative,
    1.11    readonly = true,
    1.12    content = function()
    1.13 +    if initiative.issue.closed then
    1.14 +      ui.field.boolean{ label = _"Direct majority", value = initiative.direct_majority }
    1.15 +      ui.field.boolean{ label = _"Indirect majority", value = initiative.indirect_majority }
    1.16 +      ui.field.text{ label = _"Schulze rank", value = tostring(initiative.schulze_rank) .. " (" .. _("Status quo: #{rank}", { rank = initiative.issue.status_quo_schulze_rank }) .. ")" }
    1.17 +      local texts = {}
    1.18 +      if initiative.reverse_beat_path then
    1.19 +        texts[#texts+1] = _"reverse beat path to status quo (including ties)"
    1.20 +      end
    1.21 +      if initiative.multistage_majority then
    1.22 +        texts[#texts+1] = _"possibly instable result caused by multistage majority"
    1.23 +      end
    1.24 +      if #texts == 0 then
    1.25 +      texts[#texts+1] = _"none"
    1.26 +      end
    1.27 +      ui.field.text{
    1.28 +        label = _"Other failures",
    1.29 +        value = table.concat(texts, ", ")
    1.30 +      }
    1.31 +      ui.field.boolean{ label = _"Eligible as winner", value = initiative.eligible }
    1.32 +    end
    1.33      ui.field.text{
    1.34        label = _"Created at",
    1.35        value = tostring(initiative.created)
    1.36 @@ -17,10 +35,10 @@
    1.37           value = format.timestamp(initiative.revoked)
    1.38         }
    1.39      end
    1.40 -    ui.field.boolean{ label = _"Admitted", name = "admitted" }
    1.41 +    if initiative.admitted ~= nil then
    1.42 +      ui.field.boolean{ label = _"Admitted", name = "admitted" }
    1.43 +    end
    1.44    end
    1.45  }
    1.46  
    1.47 -ui.container{ content = _"Issue details" }
    1.48 -
    1.49  execute.view{ module = "issue", view = "_details", params = { issue = initiative.issue } }
    1.50 \ No newline at end of file

Impressum / About Us