liquid_feedback_frontend

annotate app/main/member/_show_thumb.lua @ 4:80c215dbf076

Version alpha5

Many optical changes and improved usability

Support for different wiki-formatting-engines

Help system
author bsw/jbe
date Thu Dec 10 12:00:00 2009 +0100 (2009-12-10)
parents 768faea1096d
children 8d91bccab0bf
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/jbe@4 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/jbe@4 68 execute.view{
bsw/jbe@4 69 module = "member_image",
bsw/jbe@4 70 view = "_show",
bsw/jbe@4 71 params = {
bsw/jbe@4 72 member = member,
bsw/jbe@4 73 image_type = "avatar",
bsw/jbe@4 74 show_dummy = true
bsw/jbe@4 75 }
bsw@3 76 }
bsw@3 77 ui.container{
bsw@3 78 attr = { class = "member_name" },
bsw@3 79 content = function()
bsw@3 80 slot.put(name)
bsw@3 81 end
bsw@3 82 }
bsw@3 83 end
bsw@3 84 }
bsw@2 85 end
bsw@3 86 }

Impressum / About Us