liquid_feedback_frontend
annotate app/main/interest/_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
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 | 3bfb2fcf7ab9 | 
| children | 80c215dbf076 | 
| rev | line source | 
|---|---|
| bsw/jbe@0 | 1 | 
| bsw/jbe@0 | 2 local issue = param.get("issue", "table") | 
| bsw/jbe@0 | 3 | 
| bsw/jbe@0 | 4 | 
| bsw/jbe@0 | 5 slot.select("interest", function() | 
| bsw/jbe@0 | 6 local interest = Interest:by_pk(issue.id, app.session.member.id) | 
| bsw/jbe@0 | 7 | 
| bsw/jbe@0 | 8 ui.container{ | 
| bsw/jbe@0 | 9 attr = { | 
| bsw/jbe@0 | 10 class = "head", | 
| bsw/jbe@0 | 11 onclick = "document.getElementById('interest_content').style.display = 'block';" | 
| bsw/jbe@0 | 12 }, | 
| bsw/jbe@0 | 13 content = function() | 
| bsw/jbe@0 | 14 if interest then | 
| bsw/jbe@0 | 15 ui.field.text{ value = _"You are interested. [more]" } | 
| bsw/jbe@0 | 16 else | 
| bsw/jbe@0 | 17 ui.field.text{ value = _"You are not interested. [more]" } | 
| bsw/jbe@0 | 18 end | 
| bsw/jbe@0 | 19 end | 
| bsw/jbe@0 | 20 } | 
| bsw/jbe@0 | 21 | 
| bsw/jbe@0 | 22 ui.container{ | 
| bsw/jbe@0 | 23 attr = { class = "content", id = "interest_content" }, | 
| bsw/jbe@0 | 24 content = function() | 
| bsw@3 | 25 ui.container{ | 
| bsw@3 | 26 attr = { | 
| bsw@3 | 27 class = "close", | 
| bsw@3 | 28 style = "cursor: pointer;", | 
| bsw@3 | 29 onclick = "document.getElementById('interest_content').style.display = 'none';" | 
| bsw@3 | 30 }, | 
| bsw@3 | 31 content = _"X" | 
| bsw@3 | 32 } | 
| bsw/jbe@0 | 33 if interest then | 
| bsw/jbe@0 | 34 ui.link{ | 
| bsw/jbe@0 | 35 content = _"Remove my interest", | 
| bsw/jbe@0 | 36 module = "interest", | 
| bsw/jbe@0 | 37 action = "update", | 
| bsw/jbe@0 | 38 params = { issue_id = issue.id, delete = true }, | 
| bsw/jbe@0 | 39 routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } } | 
| bsw/jbe@0 | 40 } | 
| bsw@3 | 41 slot.put("<br />") | 
| bsw@3 | 42 slot.put("<br />") | 
| bsw/jbe@0 | 43 if interest.autoreject then | 
| bsw/jbe@0 | 44 ui.field.text{ value = _"Autoreject is on." } | 
| bsw/jbe@0 | 45 ui.link{ | 
| bsw/jbe@0 | 46 content = _"Remove autoreject", | 
| bsw/jbe@0 | 47 module = "interest", | 
| bsw/jbe@0 | 48 action = "update", | 
| bsw/jbe@0 | 49 params = { issue_id = issue.id, autoreject = false }, | 
| bsw/jbe@0 | 50 routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } } | 
| bsw/jbe@0 | 51 } | 
| bsw/jbe@0 | 52 else | 
| bsw/jbe@0 | 53 ui.field.text{ value = _"Autoreject is off." } | 
| bsw/jbe@0 | 54 ui.link{ | 
| bsw/jbe@0 | 55 content = _"Set autoreject", | 
| bsw/jbe@0 | 56 module = "interest", | 
| bsw/jbe@0 | 57 action = "update", | 
| bsw/jbe@0 | 58 params = { issue_id = issue.id, autoreject = true }, | 
| bsw/jbe@0 | 59 routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } } | 
| bsw/jbe@0 | 60 } | 
| bsw/jbe@0 | 61 end | 
| bsw/jbe@0 | 62 else | 
| bsw/jbe@0 | 63 ui.link{ | 
| bsw/jbe@0 | 64 content = _"Add my interest to this issue", | 
| bsw/jbe@0 | 65 module = "interest", | 
| bsw/jbe@0 | 66 action = "update", | 
| bsw/jbe@0 | 67 params = { issue_id = issue.id }, | 
| bsw/jbe@0 | 68 routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } } | 
| bsw/jbe@0 | 69 } | 
| bsw/jbe@0 | 70 end | 
| bsw/jbe@0 | 71 end | 
| bsw/jbe@0 | 72 } | 
| bsw/jbe@0 | 73 end) |