liquid_feedback_frontend

annotate app/main/lf2/_avatars.lua @ 220:ff5d30b19315

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

Impressum / About Us