liquid_feedback_frontend

view app/main/member/show.lua @ 4:80c215dbf076

Version alpha5

Many optical changes and improved usability

Support for different wiki-formatting-engines

Help system
author bsw/jbe
date Thu Dec 10 12:00:00 2009 +0100 (2009-12-10)
parents 768faea1096d
children 0ee1e0c42d4c
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 slot.put_into("actions", _"That's me!")
18 else
19 --TODO performance
20 local contact = Contact:by_pk(app.session.member.id, member.id)
21 if contact then
22 slot.select("actions", function()
23 ui.container{
24 attr = { class = "interest" },
25 content = _"You have saved this member as contact."
26 }
27 ui.link{
28 content = function()
29 ui.image{ static = "icons/16/book_delete.png" }
30 slot.put(encode.html(_"Remove from contacts"))
31 end,
32 module = "contact",
33 action = "remove_member",
34 id = contact.other_member_id,
35 routing = {
36 default = {
37 mode = "redirect",
38 module = request.get_module(),
39 view = request.get_view(),
40 id = param.get_id_cgi(),
41 params = param.get_all_cgi()
42 }
43 }
44 }
45 end)
46 else
47 slot.select("actions", function()
48 ui.link{
49 content = function()
50 ui.image{ static = "icons/16/book_add.png" }
51 slot.put(encode.html(_"Add to my contacts"))
52 end,
53 module = "contact",
54 action = "add_member",
55 id = member.id,
56 routing = {
57 default = {
58 mode = "redirect",
59 module = request.get_module(),
60 view = request.get_view(),
61 id = param.get_id_cgi(),
62 params = param.get_all_cgi()
63 }
64 }
65 }
66 end)
67 end
68 end
70 util.help("member.show", _"Member page")
72 execute.view{
73 module = "member",
74 view = "_show",
75 params = { member = member }
76 }

Impressum / About Us