bsw@10: local initiator = param.get("initiator", "table") bsw@2: local member = param.get("member", "table") bsw@2: bsw@3: local issue = param.get("issue", "table") bsw@3: local initiative = param.get("initiative", "table") bsw@3: local trustee = param.get("trustee", "table") bsw@3: bsw@1045: local class = param.get("class") bsw@1045: bsw@606: local name_html bsw@2: if member.name_highlighted then bsw@606: name_html = encode.highlight(member.name_highlighted) bsw@2: else bsw@606: name_html = encode.html(member.name) bsw@2: end bsw@2: bsw@10: local container_class = "member_thumb" bsw@10: if initiator and member.accepted ~= true then bsw@10: container_class = container_class .. " not_accepted" bsw@10: end bsw@10: bsw/jbe@19: if member.is_informed == false then bsw/jbe@19: container_class = container_class .. " not_informed" bsw/jbe@19: end bsw/jbe@19: bsw@1045: if class then bsw@1045: container_class = container_class .. " " .. class bsw@1045: end bsw@1045: bsw@1045: local in_delegation_chain = member.in_delegation_chain bsw@1045: --[[if member.delegate_member_ids then bsw@177: for member_id in member.delegate_member_ids:gmatch("(%w+)") do bsw@177: if tonumber(member_id) == member.id then bsw@177: in_delegation_chain = true bsw@177: end bsw@177: end bsw@177: end bsw@1045: --]] bsw@179: if in_delegation_chain or ((issue or initiative) and member.id == app.session.member_id) then bsw@177: container_class = container_class .. " in_delegation_chain" bsw@177: end bsw@177: bsw@3: ui.container{ bsw@10: attr = { class = container_class }, bsw@2: content = function() bsw@1045: bsw@1045: local function doit() bsw@1045: execute.view{ bsw@1045: module = "member_image", bsw@1045: view = "_show", bsw@1045: params = { bsw@1045: member = member, bsw@1045: image_type = "avatar", bsw@1045: show_dummy = true bsw@1045: } bsw@1045: } bsw@1045: ui.tag{ bsw@1045: attr = { class = "member_name" }, bsw@1045: content = function() slot.put(name_html) end bsw@1045: } bsw@1045: end bsw@1045: bsw@1045: if app.session:has_access("everything") then bsw@1045: ui.link{ bsw@1045: attr = { title = _"Show member" }, bsw@1045: module = "member", bsw@1045: view = "show", bsw@1045: id = member.id, bsw@1045: content = doit bsw@1045: } bsw@1045: else bsw@1045: ui.tag{ content = doit } bsw@1045: end bsw/jbe@19: bsw@1045: if member.grade then bsw@1045: slot.put ( " " ) bsw@1045: ui.link{ bsw@1045: module = "vote", bsw@1045: view = "list", bsw@1045: params = { bsw@1045: issue_id = initiative.issue.id, bsw@1045: member_id = member.id, bsw@1045: }, bsw@1045: content = function() bsw@1045: if member.grade > 0 then bsw@1045: ui.image{ bsw@1045: attr = { bsw@1045: alt = _"Voted yes", bsw@1045: title = _"Voted yes", bsw@1045: class = "icon24 right" bsw@1045: }, bsw@1045: static = "icons/32/support_satisfied.png" bsw@1045: } bsw@1045: elseif member.grade < 0 then bsw@1045: ui.image{ bsw@1045: attr = { bsw@1045: alt = _"Voted no", bsw@1045: title = _"Voted no", bsw@1045: class = "icon24 right" bsw@1045: }, bsw@1045: static = "icons/32/voted_no.png" bsw@1045: } bsw@1045: else bsw@1045: ui.image{ bsw@1045: attr = { bsw@1045: alt = _"Abstention", bsw@1045: title = _"Abstention", bsw@1045: class = "icon24 right" bsw@1045: }, bsw@1045: static = "icons/16/bullet_yellow.png" bsw@1045: } bsw@1045: end bsw@1045: end bsw@1045: } bsw@1045: end bsw@1045: bsw@1045: if (member.voter_comment) then bsw@1045: ui.link{ bsw@1045: module = "vote", bsw@1045: view = "list", bsw@1045: params = { bsw@1045: issue_id = issue.id, bsw@1045: member_id = member.id, bsw@1045: }, bsw@1045: content = function() bsw@75: ui.image{ bsw@1045: attr = { bsw@1045: alt = _"Voting comment available", bsw@1045: title = _"Voting comment available", bsw@1045: class = "icon24 right" bsw/jbe@19: }, bsw@1045: static = "icons/16/comment.png" bsw/jbe@19: } bsw/jbe@19: end bsw@1045: } bsw@1045: end bsw/jbe@19: bsw@1045: local weight = 0 bsw@1045: if member.weight then bsw@1045: weight = member.weight bsw@1045: end bsw@1045: if member.voter_weight then bsw@1045: weight = member.voter_weight bsw@1045: end bsw@1045: bsw@1045: if (issue or initiative) and weight > 1 then bsw@1045: local module = "interest" bsw@1045: if member.voter_weight then bsw@1045: module = "vote" bsw@1045: end bsw@879: bsw@1045: slot.put ( " " ) bsw@1045: ui.link{ bsw@1045: attr = { bsw@1045: class = in_delegation_chain and "in_delegation_chain" or nil, bsw@1045: title = _"Number of incoming delegations, follow link to see more details" bsw@1045: }, bsw@1045: content = _("+ #{weight}", { weight = weight - 1 }), bsw@1045: module = module, bsw@1045: view = "show_incoming", bsw@1045: params = { bsw@1045: member_id = member.id, bsw@1045: initiative_id = initiative and initiative.id or nil, bsw@1045: issue_id = issue and issue.id or nil bsw@1045: } bsw@1045: } bsw@1045: end bsw@1045: bsw@1045: if member.supporter then bsw@1045: slot.put ( " " ) bsw@1045: if member.supporter_satisfied then bsw@1045: local text = _"supporter" bsw@1045: ui.image{ attr = { class = "icon24 right", alt = text, title = text }, static = "icons/32/support_satisfied.png" } bsw@1045: else bsw@1045: local text = _"supporter with restricting suggestions" bsw@1045: ui.image{ attr = { class = "icon24 right", alt = text, title = text }, static = "icons/32/support_unsatisfied.png" } bsw@3: end bsw@1045: end bsw/jbe@4: bsw@1045: if not member.active then bsw@1045: slot.put ( " " ) bsw@1045: local text = _"member inactive" bsw@1045: ui.image{ bsw@1045: attr = { alt = text, title = text }, bsw@1045: static = "icons/16/cross.png" bsw@1045: } bsw@1045: ui.tag{ content = _"inactive" } bsw@1045: end bsw@1045: bsw@1045: if initiator and initiator.accepted then bsw@1045: if member.accepted == nil then bsw@1045: slot.put(_"Invited") bsw@1045: elseif member.accepted == false then bsw@1045: slot.put(_"Rejected") bsw@3: end bsw@1045: end bsw@1045: bsw@1045: if member.is_informed == false then bsw@1045: local text = _"Member has not approved latest draft" bsw@1045: ui.image{ bsw@1045: attr = { alt = text, title = text }, bsw@1045: static = "icons/16/help_yellow.png" bsw@1045: } bsw@1045: end bsw@1045: bsw@2: end bsw@3: }