liquid_feedback_frontend
view 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 source
     1 local initiative = param.get("initiative", "table")
     3 ui.form{
     4   attr = { class = "vertical" },
     5   record = initiative,
     6   readonly = true,
     7   content = function()
     8     if initiative.issue.closed then
     9       ui.field.boolean{ label = _"Direct majority", value = initiative.direct_majority }
    10       ui.field.boolean{ label = _"Indirect majority", value = initiative.indirect_majority }
    11       ui.field.text{ label = _"Schulze rank", value = tostring(initiative.schulze_rank) .. " (" .. _("Status quo: #{rank}", { rank = initiative.issue.status_quo_schulze_rank }) .. ")" }
    12       local texts = {}
    13       if initiative.reverse_beat_path then
    14         texts[#texts+1] = _"reverse beat path to status quo (including ties)"
    15       end
    16       if initiative.multistage_majority then
    17         texts[#texts+1] = _"possibly instable result caused by multistage majority"
    18       end
    19       if #texts == 0 then
    20       texts[#texts+1] = _"none"
    21       end
    22       ui.field.text{
    23         label = _"Other failures",
    24         value = table.concat(texts, ", ")
    25       }
    26       ui.field.boolean{ label = _"Eligible as winner", value = initiative.eligible }
    27     end
    28     ui.field.text{
    29       label = _"Created at",
    30       value = tostring(initiative.created)
    31     }
    32     if initiative.revoked then
    33       ui.field.text{
    34          label = _"Revoked at",
    35          value = format.timestamp(initiative.revoked)
    36        }
    37     end
    38     if initiative.admitted ~= nil then
    39       ui.field.boolean{ label = _"Admitted", name = "admitted" }
    40     end
    41   end
    42 }
    44 execute.view{ module = "issue", view = "_details", params = { issue = initiative.issue } }
