liquid_feedback_frontend
annotate app/main/supporter/_show_box.lua @ 1:dd0109e81922
Version alpha2
Minor bug in bargraph output for suggestions fixed
Minor bug in bargraph output for suggestions fixed
| author | bsw |
|---|---|
| date | Wed Nov 18 12:00:00 2009 +0100 (2009-11-18) |
| parents | 3bfb2fcf7ab9 |
| children | 5c601807d397 |
| 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/jbe@0 | 30 if supported then |
| bsw/jbe@0 | 31 ui.link{ |
| bsw/jbe@0 | 32 content = function() |
| bsw/jbe@0 | 33 ui.image{ static = "icons/16/thumb_down_red.png" } |
| bsw/jbe@0 | 34 slot.put(_"Remove my support from this initiative") |
| bsw/jbe@0 | 35 end, |
| bsw/jbe@0 | 36 module = "initiative", |
| bsw/jbe@0 | 37 action = "remove_support", |
| bsw/jbe@0 | 38 id = initiative.id |
| bsw/jbe@0 | 39 } |
| bsw/jbe@0 | 40 else |
| bsw/jbe@0 | 41 ui.link{ |
| bsw/jbe@0 | 42 content = function() |
| bsw/jbe@0 | 43 ui.image{ static = "icons/16/thumb_up_green.png" } |
| bsw/jbe@0 | 44 slot.put(_"Support this initiative") |
| bsw/jbe@0 | 45 end, |
| bsw/jbe@0 | 46 module = "initiative", |
| bsw/jbe@0 | 47 action = "add_support", |
| bsw/jbe@0 | 48 id = initiative.id |
| bsw/jbe@0 | 49 } |
| bsw/jbe@0 | 50 end |
| bsw/jbe@0 | 51 end |
| bsw/jbe@0 | 52 } |
| bsw/jbe@0 | 53 end |
| bsw/jbe@0 | 54 |
| bsw/jbe@0 | 55 end) |