liquid_feedback_frontend

annotate app/main/supporter/_show_box.lua @ 3:768faea1096d

Version alpha4

Members interested in an issue or supporting an initiative have a weight information attached. Browsing the members causing that weight is possible.

Initiatives may provide a link to an external discussion platform

Direct link on every initiative page to create an alternative initiative

Bugfix: No error when clicking "neutral", when "neutral" is currently selected
author bsw
date Mon Nov 30 12:00:00 2009 +0100 (2009-11-30)
parents 5c601807d397
children 80c215dbf076
rev   line source
bsw/jbe@0 1
bsw/jbe@0 2
bsw/jbe@0 3 slot.select("support", function()
bsw/jbe@0 4
bsw/jbe@0 5 local initiative = param.get("initiative", "table")
bsw/jbe@0 6
bsw/jbe@0 7 if not initiative.issue.frozen and not initiative.issue.closed then
bsw/jbe@0 8
bsw/jbe@0 9 local supported = Supporter:by_pk(initiative.id, app.session.member.id) and true or false
bsw/jbe@0 10
bsw/jbe@0 11 local text
bsw/jbe@0 12 if supported then
bsw/jbe@0 13 text = _"Direct supporter [change]"
bsw/jbe@0 14 else
bsw/jbe@0 15 text = _"No supporter [change]"
bsw/jbe@0 16 end
bsw/jbe@0 17 ui.container{
bsw/jbe@0 18 attr = {
bsw/jbe@0 19 class = "head",
bsw/jbe@0 20 style = "cursor: pointer;",
bsw/jbe@0 21 onclick = "document.getElementById('support_content').style.display = 'block';"
bsw/jbe@0 22 },
bsw/jbe@0 23 content = text
bsw/jbe@0 24 }
bsw/jbe@0 25
bsw/jbe@0 26
bsw/jbe@0 27 ui.container{
bsw/jbe@0 28 attr = { class = "content", id = "support_content" },
bsw/jbe@0 29 content = function()
bsw@2 30 ui.container{
bsw@2 31 attr = {
bsw@2 32 class = "close",
bsw@2 33 style = "cursor: pointer;",
bsw@2 34 onclick = "document.getElementById('support_content').style.display = 'none';"
bsw@2 35 },
bsw@2 36 content = _"X"
bsw@2 37 }
bsw/jbe@0 38 if supported then
bsw/jbe@0 39 ui.link{
bsw/jbe@0 40 content = function()
bsw/jbe@0 41 ui.image{ static = "icons/16/thumb_down_red.png" }
bsw/jbe@0 42 slot.put(_"Remove my support from this initiative")
bsw/jbe@0 43 end,
bsw/jbe@0 44 module = "initiative",
bsw/jbe@0 45 action = "remove_support",
bsw/jbe@0 46 id = initiative.id
bsw/jbe@0 47 }
bsw/jbe@0 48 else
bsw/jbe@0 49 ui.link{
bsw/jbe@0 50 content = function()
bsw/jbe@0 51 ui.image{ static = "icons/16/thumb_up_green.png" }
bsw/jbe@0 52 slot.put(_"Support this initiative")
bsw/jbe@0 53 end,
bsw/jbe@0 54 module = "initiative",
bsw/jbe@0 55 action = "add_support",
bsw/jbe@0 56 id = initiative.id
bsw/jbe@0 57 }
bsw/jbe@0 58 end
bsw/jbe@0 59 end
bsw/jbe@0 60 }
bsw/jbe@0 61 end
bsw/jbe@0 62
bsw/jbe@0 63 end)

Impressum / About Us