liquid_feedback_frontend

view app/main/member/show.lua @ 16:559c6be0e1e9

"Vote later" feature; Refactored interest box
author bsw
date Tue Feb 02 00:10:17 2010 +0100 (2010-02-02)
parents 0ee1e0c42d4c
children 00d1004545f1
line source
1 local member = Member:by_id(param.get_id())
3 slot.select("title", function()
4 execute.view{
5 module = "member_image",
6 view = "_show",
7 params = {
8 member = member,
9 image_type = "avatar"
10 }
11 }
12 end)
14 slot.put_into("title", encode.html(_"Member '#{member}'":gsub("#{member}", member.name)))
16 if member.id ~= app.session.member.id then
17 --TODO performance
18 local contact = Contact:by_pk(app.session.member.id, member.id)
19 if contact then
20 slot.select("actions", function()
21 ui.container{
22 attr = { class = "interest" },
23 content = _"You have saved this member as contact."
24 }
25 ui.link{
26 content = function()
27 ui.image{ static = "icons/16/book_delete.png" }
28 slot.put(encode.html(_"Remove from contacts"))
29 end,
30 module = "contact",
31 action = "remove_member",
32 id = contact.other_member_id,
33 routing = {
34 default = {
35 mode = "redirect",
36 module = request.get_module(),
37 view = request.get_view(),
38 id = param.get_id_cgi(),
39 params = param.get_all_cgi()
40 }
41 }
42 }
43 end)
44 else
45 slot.select("actions", function()
46 ui.link{
47 content = function()
48 ui.image{ static = "icons/16/book_add.png" }
49 slot.put(encode.html(_"Add to my contacts"))
50 end,
51 module = "contact",
52 action = "add_member",
53 id = member.id,
54 routing = {
55 default = {
56 mode = "redirect",
57 module = request.get_module(),
58 view = request.get_view(),
59 id = param.get_id_cgi(),
60 params = param.get_all_cgi()
61 }
62 }
63 }
64 end)
65 end
66 end
68 slot.select("actions", function()
69 ui.link{
70 content = function()
71 ui.image{ static = "icons/16/clock_edit.png" }
72 slot.put(encode.html(_"Show name history"))
73 end,
74 module = "member",
75 view = "history",
76 id = member.id
77 }
78 end)
80 util.help("member.show", _"Member page")
82 execute.view{
83 module = "member",
84 view = "_show",
85 params = { member = member }
86 }

Impressum / About Us