liquid_feedback_frontend

view app/main/lf2/_avatars.lua @ 216:4f6e6b213fb8

Cleanup on second generation frontend code and stylesheet
author bsw
date Mon Mar 07 12:15:22 2011 +0100 (2011-03-07)
parents 3e4ad069847a
children 73dbc9e2bfd4
line source
1 local members = param.get("members", "table")
2 local hidefirst = param.get("hidefirst", atom.boolean)
3 local size = param.get("size") or "normal"
4 local issue_id = param.get("issue_id", atom.integer)
6 ui.container{ attr = { class = "avatars " .. size }, content = function()
7 for i, member in ipairs(members) do
8 local class = "arrow"
9 if member.overridden then
10 class = class .. " overridden"
11 end
12 local image
13 local text
14 if member.scope_in == "global" then
15 image = "lf2/icon_delegation_global.png"
16 text = _"Global delegation"
17 elseif member.scope_in == "area" then
18 image = "lf2/icon_delegation_area.png"
19 text = _"Area delegation"
20 elseif member.scope_in == "issue" then
21 image = "lf2/icon_delegation.png"
22 text = _"Issue delegation"
23 end
24 if param.get("arrows", atom.boolean) and (i > 1) then
25 ui.image{ attr = { title = text, alt = text, class = class }, static = image }
26 slot.put(member.scope)
27 end
28 if not hidefirst or i > 1 then
29 local class = "avatar"
30 if member.participation then
31 class = class .. " participation"
32 end
33 if member.overridden then
34 class = class .. " overridden"
35 end
36 local args = { attr = { class = class, title = member.name }, content = function()
37 ui.avatar(member, size)
38 --ui.image{ module = "member_image", view = "show", id = member.id, params = { image_type = "avatar" } }
39 if size == "normal" then
40 ui.container{ attr = { class = "name" }, content = member.name }
41 end
42 if size == "small" and member.weight ~= nil then
43 ui.container{ attr = { class = "weight" }, content = member.weight }
44 end
45 end }
46 if issue_id then
47 args.module = "lf2"
48 args.view = "interest"
49 args.params = { issue_id = issue_id, member_id = member.id }
50 ui.link(args)
51 else
52 ui.container(args)
53 end
54 end
55 end
56 end }

Impressum / About Us