liquid_feedback_frontend
view app/main/supporter/_show_box.lua @ 2:5c601807d397
Version alpha3
Dark green part of issue supporter bargraph represents all satisfied supporters, regardless of having seen the latest draft
Wiki formatting for drafts
Showing differences between two drafts of the same initiative
Display of outgoing delegation chains
Many other improvements
Dark green part of issue supporter bargraph represents all satisfied supporters, regardless of having seen the latest draft
Wiki formatting for drafts
Showing differences between two drafts of the same initiative
Display of outgoing delegation chains
Many other improvements
author | bsw |
---|---|
date | Mon Nov 23 12:00:00 2009 +0100 (2009-11-23) |
parents | 3bfb2fcf7ab9 |
children | 80c215dbf076 |
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 ui.container{
31 attr = {
32 class = "close",
33 style = "cursor: pointer;",
34 onclick = "document.getElementById('support_content').style.display = 'none';"
35 },
36 content = _"X"
37 }
38 if supported then
39 ui.link{
40 content = function()
41 ui.image{ static = "icons/16/thumb_down_red.png" }
42 slot.put(_"Remove my support from this initiative")
43 end,
44 module = "initiative",
45 action = "remove_support",
46 id = initiative.id
47 }
48 else
49 ui.link{
50 content = function()
51 ui.image{ static = "icons/16/thumb_up_green.png" }
52 slot.put(_"Support this initiative")
53 end,
54 module = "initiative",
55 action = "add_support",
56 id = initiative.id
57 }
58 end
59 end
60 }
61 end
63 end)