bsw@211: local members = param.get("members", "table") bsw@211: local hidefirst = param.get("hidefirst", atom.boolean) bsw@211: local size = param.get("size") or "normal" bsw@211: bsw@211: local first_participation = true bsw@211: bsw@211: ui.container{ attr = { class = "avatars " .. size }, content = function() bsw@211: for i, member in ipairs(members) do bsw@211: local class = "arrow" bsw@211: if member.overridden then bsw@211: class = class .. " overridden" bsw@211: end bsw@211: local image bsw@211: local text bsw@211: if member.scope_in == "global" then bsw@211: image = "lf2/icon_delegation_global.png" bsw@211: text = _"Global delegation" bsw@211: elseif member.scope_in == "area" then bsw@211: image = "lf2/icon_delegation_area.png" bsw@211: text = _"Area delegation" bsw@211: elseif member.scope_in == "issue" then bsw@211: image = "lf2/icon_delegation.png" bsw@211: text = _"Issue delegation" bsw@211: end bsw@212: if param.get("arrows", atom.boolean) and (i > 1) then bsw@211: ui.image{ attr = { title = text, alt = text, class = class }, static = image } bsw@211: slot.put(member.scope) bsw@211: end bsw@211: if not hidefirst or i > 1 then bsw@211: local class = "avatar" bsw@211: if first_participation and member.participation then bsw@211: class = class .. " participation" bsw@211: first_participation = false bsw@211: end bsw@211: if member.overridden then bsw@211: class = class .. " overridden" bsw@211: end bsw@211: ui.container{ attr = { class = class, title = member.name }, content = function() bsw@211: ui.avatar(member, size) bsw@211: --ui.image{ module = "member_image", view = "show", id = member.id, params = { image_type = "avatar" } } bsw@211: if size == "normal" then bsw@211: ui.container{ attr = { class = "name" }, content = member.name } bsw@211: end bsw@211: if size == "small" and member.weight ~= nil then bsw@211: ui.container{ attr = { class = "weight" }, content = member.weight } bsw@211: end bsw@211: end } bsw@211: end bsw@211: end bsw@211: end } bsw@211: