liquid_feedback_frontend
view app/main/initiative/_details.lua @ 194:c0292c3a70d8
Added policy editor to admin area
| author | bsw | 
|---|---|
| date | Mon Nov 08 15:05:15 2010 +0100 (2010-11-08) | 
| parents | db91c2005278 | 
| children | aec9df5b4cd3 | 
 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     local policy = initiative.issue.policy
     9     ui.field.text{ label = _"Issue policy", value = initiative.issue.policy.name }
    10     ui.field.text{
    11       label = _"Created at",
    12       value = tostring(initiative.created)
    13     }
    14     if initiative.revoked then
    15       ui.field.text{
    16          label = _"Revoked at",
    17          value = format.timestamp(initiative.revoked)
    18        }
    19     end
    20     ui.field.text{
    21       label   = _"Initiative quorum",
    22       value = format.percentage(policy.initiative_quorum_num / policy.initiative_quorum_den)
    23     }
    24     if initiative.issue.population then
    25       ui.field.text{
    26         label   = _"Currently required",
    27         value = math.ceil(initiative.issue.population * (policy.initiative_quorum_num / policy.initiative_quorum_den)),
    28       }
    29     end
    30   -- ui.field.date{ label = _"Revoked at", name = "revoked" }
    31     ui.field.boolean{ label = _"Admitted", name = "admitted" }
    32   end
    33 }
