liquid_feedback_frontend

view app/main/issue/show_tab.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
author bsw
date Thu Jul 08 18:44:02 2010 +0200 (2010-07-08)
parents 0849be391140
children 2dc13655afca
line source
1 local issue
2 if request.get_json_request_slots() then
3 issue = Issue:by_id(param.get("issue_id"))
4 else
5 issue = param.get("issue", "table")
6 end
8 local voting_requested_percentage = 0
9 if issue.vote_later and issue.population and issue.population > 0 then
10 voting_requested_percentage = math.ceil(issue.vote_later / issue.population * 100)
11 end
13 local interested_members_selector = issue:get_reference_selector("interested_members_snapshot")
14 :join("issue", nil, "issue.id = direct_interest_snapshot.issue_id")
15 :add_field("direct_interest_snapshot.weight")
16 :add_where("direct_interest_snapshot.event = issue.latest_snapshot_event")
18 local voting_requests_selector = issue:get_reference_selector("interested_members_snapshot")
19 :join("issue", nil, "issue.id = direct_interest_snapshot.issue_id")
20 :add_where("direct_interest_snapshot.voting_requested = false")
21 :add_where("direct_interest_snapshot.event = issue.latest_snapshot_event")
23 local delegations_selector = issue:get_reference_selector("delegations")
25 local tabs = {
26 module = "issue",
27 view = "show_tab",
28 static_params = { issue_id = issue.id },
29 }
31 if app.session.member_id then
32 tabs[#tabs+1] =
33 {
34 name = "interested_members",
35 label = _"Interested members" .. " (" .. tostring(interested_members_selector:count()) .. ")" ,
36 icon = { static = "icons/16/eye.png" },
37 module = "member",
38 view = "_list",
39 params = {
40 issue = issue,
41 members_selector = interested_members_selector
42 }
43 }
45 tabs[#tabs+1] =
46 {
47 name = "voting_requests",
48 label = _"Vote later requests" .. " (" .. tostring(voting_requests_selector:count()) .. ") (" .. tostring(voting_requested_percentage) .. "%)",
49 icon = { static = "icons/16/clock_play.png" },
50 module = "member",
51 view = "_list",
52 params = {
53 issue = issue,
54 members_selector = voting_requests_selector
55 }
56 }
58 tabs[#tabs+1] =
59 {
60 name = "delegations",
61 label = _"Delegations" .. " (" .. tostring(delegations_selector:count()) .. ")" ,
62 icon = { static = "icons/16/table_go.png" },
63 module = "delegation",
64 view = "_list",
65 params = { delegations_selector = delegations_selector }
66 }
67 end
69 tabs[#tabs+1] =
70 {
71 name = "details",
72 label = _"Details",
73 icon = { static = "icons/16/magnifier.png" },
74 module = "issue",
75 view = "_details",
76 params = { issue = issue }
77 }
79 ui.tabs(tabs)

Impressum / About Us