liquid_feedback_frontend

diff app/main/report/initiative.lua @ 31:a6caaff47205

Report view for all closed issues added
author bsw
date Tue Feb 23 21:09:10 2010 +0100 (2010-02-23)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/app/main/report/initiative.lua	Tue Feb 23 21:09:10 2010 +0100
     1.3 @@ -0,0 +1,86 @@
     1.4 +local initiative = param.get("initiative", "table")
     1.5 +
     1.6 +link_area(initiative.issue.area)
     1.7 +
     1.8 +link_issue(initiative.issue)
     1.9 +
    1.10 +ui.link{
    1.11 +  external = "",
    1.12 +  attr = {
    1.13 +    style = "display: block; text-decoration: none;",
    1.14 +    name = "initiative_" .. tostring(initiative.id),
    1.15 +  },
    1.16 +  content = function()
    1.17 +    ui.heading{
    1.18 +      content = _("##{issue_id}.#{id} #{name}", { issue_id = initiative.issue.id, id = initiative.id, name = initiative.shortened_name })
    1.19 +    }
    1.20 +  end
    1.21 +}
    1.22 +
    1.23 +slot.put("<br />")
    1.24 +
    1.25 +if initiative.issue.ranks_available and initiative.admitted then
    1.26 +  local class = initiative.rank == 1 and "admitted_info" or "not_admitted_info"
    1.27 +  ui.container{
    1.28 +    attr = { class = class },
    1.29 +    content = function()
    1.30 +      local max_value = initiative.issue.voter_count
    1.31 +      slot.put("&nbsp;")
    1.32 +      local positive_votes = initiative.positive_votes
    1.33 +      local negative_votes = initiative.negative_votes
    1.34 +      slot.put(_"Yes" .. ": <b>" .. tostring(positive_votes) .. "</b>")
    1.35 +      slot.put(" &middot; ")
    1.36 +      slot.put(_"Abstention" .. ": <b>" .. tostring(max_value - initiative.negative_votes - initiative.positive_votes)  .. "</b>")
    1.37 +      slot.put(" &middot; ")
    1.38 +      slot.put(_"No" .. ": <b>" .. tostring(initiative.negative_votes) .. "</b>")
    1.39 +      slot.put(" &middot; ")
    1.40 +      slot.put("<b>")
    1.41 +      if initiative.rank == 1 then
    1.42 +        slot.put(_"Approved")
    1.43 +      elseif initiative.rank then
    1.44 +        slot.put(_("Not approved (rank #{rank})", { rank = initiative.rank }))
    1.45 +      else
    1.46 +        slot.put(_"Not approved")
    1.47 +      end
    1.48 +      slot.put("</b>")
    1.49 +    end
    1.50 +  }
    1.51 +end
    1.52 +
    1.53 +if initiative.issue.state == "cancelled" then
    1.54 +  local policy = initiative.issue.policy
    1.55 +  ui.container{
    1.56 +    attr = { class = "not_admitted_info" },
    1.57 +    content = _("This issue has been cancelled. It failed the quorum of #{quorum}.", { quorum = format.percentage(policy.issue_quorum_num / policy.issue_quorum_den) })
    1.58 +  }
    1.59 +elseif initiative.admitted == false then
    1.60 +  local policy = initiative.issue.policy
    1.61 +  ui.container{
    1.62 +    attr = { class = "not_admitted_info" },
    1.63 +    content = _("This initiative has not been admitted! It failed the quorum of #{quorum}.", { quorum = format.percentage(policy.initiative_quorum_num / policy.initiative_quorum_den) })
    1.64 +  }
    1.65 +end
    1.66 +
    1.67 +if initiative.revoked then
    1.68 +  ui.container{
    1.69 +    attr = { class = "revoked_info" },
    1.70 +    content = function()
    1.71 +      slot.put(_("This initiative has been revoked at #{revoked}", { revoked = format.timestamp(initiative.revoked) }))
    1.72 +    end
    1.73 +  }
    1.74 +end
    1.75 +
    1.76 +
    1.77 +ui.container{
    1.78 +  attr = { class = "draft_content wiki" },
    1.79 +  content = function()
    1.80 +    slot.put(format.wiki_text(initiative.current_draft.content, initiative.current_draft.formatting_engine))
    1.81 +  end
    1.82 +}
    1.83 +
    1.84 +execute.view{
    1.85 +  module = "initiative",
    1.86 +  view = "_battles",
    1.87 +  params = { initiative = initiative }
    1.88 +}
    1.89 +

Impressum / About Us