liquid_feedback_frontend
annotate app/main/initiative/_details.lua @ 161:ff6162022615
add more suggestion api fields
fixes bug #325
fixes bug #325
| author | Daniel Poelzleithner <poelzi@poelzi.org> |
|---|---|
| date | Sat Oct 09 14:29:19 2010 +0200 (2010-10-09) |
| parents | 5d797c6706d5 |
| children | db91c2005278 |
| 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() |
| poelzi@159 | 8 local policy = initiative.issue.policy |
| bsw/jbe@19 | 9 ui.field.text{ label = _"Issue policy", value = initiative.issue.policy.name } |
| bsw/jbe@19 | 10 ui.field.text{ |
| bsw/jbe@19 | 11 label = _"Created at", |
| bsw/jbe@19 | 12 value = tostring(initiative.created) |
| bsw/jbe@19 | 13 } |
| poelzi@159 | 14 if initiative.revoked then |
| poelzi@159 | 15 ui.field.text{ |
| poelzi@159 | 16 label = _"Revoked at", |
| poelzi@159 | 17 value = format.timestamp(initiative.revoked) |
| poelzi@159 | 18 } |
| poelzi@159 | 19 end |
| bsw/jbe@19 | 20 ui.field.text{ |
| poelzi@159 | 21 label = _"Initiative quorum", |
| poelzi@159 | 22 value = format.percentage(policy.initiative_quorum_num / policy.initiative_quorum_den) |
| poelzi@159 | 23 } |
| poelzi@159 | 24 ui.field.text{ |
| poelzi@159 | 25 label = _"Currently required", |
| poelzi@159 | 26 value = math.ceil(initiative.issue.population * (policy.initiative_quorum_num / policy.initiative_quorum_den)), |
| bsw/jbe@19 | 27 } |
| bsw/jbe@19 | 28 -- ui.field.date{ label = _"Revoked at", name = "revoked" } |
| bsw/jbe@19 | 29 ui.field.boolean{ label = _"Admitted", name = "admitted" } |
| bsw/jbe@19 | 30 end |
| bsw/jbe@19 | 31 } |