liquid_feedback_frontend
view app/main/initiative/_details.lua @ 1091:20680a81c3e1
Fixed view for creating new initiatives in polling mode
| author | bsw | 
|---|---|
| date | Fri Oct 17 11:30:09 2014 +0200 (2014-10-17) | 
| parents | c4e4be01285c | 
| children | 
 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     ui.field.text{
     9       label = _"Created at",
    10       value = format.timestamp(initiative.created)
    11     }
    12     if initiative.revoked then
    13       ui.field.text{
    14          label = _"Revoked at",
    15          value = format.timestamp(initiative.revoked)
    16        }
    17     end
    18     if initiative.admitted ~= nil then
    19       ui.field.boolean{ label = _"Admitted", name = "admitted" }
    20     end
    21     if initiative.issue.fully_frozen and initiative.polling then
    22       ui.field.text{ label = _"Admitted", value = "Implicitly admitted" }
    23     end
    24     if initiative.issue.closed then
    25       ui.field.boolean{ label = _"Direct majority", value = initiative.direct_majority }
    26       ui.field.boolean{ label = _"Indirect majority", value = initiative.indirect_majority }
    27       ui.field.text{ label = _"Schulze rank", value = tostring(initiative.schulze_rank) .. " (" .. _("Status quo: #{rank}", { rank = initiative.issue.status_quo_schulze_rank }) .. ")" }
    28       local texts = {}
    29       if initiative.reverse_beat_path then
    30         texts[#texts+1] = _"reverse beat path to status quo (including ties)"
    31       end
    32       if initiative.multistage_majority then
    33         texts[#texts+1] = _"possibly instable result caused by multistage majority"
    34       end
    35       if #texts == 0 then
    36       texts[#texts+1] = _"none"
    37       end
    38       ui.field.text{
    39         label = _"Other failures",
    40         value = table.concat(texts, ", ")
    41       }
    42       ui.field.boolean{ label = _"Eligible as winner", value = initiative.eligible }
    43     end
    44   end
    45 }
    47 execute.view{ module = "issue", view = "_details", params = { issue = initiative.issue } }
