liquid_feedback_frontend
view app/main/report/initiative.lua @ 75:733f65c0c0a0
Bugfixes, feature enhancements, code-cleanup, and major work on API
Details:
- API
-- Allow relation name to be passed to helper function util.autoapi{...}
-- Added area API
-- Bugfixes in API
--- Correctly return initiatives (bug #162)
--- Correctly process "id" parameter for initiative API
--- Bugfix related to "state" parameter (bug #165)
--- Changed constant "discussion" to "accepted" (in model/issue.lua, used by API)
--- Fixed JSON encoding in auto_api (bug #181)
--- Ignore list filter "voted" in case of public access
--- Enable access to API without session
- Work on RSS feed (incomplete yet)
- Other bugfixes
-- Handle empty browser identification string
-- Handle invalid date in member/update.lua (bugs #24 #109 #115 #136)
-- Better handle errors while converting uploaded images. (bug #79 +5 duplicates)
-- Don't display revoked initiatives in list of new drafts (bug #134)
-- Fixed syntax error in app/main/member/_action/update_name.lua throwing unexpected error, when new name was too short
-- Do not display refresh support button for revoked initiatives
-- Repaired issue search (bug #150)
-- Fixed typos in german translation files
--- "initi(i)erte"
--- "Er(g)eignisse" (bug #161)
- Code cleanup
-- Removed deprecated motd files locale/motd/de.txt and locale/motd/de_public.txt
-- Removed redundant code in app/main/index/_updated_drafts.lua
- New features and (optical) enhancements
-- Support change of notify email; notification of not approved address added to start page
-- Settings dialog splitted into single pages
-- Mark deactivated members
-- Calendar for birthday selection in profile
-- Policy list public readable when public access is enabled
Details:
- API
-- Allow relation name to be passed to helper function util.autoapi{...}
-- Added area API
-- Bugfixes in API
--- Correctly return initiatives (bug #162)
--- Correctly process "id" parameter for initiative API
--- Bugfix related to "state" parameter (bug #165)
--- Changed constant "discussion" to "accepted" (in model/issue.lua, used by API)
--- Fixed JSON encoding in auto_api (bug #181)
--- Ignore list filter "voted" in case of public access
--- Enable access to API without session
- Work on RSS feed (incomplete yet)
- Other bugfixes
-- Handle empty browser identification string
-- Handle invalid date in member/update.lua (bugs #24 #109 #115 #136)
-- Better handle errors while converting uploaded images. (bug #79 +5 duplicates)
-- Don't display revoked initiatives in list of new drafts (bug #134)
-- Fixed syntax error in app/main/member/_action/update_name.lua throwing unexpected error, when new name was too short
-- Do not display refresh support button for revoked initiatives
-- Repaired issue search (bug #150)
-- Fixed typos in german translation files
--- "initi(i)erte"
--- "Er(g)eignisse" (bug #161)
- Code cleanup
-- Removed deprecated motd files locale/motd/de.txt and locale/motd/de_public.txt
-- Removed redundant code in app/main/index/_updated_drafts.lua
- New features and (optical) enhancements
-- Support change of notify email; notification of not approved address added to start page
-- Settings dialog splitted into single pages
-- Mark deactivated members
-- Calendar for birthday selection in profile
-- Policy list public readable when public access is enabled
author | bsw |
---|---|
date | Thu Jul 08 18:44:02 2010 +0200 (2010-07-08) |
parents | a6caaff47205 |
children |
line source
1 local initiative = param.get("initiative", "table")
3 link_area(initiative.issue.area)
5 link_issue(initiative.issue)
7 ui.link{
8 external = "",
9 attr = {
10 style = "display: block; text-decoration: none;",
11 name = "initiative_" .. tostring(initiative.id),
12 },
13 content = function()
14 ui.heading{
15 content = _("##{issue_id}.#{id} #{name}", { issue_id = initiative.issue.id, id = initiative.id, name = initiative.shortened_name })
16 }
17 end
18 }
20 slot.put("<br />")
22 if initiative.issue.ranks_available and initiative.admitted then
23 local class = initiative.rank == 1 and "admitted_info" or "not_admitted_info"
24 ui.container{
25 attr = { class = class },
26 content = function()
27 local max_value = initiative.issue.voter_count
28 slot.put(" ")
29 local positive_votes = initiative.positive_votes
30 local negative_votes = initiative.negative_votes
31 slot.put(_"Yes" .. ": <b>" .. tostring(positive_votes) .. "</b>")
32 slot.put(" · ")
33 slot.put(_"Abstention" .. ": <b>" .. tostring(max_value - initiative.negative_votes - initiative.positive_votes) .. "</b>")
34 slot.put(" · ")
35 slot.put(_"No" .. ": <b>" .. tostring(initiative.negative_votes) .. "</b>")
36 slot.put(" · ")
37 slot.put("<b>")
38 if initiative.rank == 1 then
39 slot.put(_"Approved")
40 elseif initiative.rank then
41 slot.put(_("Not approved (rank #{rank})", { rank = initiative.rank }))
42 else
43 slot.put(_"Not approved")
44 end
45 slot.put("</b>")
46 end
47 }
48 end
50 if initiative.issue.state == "cancelled" then
51 local policy = initiative.issue.policy
52 ui.container{
53 attr = { class = "not_admitted_info" },
54 content = _("This issue has been cancelled. It failed the quorum of #{quorum}.", { quorum = format.percentage(policy.issue_quorum_num / policy.issue_quorum_den) })
55 }
56 elseif initiative.admitted == false then
57 local policy = initiative.issue.policy
58 ui.container{
59 attr = { class = "not_admitted_info" },
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) })
61 }
62 end
64 if initiative.revoked then
65 ui.container{
66 attr = { class = "revoked_info" },
67 content = function()
68 slot.put(_("This initiative has been revoked at #{revoked}", { revoked = format.timestamp(initiative.revoked) }))
69 end
70 }
71 end
74 ui.container{
75 attr = { class = "draft_content wiki" },
76 content = function()
77 slot.put(format.wiki_text(initiative.current_draft.content, initiative.current_draft.formatting_engine))
78 end
79 }
81 execute.view{
82 module = "initiative",
83 view = "_battles",
84 params = { initiative = initiative }
85 }