liquid_feedback_frontend

view app/main/supporter/_show_box.lua @ 0:3bfb2fcf7ab9

Version alpha1
author bsw/jbe
date Wed Nov 18 12:00:00 2009 +0100 (2009-11-18)
parents
children 5c601807d397
line source
3 slot.select("support", function()
5 local initiative = param.get("initiative", "table")
7 if not initiative.issue.frozen and not initiative.issue.closed then
9 local supported = Supporter:by_pk(initiative.id, app.session.member.id) and true or false
11 local text
12 if supported then
13 text = _"Direct supporter [change]"
14 else
15 text = _"No supporter [change]"
16 end
17 ui.container{
18 attr = {
19 class = "head",
20 style = "cursor: pointer;",
21 onclick = "document.getElementById('support_content').style.display = 'block';"
22 },
23 content = text
24 }
27 ui.container{
28 attr = { class = "content", id = "support_content" },
29 content = function()
30 if supported then
31 ui.link{
32 content = function()
33 ui.image{ static = "icons/16/thumb_down_red.png" }
34 slot.put(_"Remove my support from this initiative")
35 end,
36 module = "initiative",
37 action = "remove_support",
38 id = initiative.id
39 }
40 else
41 ui.link{
42 content = function()
43 ui.image{ static = "icons/16/thumb_up_green.png" }
44 slot.put(_"Support this initiative")
45 end,
46 module = "initiative",
47 action = "add_support",
48 id = initiative.id
49 }
50 end
51 end
52 }
53 end
55 end)

Impressum / About Us