liquid_feedback_frontend

annotate app/main/report/initiative.lua @ 124:f740026b1518

add initiator support in delegation

if a delegation is issued from the initiative view, the initiators
from that one are added to the delegation target list. this makes it easier to delegate to the author without the need to add him to the contact list.
author Daniel Poelzleithner <poelzi@poelzi.org>
date Mon Sep 20 20:32:04 2010 +0200 (2010-09-20)
parents a6caaff47205
children
rev   line source
bsw@31 1 local initiative = param.get("initiative", "table")
bsw@31 2
bsw@31 3 link_area(initiative.issue.area)
bsw@31 4
bsw@31 5 link_issue(initiative.issue)
bsw@31 6
bsw@31 7 ui.link{
bsw@31 8 external = "",
bsw@31 9 attr = {
bsw@31 10 style = "display: block; text-decoration: none;",
bsw@31 11 name = "initiative_" .. tostring(initiative.id),
bsw@31 12 },
bsw@31 13 content = function()
bsw@31 14 ui.heading{
bsw@31 15 content = _("##{issue_id}.#{id} #{name}", { issue_id = initiative.issue.id, id = initiative.id, name = initiative.shortened_name })
bsw@31 16 }
bsw@31 17 end
bsw@31 18 }
bsw@31 19
bsw@31 20 slot.put("<br />")
bsw@31 21
bsw@31 22 if initiative.issue.ranks_available and initiative.admitted then
bsw@31 23 local class = initiative.rank == 1 and "admitted_info" or "not_admitted_info"
bsw@31 24 ui.container{
bsw@31 25 attr = { class = class },
bsw@31 26 content = function()
bsw@31 27 local max_value = initiative.issue.voter_count
bsw@31 28 slot.put("&nbsp;")
bsw@31 29 local positive_votes = initiative.positive_votes
bsw@31 30 local negative_votes = initiative.negative_votes
bsw@31 31 slot.put(_"Yes" .. ": <b>" .. tostring(positive_votes) .. "</b>")
bsw@31 32 slot.put(" &middot; ")
bsw@31 33 slot.put(_"Abstention" .. ": <b>" .. tostring(max_value - initiative.negative_votes - initiative.positive_votes) .. "</b>")
bsw@31 34 slot.put(" &middot; ")
bsw@31 35 slot.put(_"No" .. ": <b>" .. tostring(initiative.negative_votes) .. "</b>")
bsw@31 36 slot.put(" &middot; ")
bsw@31 37 slot.put("<b>")
bsw@31 38 if initiative.rank == 1 then
bsw@31 39 slot.put(_"Approved")
bsw@31 40 elseif initiative.rank then
bsw@31 41 slot.put(_("Not approved (rank #{rank})", { rank = initiative.rank }))
bsw@31 42 else
bsw@31 43 slot.put(_"Not approved")
bsw@31 44 end
bsw@31 45 slot.put("</b>")
bsw@31 46 end
bsw@31 47 }
bsw@31 48 end
bsw@31 49
bsw@31 50 if initiative.issue.state == "cancelled" then
bsw@31 51 local policy = initiative.issue.policy
bsw@31 52 ui.container{
bsw@31 53 attr = { class = "not_admitted_info" },
bsw@31 54 content = _("This issue has been cancelled. It failed the quorum of #{quorum}.", { quorum = format.percentage(policy.issue_quorum_num / policy.issue_quorum_den) })
bsw@31 55 }
bsw@31 56 elseif initiative.admitted == false then
bsw@31 57 local policy = initiative.issue.policy
bsw@31 58 ui.container{
bsw@31 59 attr = { class = "not_admitted_info" },
bsw@31 60 content = _("This initiative has not been admitted! It failed the quorum of #{quorum}.", { quorum = format.percentage(policy.initiative_quorum_num / policy.initiative_quorum_den) })
bsw@31 61 }
bsw@31 62 end
bsw@31 63
bsw@31 64 if initiative.revoked then
bsw@31 65 ui.container{
bsw@31 66 attr = { class = "revoked_info" },
bsw@31 67 content = function()
bsw@31 68 slot.put(_("This initiative has been revoked at #{revoked}", { revoked = format.timestamp(initiative.revoked) }))
bsw@31 69 end
bsw@31 70 }
bsw@31 71 end
bsw@31 72
bsw@31 73
bsw@31 74 ui.container{
bsw@31 75 attr = { class = "draft_content wiki" },
bsw@31 76 content = function()
bsw@31 77 slot.put(format.wiki_text(initiative.current_draft.content, initiative.current_draft.formatting_engine))
bsw@31 78 end
bsw@31 79 }
bsw@31 80
bsw@31 81 execute.view{
bsw@31 82 module = "initiative",
bsw@31 83 view = "_battles",
bsw@31 84 params = { initiative = initiative }
bsw@31 85 }
bsw@31 86

Impressum / About Us