liquid_feedback_frontend
annotate app/main/supporter/_show_box.lua @ 4:80c215dbf076
Version alpha5
Many optical changes and improved usability
Support for different wiki-formatting-engines
Help system
Many optical changes and improved usability
Support for different wiki-formatting-engines
Help system
| author | bsw/jbe |
|---|---|
| date | Thu Dec 10 12:00:00 2009 +0100 (2009-12-10) |
| parents | 5c601807d397 |
| children | afd9f769c7ae |
| rev | line source |
|---|---|
| bsw/jbe@0 | 1 |
| bsw/jbe@0 | 2 slot.select("support", function() |
| bsw/jbe@0 | 3 local initiative = param.get("initiative", "table") |
| bsw/jbe@4 | 4 local supported = Supporter:by_pk(initiative.id, app.session.member.id) and true or false |
| bsw/jbe@0 | 5 |
| bsw/jbe@4 | 6 ui.container{ |
| bsw/jbe@4 | 7 attr = { class = "actions" }, |
| bsw/jbe@4 | 8 content = function() |
| bsw/jbe@4 | 9 if not initiative.issue.frozen and not initiative.issue.closed then |
| bsw/jbe@0 | 10 if supported then |
| bsw/jbe@4 | 11 ui.container{ |
| bsw/jbe@4 | 12 attr = { |
| bsw/jbe@4 | 13 class = "head head_active", |
| bsw/jbe@4 | 14 style = "cursor: pointer;", |
| bsw/jbe@4 | 15 onclick = "document.getElementById('support_content').style.display = 'block';" |
| bsw/jbe@4 | 16 }, |
| bsw/jbe@4 | 17 content = function() |
| bsw/jbe@4 | 18 ui.image{ |
| bsw/jbe@4 | 19 static = "icons/16/thumb_up_green.png" |
| bsw/jbe@4 | 20 } |
| bsw/jbe@4 | 21 slot.put(_"Your are supporter") |
| bsw/jbe@4 | 22 ui.image{ |
| bsw/jbe@4 | 23 static = "icons/16/dropdown.png" |
| bsw/jbe@4 | 24 } |
| bsw/jbe@4 | 25 end |
| bsw/jbe@4 | 26 } |
| bsw/jbe@4 | 27 ui.container{ |
| bsw/jbe@4 | 28 attr = { class = "content", id = "support_content" }, |
| bsw/jbe@0 | 29 content = function() |
| bsw/jbe@4 | 30 ui.container{ |
| bsw/jbe@4 | 31 attr = { |
| bsw/jbe@4 | 32 class = "close", |
| bsw/jbe@4 | 33 style = "cursor: pointer;", |
| bsw/jbe@4 | 34 onclick = "document.getElementById('support_content').style.display = 'none';" |
| bsw/jbe@4 | 35 }, |
| bsw/jbe@4 | 36 content = function() |
| bsw/jbe@4 | 37 ui.image{ static = "icons/16/cross.png" } |
| bsw/jbe@4 | 38 end |
| bsw/jbe@4 | 39 } |
| bsw/jbe@4 | 40 if supported then |
| bsw/jbe@4 | 41 ui.link{ |
| bsw/jbe@4 | 42 content = function() |
| bsw/jbe@4 | 43 ui.image{ static = "icons/16/thumb_down_red.png" } |
| bsw/jbe@4 | 44 slot.put(_"Remove my support from this initiative") |
| bsw/jbe@4 | 45 end, |
| bsw/jbe@4 | 46 module = "initiative", |
| bsw/jbe@4 | 47 action = "remove_support", |
| bsw/jbe@4 | 48 id = initiative.id, |
| bsw/jbe@4 | 49 routing = { |
| bsw/jbe@4 | 50 default = { |
| bsw/jbe@4 | 51 mode = "redirect", |
| bsw/jbe@4 | 52 module = request.get_module(), |
| bsw/jbe@4 | 53 view = request.get_view(), |
| bsw/jbe@4 | 54 id = param.get_id_cgi(), |
| bsw/jbe@4 | 55 params = param.get_all_cgi() |
| bsw/jbe@4 | 56 } |
| bsw/jbe@4 | 57 } |
| bsw/jbe@4 | 58 } |
| bsw/jbe@4 | 59 else |
| bsw/jbe@4 | 60 end |
| bsw/jbe@4 | 61 end |
| bsw/jbe@0 | 62 } |
| bsw/jbe@0 | 63 else |
| bsw/jbe@0 | 64 ui.link{ |
| bsw/jbe@0 | 65 content = function() |
| bsw/jbe@0 | 66 ui.image{ static = "icons/16/thumb_up_green.png" } |
| bsw/jbe@0 | 67 slot.put(_"Support this initiative") |
| bsw/jbe@0 | 68 end, |
| bsw/jbe@0 | 69 module = "initiative", |
| bsw/jbe@0 | 70 action = "add_support", |
| bsw/jbe@4 | 71 id = initiative.id, |
| bsw/jbe@4 | 72 routing = { |
| bsw/jbe@4 | 73 default = { |
| bsw/jbe@4 | 74 mode = "redirect", |
| bsw/jbe@4 | 75 module = request.get_module(), |
| bsw/jbe@4 | 76 view = request.get_view(), |
| bsw/jbe@4 | 77 id = param.get_id_cgi(), |
| bsw/jbe@4 | 78 params = param.get_all_cgi() |
| bsw/jbe@4 | 79 } |
| bsw/jbe@4 | 80 } |
| bsw/jbe@0 | 81 } |
| bsw/jbe@0 | 82 end |
| bsw/jbe@0 | 83 end |
| bsw/jbe@4 | 84 end |
| bsw/jbe@4 | 85 } |
| bsw/jbe@0 | 86 end) |