liquid_feedback_frontend
view app/main/member/show.lua @ 111:bf885faf3452
add initiator support in delegation
if a delegation is issued from the initiative view, the initiators
from that one are added to the delegation target list. this makes it easier to delegate to the author without the need to add him to the contact list.
if a delegation is issued from the initiative view, the initiators
from that one are added to the delegation target list. this makes it easier to delegate to the author without the need to add him to the contact list.
| author | Daniel Poelzleithner <poelzi@poelzi.org> |
|---|---|
| date | Mon Sep 20 20:32:04 2010 +0200 (2010-09-20) |
| parents | 733f65c0c0a0 |
| children | 7d0f4721d2f3 |
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 slot.select("actions", function()
17 if not (member.id == app.session.member.id) then
18 if not member.active then
19 ui.tag{
20 tag = "div",
21 attr = { class = "interest deactivated_member_info" },
22 content = _"This member is deactivated."
23 }
24 slot.put(" ")
25 end
26 --TODO performance
27 local contact = Contact:by_pk(app.session.member.id, member.id)
28 if contact then
29 ui.container{
30 attr = { class = "interest" },
31 content = _"You have saved this member as contact."
32 }
33 ui.link{
34 image = { static = "icons/16/book_delete.png" },
35 text = _"Remove from contacts",
36 module = "contact",
37 action = "remove_member",
38 id = contact.other_member_id,
39 routing = {
40 default = {
41 mode = "redirect",
42 module = request.get_module(),
43 view = request.get_view(),
44 id = param.get_id_cgi(),
45 params = param.get_all_cgi()
46 }
47 }
48 }
49 elseif member.active then
50 ui.link{
51 image = { static = "icons/16/book_add.png" },
52 text = _"Add to my contacts",
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 slot.select("actions", function()
71 ui.link{
72 content = function()
73 ui.image{ static = "icons/16/clock_edit.png" }
74 slot.put(encode.html(_"Show name history"))
75 end,
76 module = "member",
77 view = "history",
78 id = member.id
79 }
80 end)
82 util.help("member.show", _"Member page")
84 execute.view{
85 module = "member",
86 view = "_show",
87 params = { member = member }
88 }
