liquid_feedback_frontend

view app/main/supporter/_show_box.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 00d1004545f1
children 034f96181e59
line source
2 local initiative = param.get("initiative", "table")
3 local supporter = Supporter:by_pk(initiative.id, app.session.member.id)
5 local unique_string = multirand.string(16, '0123456789abcdef')
8 local partial = {
9 routing = {
10 default = {
11 mode = "redirect",
12 module = "initiative",
13 view = "show_support",
14 id = initiative.id
15 }
16 }
17 }
19 local routing = {
20 default = {
21 mode = "redirect",
22 module = request.get_module(),
23 view = request.get_view(),
24 id = param.get_id_cgi(),
25 params = param.get_all_cgi()
26 }
27 }
29 if not initiative.issue.fully_frozen and not initiative.issue.closed then
30 if supporter then
31 if not supporter:has_critical_opinion() then
32 ui.container{
33 attr = {
34 class = "head head_supporter",
35 style = "cursor: pointer;",
36 onclick = "document.getElementById('support_content_" .. unique_string .. "').style.display = 'block';"
37 },
38 content = function()
39 ui.image{
40 static = "icons/16/thumb_up_green.png"
41 }
42 slot.put(_"Your are supporter")
43 ui.image{
44 static = "icons/16/dropdown.png"
45 }
46 end
47 }
48 else
49 ui.container{
50 attr = {
51 class = "head head_potential_supporter",
52 style = "cursor: pointer;",
53 onclick = "document.getElementById('support_content_" .. unique_string .. "').style.display = 'block';"
54 },
55 content = function()
56 ui.image{
57 static = "icons/16/thumb_up.png"
58 }
59 slot.put(_"Your are potential supporter")
60 ui.image{
61 static = "icons/16/dropdown.png"
62 }
63 end
64 }
65 end
66 ui.container{
67 attr = { class = "content", id = "support_content_" .. unique_string .. "" },
68 content = function()
69 ui.container{
70 attr = {
71 class = "close",
72 style = "cursor: pointer;",
73 onclick = "document.getElementById('support_content_" .. unique_string .. "').style.display = 'none';"
74 },
75 content = function()
76 ui.image{ static = "icons/16/cross.png" }
77 end
78 }
79 if supporter then
80 ui.link{
81 image = { static = "icons/16/thumb_down_red.png" },
82 text = _"Remove my support from this initiative",
83 module = "initiative",
84 action = "remove_support",
85 id = initiative.id,
86 routing = routing,
87 partial = partial
88 }
89 else
90 end
91 end
92 }
93 else
94 if not initiative.revoked then
95 local params = param.get_all_cgi()
96 params.dyn = nil
97 ui.link{
98 image = { static = "icons/16/thumb_up_green.png" },
99 text = _"Support this initiative",
100 module = "initiative",
101 action = "add_support",
102 id = initiative.id,
103 routing = routing,
104 partial = partial
105 }
106 end
107 end
108 end

Impressum / About Us