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@2: local name bsw@2: if member.name_highlighted then bsw@2: name = encode.highlight(member.name_highlighted) bsw@2: else bsw@2: name = encode.html(member.name) bsw@2: end bsw@2: bsw@3: ui.container{ bsw@2: attr = { class = "member_thumb" }, bsw@2: content = function() bsw@3: ui.container{ bsw@3: attr = { class = "flags" }, bsw@3: content = function() bsw@3: if (issue or initiative) and member.weight > 1 then bsw@3: local module bsw@3: if issue then bsw@3: module = "interest" bsw@3: elseif initiative then bsw@3: module = "supporter" bsw@3: end bsw@3: ui.link{ bsw@3: attr = { title = _"Number of incoming delegations, follow link to see more details" }, bsw@3: content = _("+ #{weight}", { weight = member.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@3: end bsw@3: if member.admin then bsw@3: ui.image{ bsw@3: attr = { bsw@3: alt = _"Member is administrator", bsw@3: title = _"Member is administrator" bsw@3: }, bsw@3: static = "icons/16/cog.png" bsw@3: } bsw@3: end bsw@3: -- TODO performance bsw@3: local contact = Contact:by_pk(app.session.member.id, member.id) bsw@3: if contact then bsw@3: ui.image{ bsw@3: attr = { bsw@3: alt = _"You have saved this member as contact", bsw@3: title = _"You have saved this member as contact" bsw@3: }, bsw@3: static = "icons/16/bullet_disk.png" bsw@3: } bsw@3: end bsw@3: end bsw@2: } bsw@3: 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@3: ui.image{ bsw@3: attr = { width = 48, height = 48 }, bsw@3: module = "member", bsw@3: view = "avatar", bsw@3: id = member.id, bsw@3: extension = "jpg" bsw@3: } bsw@3: ui.container{ bsw@3: attr = { class = "member_name" }, bsw@3: content = function() bsw@3: slot.put(name) bsw@3: end bsw@3: } bsw@3: end bsw@3: } bsw@2: end bsw@3: }