liquid_feedback_frontend

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

Impressum / About Us