liquid_feedback_frontend

view app/main/supporter/_show_box.lua @ 15:a3ac899559de

Esperanto support activated in frontend
author bsw
date Sun Jan 31 22:34:45 2010 +0100 (2010-01-31)
parents 72c5e0ee7c98
children 00d1004545f1
line source
2 slot.select("support", function()
3 local initiative = param.get("initiative", "table")
4 local supporter = Supporter:by_pk(initiative.id, app.session.member.id)
6 if not initiative.issue.fully_frozen and not initiative.issue.closed then
7 if supporter then
8 if not supporter:has_critical_opinion() then
9 ui.container{
10 attr = {
11 class = "head head_supporter",
12 style = "cursor: pointer;",
13 onclick = "document.getElementById('support_content').style.display = 'block';"
14 },
15 content = function()
16 ui.image{
17 static = "icons/16/thumb_up_green.png"
18 }
19 slot.put(_"Your are supporter")
20 ui.image{
21 static = "icons/16/dropdown.png"
22 }
23 end
24 }
25 else
26 ui.container{
27 attr = {
28 class = "head head_potential_supporter",
29 style = "cursor: pointer;",
30 onclick = "document.getElementById('support_content').style.display = 'block';"
31 },
32 content = function()
33 ui.image{
34 static = "icons/16/thumb_up.png"
35 }
36 slot.put(_"Your are potential supporter")
37 ui.image{
38 static = "icons/16/dropdown.png"
39 }
40 end
41 }
42 end
43 ui.container{
44 attr = { class = "content", id = "support_content" },
45 content = function()
46 ui.container{
47 attr = {
48 class = "close",
49 style = "cursor: pointer;",
50 onclick = "document.getElementById('support_content').style.display = 'none';"
51 },
52 content = function()
53 ui.image{ static = "icons/16/cross.png" }
54 end
55 }
56 if supporter then
57 ui.link{
58 content = function()
59 ui.image{ static = "icons/16/thumb_down_red.png" }
60 slot.put(_"Remove my support from this initiative")
61 end,
62 module = "initiative",
63 action = "remove_support",
64 id = initiative.id,
65 routing = {
66 default = {
67 mode = "redirect",
68 module = request.get_module(),
69 view = request.get_view(),
70 id = param.get_id_cgi(),
71 params = param.get_all_cgi()
72 }
73 }
74 }
75 else
76 end
77 end
78 }
79 else
80 if not initiative.revoked then
81 ui.link{
82 content = function()
83 ui.image{ static = "icons/16/thumb_up_green.png" }
84 slot.put(_"Support this initiative")
85 end,
86 module = "initiative",
87 action = "add_support",
88 id = initiative.id,
89 routing = {
90 default = {
91 mode = "redirect",
92 module = request.get_module(),
93 view = request.get_view(),
94 id = param.get_id_cgi(),
95 params = param.get_all_cgi()
96 }
97 }
98 }
99 end
100 end
101 end
103 end)

Impressum / About Us