liquid_feedback_frontend
view app/main/member/show.lua @ 154:6b6c82f9ca9f
speedup member image loading when non set
we can add the location of the default file directy instead of going through another slow request
we can add the location of the default file directy instead of going through another slow request
author | Daniel Poelzleithner <poelzi@poelzi.org> |
---|---|
date | Fri Oct 08 15:25:10 2010 +0200 (2010-10-08) |
parents | 7d0f4721d2f3 |
children | dac08fce1ab7 |
line source
1 local member = Member:by_id(param.get_id())
3 app.html_title.title = member.name
4 app.html_title.subtitle = _("Member")
6 slot.select("title", function()
7 execute.view{
8 module = "member_image",
9 view = "_show",
10 params = {
11 member = member,
12 image_type = "avatar"
13 }
14 }
15 end)
17 slot.put_into("title", encode.html(_"Member '#{member}'":gsub("#{member}", member.name)))
19 slot.select("actions", function()
20 if not (member.id == app.session.member.id) then
21 if not member.active then
22 ui.tag{
23 tag = "div",
24 attr = { class = "interest deactivated_member_info" },
25 content = _"This member is deactivated."
26 }
27 slot.put(" ")
28 end
29 --TODO performance
30 local contact = Contact:by_pk(app.session.member.id, member.id)
31 if contact then
32 ui.container{
33 attr = { class = "interest" },
34 content = _"You have saved this member as contact."
35 }
36 ui.link{
37 image = { static = "icons/16/book_delete.png" },
38 text = _"Remove from contacts",
39 module = "contact",
40 action = "remove_member",
41 id = contact.other_member_id,
42 routing = {
43 default = {
44 mode = "redirect",
45 module = request.get_module(),
46 view = request.get_view(),
47 id = param.get_id_cgi(),
48 params = param.get_all_cgi()
49 }
50 }
51 }
52 elseif member.active then
53 ui.link{
54 image = { static = "icons/16/book_add.png" },
55 text = _"Add to my contacts",
56 module = "contact",
57 action = "add_member",
58 id = member.id,
59 routing = {
60 default = {
61 mode = "redirect",
62 module = request.get_module(),
63 view = request.get_view(),
64 id = param.get_id_cgi(),
65 params = param.get_all_cgi()
66 }
67 }
68 }
69 end
70 end
71 end)
73 slot.select("actions", function()
74 ui.link{
75 content = function()
76 ui.image{ static = "icons/16/clock_edit.png" }
77 slot.put(encode.html(_"Show name history"))
78 end,
79 module = "member",
80 view = "history",
81 id = member.id
82 }
83 end)
85 util.help("member.show", _"Member page")
87 execute.view{
88 module = "member",
89 view = "_show",
90 params = { member = member }
91 }