liquid_feedback_frontend
annotate app/main/member/_show_thumb.lua @ 3:768faea1096d
Version alpha4
Members interested in an issue or supporting an initiative have a weight information attached. Browsing the members causing that weight is possible.
Initiatives may provide a link to an external discussion platform
Direct link on every initiative page to create an alternative initiative
Bugfix: No error when clicking "neutral", when "neutral" is currently selected
Members interested in an issue or supporting an initiative have a weight information attached. Browsing the members causing that weight is possible.
Initiatives may provide a link to an external discussion platform
Direct link on every initiative page to create an alternative initiative
Bugfix: No error when clicking "neutral", when "neutral" is currently selected
| author | bsw | 
|---|---|
| date | Mon Nov 30 12:00:00 2009 +0100 (2009-11-30) | 
| parents | 5c601807d397 | 
| children | 80c215dbf076 | 
| rev | line source | 
|---|---|
| bsw@2 | 1 local member = param.get("member", "table") | 
| bsw@2 | 2 | 
| bsw@3 | 3 local issue = param.get("issue", "table") | 
| bsw@3 | 4 local initiative = param.get("initiative", "table") | 
| bsw@3 | 5 local trustee = param.get("trustee", "table") | 
| bsw@3 | 6 | 
| bsw@2 | 7 local name | 
| bsw@2 | 8 if member.name_highlighted then | 
| bsw@2 | 9 name = encode.highlight(member.name_highlighted) | 
| bsw@2 | 10 else | 
| bsw@2 | 11 name = encode.html(member.name) | 
| bsw@2 | 12 end | 
| bsw@2 | 13 | 
| bsw@3 | 14 ui.container{ | 
| bsw@2 | 15 attr = { class = "member_thumb" }, | 
| bsw@2 | 16 content = function() | 
| bsw@3 | 17 ui.container{ | 
| bsw@3 | 18 attr = { class = "flags" }, | 
| bsw@3 | 19 content = function() | 
| bsw@3 | 20 if (issue or initiative) and member.weight > 1 then | 
| bsw@3 | 21 local module | 
| bsw@3 | 22 if issue then | 
| bsw@3 | 23 module = "interest" | 
| bsw@3 | 24 elseif initiative then | 
| bsw@3 | 25 module = "supporter" | 
| bsw@3 | 26 end | 
| bsw@3 | 27 ui.link{ | 
| bsw@3 | 28 attr = { title = _"Number of incoming delegations, follow link to see more details" }, | 
| bsw@3 | 29 content = _("+ #{weight}", { weight = member.weight - 1 }), | 
| bsw@3 | 30 module = module, | 
| bsw@3 | 31 view = "show_incoming", | 
| bsw@3 | 32 params = { | 
| bsw@3 | 33 member_id = member.id, | 
| bsw@3 | 34 initiative_id = initiative and initiative.id or nil, | 
| bsw@3 | 35 issue_id = issue and issue.id or nil | 
| bsw@3 | 36 } | 
| bsw@3 | 37 } | 
| bsw@3 | 38 end | 
| bsw@3 | 39 if member.admin then | 
| bsw@3 | 40 ui.image{ | 
| bsw@3 | 41 attr = { | 
| bsw@3 | 42 alt = _"Member is administrator", | 
| bsw@3 | 43 title = _"Member is administrator" | 
| bsw@3 | 44 }, | 
| bsw@3 | 45 static = "icons/16/cog.png" | 
| bsw@3 | 46 } | 
| bsw@3 | 47 end | 
| bsw@3 | 48 -- TODO performance | 
| bsw@3 | 49 local contact = Contact:by_pk(app.session.member.id, member.id) | 
| bsw@3 | 50 if contact then | 
| bsw@3 | 51 ui.image{ | 
| bsw@3 | 52 attr = { | 
| bsw@3 | 53 alt = _"You have saved this member as contact", | 
| bsw@3 | 54 title = _"You have saved this member as contact" | 
| bsw@3 | 55 }, | 
| bsw@3 | 56 static = "icons/16/bullet_disk.png" | 
| bsw@3 | 57 } | 
| bsw@3 | 58 end | 
| bsw@3 | 59 end | 
| bsw@2 | 60 } | 
| bsw@3 | 61 | 
| bsw@3 | 62 ui.link{ | 
| bsw@3 | 63 attr = { title = _"Show member" }, | 
| bsw@3 | 64 module = "member", | 
| bsw@3 | 65 view = "show", | 
| bsw@3 | 66 id = member.id, | 
| bsw@3 | 67 content = function() | 
| bsw@3 | 68 ui.image{ | 
| bsw@3 | 69 attr = { width = 48, height = 48 }, | 
| bsw@3 | 70 module = "member", | 
| bsw@3 | 71 view = "avatar", | 
| bsw@3 | 72 id = member.id, | 
| bsw@3 | 73 extension = "jpg" | 
| bsw@3 | 74 } | 
| bsw@3 | 75 ui.container{ | 
| bsw@3 | 76 attr = { class = "member_name" }, | 
| bsw@3 | 77 content = function() | 
| bsw@3 | 78 slot.put(name) | 
| bsw@3 | 79 end | 
| bsw@3 | 80 } | 
| bsw@3 | 81 end | 
| bsw@3 | 82 } | 
| bsw@2 | 83 end | 
| bsw@3 | 84 } |