annotate app/main/initiative/_details.lua @ 831:e3c2007828a1
Support for inactive units added to unit model
 | author | 
 bsw | 
 | date | 
 Tue Jul 10 23:40:29 2012 +0200 (2012-07-10) | 
 | parents | 
 cc64a4fc6ab6  | 
 | children | 
 319161d5a904  | 
 
 | rev | 
   line source | 
| 
bsw/jbe@19
 | 
     1 local initiative = param.get("initiative", "table")
 | 
| 
bsw/jbe@19
 | 
     2 
 | 
| 
bsw/jbe@19
 | 
     3 ui.form{
 | 
| 
bsw/jbe@19
 | 
     4   attr = { class = "vertical" },
 | 
| 
bsw/jbe@19
 | 
     5   record = initiative,
 | 
| 
bsw/jbe@19
 | 
     6   readonly = true,
 | 
| 
bsw/jbe@19
 | 
     7   content = function()
 | 
| 
bsw@718
 | 
     8     if initiative.issue.closed then
 | 
| 
bsw@718
 | 
     9       ui.field.boolean{ label = _"Direct majority", value = initiative.direct_majority }
 | 
| 
bsw@718
 | 
    10       ui.field.boolean{ label = _"Indirect majority", value = initiative.indirect_majority }
 | 
| 
bsw@718
 | 
    11       ui.field.text{ label = _"Schulze rank", value = tostring(initiative.schulze_rank) .. " (" .. _("Status quo: #{rank}", { rank = initiative.issue.status_quo_schulze_rank }) .. ")" }
 | 
| 
bsw@718
 | 
    12       local texts = {}
 | 
| 
bsw@718
 | 
    13       if initiative.reverse_beat_path then
 | 
| 
bsw@718
 | 
    14         texts[#texts+1] = _"reverse beat path to status quo (including ties)"
 | 
| 
bsw@718
 | 
    15       end
 | 
| 
bsw@718
 | 
    16       if initiative.multistage_majority then
 | 
| 
bsw@718
 | 
    17         texts[#texts+1] = _"possibly instable result caused by multistage majority"
 | 
| 
bsw@718
 | 
    18       end
 | 
| 
bsw@718
 | 
    19       if #texts == 0 then
 | 
| 
bsw@718
 | 
    20       texts[#texts+1] = _"none"
 | 
| 
bsw@718
 | 
    21       end
 | 
| 
bsw@718
 | 
    22       ui.field.text{
 | 
| 
bsw@718
 | 
    23         label = _"Other failures",
 | 
| 
bsw@718
 | 
    24         value = table.concat(texts, ", ")
 | 
| 
bsw@718
 | 
    25       }
 | 
| 
bsw@718
 | 
    26       ui.field.boolean{ label = _"Eligible as winner", value = initiative.eligible }
 | 
| 
bsw@718
 | 
    27     end
 | 
| 
bsw/jbe@19
 | 
    28     ui.field.text{
 | 
| 
bsw/jbe@19
 | 
    29       label = _"Created at",
 | 
| 
bsw/jbe@19
 | 
    30       value = tostring(initiative.created)
 | 
| 
bsw/jbe@19
 | 
    31     }
 | 
| 
poelzi@159
 | 
    32     if initiative.revoked then
 | 
| 
poelzi@159
 | 
    33       ui.field.text{
 | 
| 
poelzi@159
 | 
    34          label = _"Revoked at",
 | 
| 
poelzi@159
 | 
    35          value = format.timestamp(initiative.revoked)
 | 
| 
poelzi@159
 | 
    36        }
 | 
| 
poelzi@159
 | 
    37     end
 | 
| 
bsw@718
 | 
    38     if initiative.admitted ~= nil then
 | 
| 
bsw@718
 | 
    39       ui.field.boolean{ label = _"Admitted", name = "admitted" }
 | 
| 
bsw@718
 | 
    40     end
 | 
| 
bsw/jbe@19
 | 
    41   end
 | 
| 
bsw/jbe@19
 | 
    42 }
 | 
| 
bsw@274
 | 
    43 
 | 
| 
bsw@274
 | 
    44 execute.view{ module = "issue", view = "_details", params = { issue = initiative.issue } } |