liquid_feedback_frontend

view app/main/member/show.lua @ 564:418b590fa9ed

Optical enhancements, cleanup
author bsw
date Tue Jun 19 22:44:18 2012 +0200 (2012-06-19)
parents 5ca9de94cb13
children 2ad52d0067eb
line source
1 local member = Member:by_id(param.get_id())
3 if not member or not member.activated then
4 error("access denied")
5 end
7 app.html_title.title = member.name
8 app.html_title.subtitle = _("Member")
10 slot.select("head", function()
11 ui.container{
12 attr = { class = "title" },
13 content = _("Member '#{member}'", { member = member.name })
14 }
16 ui.container{ attr = { class = "actions" }, content = function()
18 if member.id == app.session.member_id then
19 ui.link{
20 content = function()
21 slot.put(encode.html(_"Edit profile"))
22 end,
23 module = "member",
24 view = "edit"
25 }
26 slot.put(" · ")
27 ui.link{
28 content = function()
29 slot.put(encode.html(_"Upload avatar/photo"))
30 end,
31 module = "member",
32 view = "edit_images"
33 }
34 slot.put(" · ")
35 end
36 ui.link{
37 content = function()
38 slot.put(encode.html(_"Show member history"))
39 end,
40 module = "member",
41 view = "history",
42 id = member.id
43 }
44 if not member.active then
45 slot.put(" · ")
46 ui.tag{
47 attr = { class = "interest deactivated_member_info" },
48 content = _"This member is deactivated."
49 }
50 end
51 if not (member.id == app.session.member.id) then
52 slot.put(" · ")
53 --TODO performance
54 local contact = Contact:by_pk(app.session.member.id, member.id)
55 if contact then
56 ui.link{
57 text = _"Remove from contacts",
58 module = "contact",
59 action = "remove_member",
60 id = contact.other_member_id,
61 routing = {
62 default = {
63 mode = "redirect",
64 module = request.get_module(),
65 view = request.get_view(),
66 id = param.get_id_cgi(),
67 params = param.get_all_cgi()
68 }
69 }
70 }
71 elseif member.activated then
72 ui.link{
73 text = _"Add to my contacts",
74 module = "contact",
75 action = "add_member",
76 id = member.id,
77 routing = {
78 default = {
79 mode = "redirect",
80 module = request.get_module(),
81 view = request.get_view(),
82 id = param.get_id_cgi(),
83 params = param.get_all_cgi()
84 }
85 }
86 }
87 end
88 end
89 local ignored_member = IgnoredMember:by_pk(app.session.member.id, member.id)
90 slot.put(" · ")
91 if ignored_member then
92 ui.tag{
93 attr = { class = "interest" },
94 content = _"You have ignored this member"
95 }
96 slot.put(" · ")
97 ui.link{
98 text = _"Stop ignoring member",
99 module = "member",
100 action = "update_ignore_member",
101 id = member.id,
102 params = { delete = true },
103 routing = {
104 default = {
105 mode = "redirect",
106 module = request.get_module(),
107 view = request.get_view(),
108 id = param.get_id_cgi(),
109 params = param.get_all_cgi()
110 }
111 }
112 }
113 elseif member.activated then
114 ui.link{
115 attr = { class = "interest" },
116 text = _"Ignore member",
117 module = "member",
118 action = "update_ignore_member",
119 id = member.id,
120 routing = {
121 default = {
122 mode = "redirect",
123 module = request.get_module(),
124 view = request.get_view(),
125 id = param.get_id_cgi(),
126 params = param.get_all_cgi()
127 }
128 }
129 }
130 end
131 end }
132 end)
134 util.help("member.show", _"Member page")
136 execute.view{
137 module = "member",
138 view = "_show",
139 params = { member = member }
140 }

Impressum / About Us