liquid_feedback_frontend
view app/main/member/_show_thumb.lua @ 3:768faea1096d
Version alpha4
Members interested in an issue or supporting an initiative have a weight information attached. Browsing the members causing that weight is possible.
Initiatives may provide a link to an external discussion platform
Direct link on every initiative page to create an alternative initiative
Bugfix: No error when clicking "neutral", when "neutral" is currently selected
Members interested in an issue or supporting an initiative have a weight information attached. Browsing the members causing that weight is possible.
Initiatives may provide a link to an external discussion platform
Direct link on every initiative page to create an alternative initiative
Bugfix: No error when clicking "neutral", when "neutral" is currently selected
author | bsw |
---|---|
date | Mon Nov 30 12:00:00 2009 +0100 (2009-11-30) |
parents | 5c601807d397 |
children | 80c215dbf076 |
line source
1 local member = param.get("member", "table")
3 local issue = param.get("issue", "table")
4 local initiative = param.get("initiative", "table")
5 local trustee = param.get("trustee", "table")
7 local name
8 if member.name_highlighted then
9 name = encode.highlight(member.name_highlighted)
10 else
11 name = encode.html(member.name)
12 end
14 ui.container{
15 attr = { class = "member_thumb" },
16 content = function()
17 ui.container{
18 attr = { class = "flags" },
19 content = function()
20 if (issue or initiative) and member.weight > 1 then
21 local module
22 if issue then
23 module = "interest"
24 elseif initiative then
25 module = "supporter"
26 end
27 ui.link{
28 attr = { title = _"Number of incoming delegations, follow link to see more details" },
29 content = _("+ #{weight}", { weight = member.weight - 1 }),
30 module = module,
31 view = "show_incoming",
32 params = {
33 member_id = member.id,
34 initiative_id = initiative and initiative.id or nil,
35 issue_id = issue and issue.id or nil
36 }
37 }
38 end
39 if member.admin then
40 ui.image{
41 attr = {
42 alt = _"Member is administrator",
43 title = _"Member is administrator"
44 },
45 static = "icons/16/cog.png"
46 }
47 end
48 -- TODO performance
49 local contact = Contact:by_pk(app.session.member.id, member.id)
50 if contact then
51 ui.image{
52 attr = {
53 alt = _"You have saved this member as contact",
54 title = _"You have saved this member as contact"
55 },
56 static = "icons/16/bullet_disk.png"
57 }
58 end
59 end
60 }
62 ui.link{
63 attr = { title = _"Show member" },
64 module = "member",
65 view = "show",
66 id = member.id,
67 content = function()
68 ui.image{
69 attr = { width = 48, height = 48 },
70 module = "member",
71 view = "avatar",
72 id = member.id,
73 extension = "jpg"
74 }
75 ui.container{
76 attr = { class = "member_name" },
77 content = function()
78 slot.put(name)
79 end
80 }
81 end
82 }
83 end
84 }