liquid_feedback_frontend
view app/main/member/_show_thumb.lua @ 7:3941792e8be6
Version beta3
Table allowed_policy is respected while creating new issues
Broken vote now/later link is not shown anymore (until it's implemented)
More user friendly error page
Minor spelling error corrected
Table allowed_policy is respected while creating new issues
Broken vote now/later link is not shown anymore (until it's implemented)
More user friendly error page
Minor spelling error corrected
author | bsw |
---|---|
date | Sat Jan 02 12:00:00 2010 +0100 (2010-01-02) |
parents | 8d91bccab0bf |
children | 72c5e0ee7c98 |
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 local weight = 0
21 if member.weight then
22 weight = member.weight
23 end
24 if member.voter_weight then
25 weight = member.voter_weight
26 end
27 if (issue or initiative) and weight > 1 then
28 local module
29 if issue then
30 module = "interest"
31 elseif initiative then
32 if member.voter_weight then
33 module = "vote"
34 else
35 module = "supporter"
36 end
37 end
38 ui.link{
39 attr = { title = _"Number of incoming delegations, follow link to see more details" },
40 content = _("+ #{weight}", { weight = weight - 1 }),
41 module = module,
42 view = "show_incoming",
43 params = {
44 member_id = member.id,
45 initiative_id = initiative and initiative.id or nil,
46 issue_id = issue and issue.id or nil
47 }
48 }
49 else
50 slot.put(" ")
51 end
52 if member.grade then
53 ui.container{
54 content = function()
55 if member.grade > 0 then
56 ui.image{
57 attr = {
58 alt = _"Voted yes",
59 title = _"Voted yes"
60 },
61 static = "icons/16/thumb_up_green.png"
62 }
63 elseif member.grade < 0 then
64 ui.image{
65 attr = {
66 alt = _"Voted no",
67 title = _"Voted no"
68 },
69 static = "icons/16/thumb_down_red.png"
70 }
71 else
72 ui.image{
73 attr = {
74 alt = _"Abstention",
75 title = _"Abstention"
76 },
77 static = "icons/16/bullet_yellow.png"
78 }
79 end
80 end
81 }
82 end
83 if member.admin then
84 ui.image{
85 attr = {
86 alt = _"Member is administrator",
87 title = _"Member is administrator"
88 },
89 static = "icons/16/cog.png"
90 }
91 end
92 -- TODO performance
93 local contact = Contact:by_pk(app.session.member.id, member.id)
94 if contact then
95 ui.image{
96 attr = {
97 alt = _"You have saved this member as contact",
98 title = _"You have saved this member as contact"
99 },
100 static = "icons/16/bullet_disk.png"
101 }
102 end
103 end
104 }
106 ui.link{
107 attr = { title = _"Show member" },
108 module = "member",
109 view = "show",
110 id = member.id,
111 content = function()
112 execute.view{
113 module = "member_image",
114 view = "_show",
115 params = {
116 member = member,
117 image_type = "avatar",
118 show_dummy = true
119 }
120 }
121 ui.container{
122 attr = { class = "member_name" },
123 content = function()
124 slot.put(name)
125 end
126 }
127 end
128 }
129 end
130 }