liquid_feedback_frontend
diff 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 |
line diff
1.1 --- a/app/main/member/show.lua Mon Nov 23 12:00:00 2009 +0100 1.2 +++ b/app/main/member/show.lua Mon Nov 30 12:00:00 2009 +0100 1.3 @@ -15,17 +15,49 @@ 1.4 if member.id == app.session.member.id then 1.5 slot.put_into("actions", _"That's me!") 1.6 else 1.7 - slot.select("actions", function() 1.8 - ui.link{ 1.9 - content = function() 1.10 - ui.image{ static = "icons/16/book_add.png" } 1.11 - slot.put(encode.html(_"Add to my contacts")) 1.12 - end, 1.13 - module = "contact", 1.14 - action = "add_member", 1.15 - id = member.id 1.16 - } 1.17 - end) 1.18 + --TODO performance 1.19 + local contact = Contact:by_pk(app.session.member.id, member.id) 1.20 + if contact then 1.21 + slot.select("actions", function() 1.22 + ui.field.text{ value = _"You have saved this member as contact." } 1.23 + ui.link{ 1.24 + text = _"Remove from contacts", 1.25 + module = "contact", 1.26 + action = "remove_member", 1.27 + id = contact.other_member_id, 1.28 + routing = { 1.29 + default = { 1.30 + mode = "redirect", 1.31 + module = request.get_module(), 1.32 + view = request.get_view(), 1.33 + id = param.get_id_cgi(), 1.34 + params = param.get_all_cgi() 1.35 + } 1.36 + } 1.37 + } 1.38 + end) 1.39 + else 1.40 + slot.select("actions", function() 1.41 + ui.link{ 1.42 + content = function() 1.43 + ui.image{ static = "icons/16/book_add.png" } 1.44 + slot.put(encode.html(_"Add to my contacts")) 1.45 + end, 1.46 + module = "contact", 1.47 + action = "add_member", 1.48 + id = member.id, 1.49 + routing = { 1.50 + default = { 1.51 + mode = "redirect", 1.52 + module = request.get_module(), 1.53 + view = request.get_view(), 1.54 + id = param.get_id_cgi(), 1.55 + params = param.get_all_cgi() 1.56 + } 1.57 + } 1.58 + } 1.59 + end) 1.60 + end 1.61 end 1.62 1.63