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@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@178: local in_delegation_chain = false bsw@177: 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@177: 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@3: ui.container{ bsw@3: attr = { class = "flags" }, bsw@3: content = function() bsw/jbe@19: bsw@529: if not member.active then bsw@529: local text = _"inactive" bsw@529: ui.tag{ content = text } bsw@75: ui.image{ bsw@75: attr = { alt = text, title = text }, bsw@75: static = "icons/16/cross.png" bsw@75: } bsw@75: end bsw@75: bsw/jbe@19: if member.grade then bsw/jbe@19: ui.link{ bsw/jbe@19: module = "vote", bsw/jbe@19: view = "list", bsw/jbe@19: params = { bsw/jbe@19: issue_id = initiative.issue.id, bsw/jbe@19: member_id = member.id, bsw/jbe@19: }, bsw/jbe@19: content = function() bsw/jbe@19: if member.grade > 0 then bsw/jbe@19: ui.image{ bsw/jbe@19: attr = { bsw/jbe@19: alt = _"Voted yes", bsw/jbe@19: title = _"Voted yes" bsw/jbe@19: }, bsw/jbe@19: static = "icons/16/thumb_up_green.png" bsw/jbe@19: } bsw/jbe@19: elseif member.grade < 0 then bsw/jbe@19: ui.image{ bsw/jbe@19: attr = { bsw/jbe@19: alt = _"Voted no", bsw/jbe@19: title = _"Voted no" bsw/jbe@19: }, bsw/jbe@19: static = "icons/16/thumb_down_red.png" bsw/jbe@19: } bsw/jbe@19: else bsw/jbe@19: ui.image{ bsw/jbe@19: attr = { bsw/jbe@19: alt = _"Abstention", bsw/jbe@19: title = _"Abstention" bsw/jbe@19: }, bsw/jbe@19: static = "icons/16/bullet_yellow.png" bsw/jbe@19: } bsw/jbe@19: end bsw/jbe@19: end bsw/jbe@19: } bsw/jbe@19: end bsw/jbe@19: bsw/jbe@6: local weight = 0 bsw/jbe@6: if member.weight then bsw/jbe@6: weight = member.weight bsw/jbe@6: end bsw/jbe@6: if member.voter_weight then bsw/jbe@6: weight = member.voter_weight bsw/jbe@6: end bsw/jbe@6: if (issue or initiative) and weight > 1 then bsw@3: local module bsw@3: if issue then bsw@3: module = "interest" bsw@3: elseif initiative then bsw/jbe@6: if member.voter_weight then bsw/jbe@6: module = "vote" bsw/jbe@6: else bsw/jbe@6: module = "supporter" bsw/jbe@6: end bsw@3: end bsw@3: ui.link{ bsw@177: attr = { bsw@177: class = in_delegation_chain and "in_delegation_chain" or nil, bsw@177: title = _"Number of incoming delegations, follow link to see more details" bsw@177: }, bsw/jbe@6: content = _("+ #{weight}", { weight = weight - 1 }), bsw@3: module = module, bsw@3: view = "show_incoming", bsw@3: params = { bsw@3: member_id = member.id, bsw@3: initiative_id = initiative and initiative.id or nil, bsw@3: issue_id = issue and issue.id or nil bsw@3: } bsw@3: } bsw/jbe@6: end bsw/jbe@19: bsw@10: if initiator and initiator.accepted then bsw@10: if member.accepted == nil then bsw@10: slot.put(_"Invited") bsw@10: elseif member.accepted == false then bsw@10: slot.put(_"Rejected") bsw@10: end bsw@10: end bsw/jbe@19: bsw/jbe@19: if member.is_informed == false then bsw/jbe@19: local text = _"Member has not approved latest draft" bsw/jbe@19: ui.image{ bsw/jbe@19: attr = { alt = text, title = text }, bsw/jbe@19: static = "icons/16/help_yellow.png" bsw/jbe@6: } bsw@3: end bsw/jbe@19: bsw@3: end bsw@2: } bsw/jbe@4: bsw@3: ui.link{ bsw@3: attr = { title = _"Show member" }, bsw@3: module = "member", bsw@3: view = "show", bsw@3: id = member.id, bsw@3: content = function() bsw/jbe@4: execute.view{ bsw/jbe@4: module = "member_image", bsw/jbe@4: view = "_show", bsw/jbe@4: params = { bsw/jbe@4: member = member, bsw/jbe@4: image_type = "avatar", bsw/jbe@4: show_dummy = true bsw/jbe@4: } bsw@3: } bsw@3: ui.container{ bsw@3: attr = { class = "member_name" }, bsw@606: content = function() slot.put(name_html) end bsw@3: } bsw@3: end bsw@3: } bsw@2: end bsw@3: }