liquid_feedback_frontend
annotate app/main/member/show.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 local member = Member:by_id(param.get_id()) |
| bsw/jbe@0 | 2 |
| bsw/jbe@0 | 3 slot.select("title", function() |
| bsw/jbe@0 | 4 ui.image{ |
| bsw/jbe@0 | 5 attr = { class = "avatar" }, |
| bsw/jbe@0 | 6 module = "member", |
| bsw/jbe@0 | 7 view = "avatar", |
| bsw/jbe@0 | 8 extension = "jpg", |
| bsw/jbe@0 | 9 id = member.id |
| bsw/jbe@0 | 10 } |
| bsw/jbe@0 | 11 end) |
| bsw/jbe@0 | 12 |
| bsw/jbe@0 | 13 slot.put_into("title", encode.html(_"Member '#{member}'":gsub("#{member}", member.name))) |
| bsw/jbe@0 | 14 |
| bsw/jbe@0 | 15 if member.id == app.session.member.id then |
| bsw/jbe@0 | 16 slot.put_into("actions", _"That's me!") |
| bsw/jbe@0 | 17 else |
| bsw@3 | 18 --TODO performance |
| bsw@3 | 19 local contact = Contact:by_pk(app.session.member.id, member.id) |
| bsw@3 | 20 if contact then |
| bsw@3 | 21 slot.select("actions", function() |
| bsw@3 | 22 ui.field.text{ value = _"You have saved this member as contact." } |
| bsw@3 | 23 ui.link{ |
| bsw@3 | 24 text = _"Remove from contacts", |
| bsw@3 | 25 module = "contact", |
| bsw@3 | 26 action = "remove_member", |
| bsw@3 | 27 id = contact.other_member_id, |
| bsw@3 | 28 routing = { |
| bsw@3 | 29 default = { |
| bsw@3 | 30 mode = "redirect", |
| bsw@3 | 31 module = request.get_module(), |
| bsw@3 | 32 view = request.get_view(), |
| bsw@3 | 33 id = param.get_id_cgi(), |
| bsw@3 | 34 params = param.get_all_cgi() |
| bsw@3 | 35 } |
| bsw@3 | 36 } |
| bsw@3 | 37 } |
| bsw@3 | 38 end) |
| bsw@3 | 39 else |
| bsw@3 | 40 slot.select("actions", function() |
| bsw@3 | 41 ui.link{ |
| bsw@3 | 42 content = function() |
| bsw@3 | 43 ui.image{ static = "icons/16/book_add.png" } |
| bsw@3 | 44 slot.put(encode.html(_"Add to my contacts")) |
| bsw@3 | 45 end, |
| bsw@3 | 46 module = "contact", |
| bsw@3 | 47 action = "add_member", |
| bsw@3 | 48 id = member.id, |
| bsw@3 | 49 routing = { |
| bsw@3 | 50 default = { |
| bsw@3 | 51 mode = "redirect", |
| bsw@3 | 52 module = request.get_module(), |
| bsw@3 | 53 view = request.get_view(), |
| bsw@3 | 54 id = param.get_id_cgi(), |
| bsw@3 | 55 params = param.get_all_cgi() |
| bsw@3 | 56 } |
| bsw@3 | 57 } |
| bsw@3 | 58 } |
| bsw@3 | 59 end) |
| bsw@3 | 60 end |
| bsw/jbe@0 | 61 end |
| bsw/jbe@0 | 62 |
| bsw/jbe@0 | 63 |
| bsw/jbe@0 | 64 execute.view{ |
| bsw/jbe@0 | 65 module = "member", |
| bsw/jbe@0 | 66 view = "_show", |
| bsw/jbe@0 | 67 params = { member = member } |
| bsw/jbe@0 | 68 } |
| bsw/jbe@0 | 69 |