liquid_feedback_frontend

annotate env/util/micro_avatar.lua @ 1160:65904de98d5e

Fixed basepath for image delivery with WebMCP 1.2.6
author bsw
date Tue Mar 24 12:36:19 2015 +0100 (2015-03-24)
parents 904f6807f7fa
children 32cc544d5a5b
rev   line source
bsw@1045 1 function util.micro_avatar(member, member_name)
bsw@1045 2 if type ( member ) == "number" then
bsw@1045 3 member = {
bsw@1045 4 id = member,
bsw@1045 5 name = member_name
bsw@1045 6 }
bsw@1045 7 end
bsw@1045 8
bsw@1145 9 local function doit()
bsw@1045 10 if config.fastpath_url_func then
bsw@1045 11 ui.image{
bsw@1045 12 attr = {
bsw@1045 13 title = member.name,
bsw@1045 14 class = "microAvatar"
bsw@1045 15 },
bsw@1045 16 external = config.fastpath_url_func(member.id, "avatar")
bsw@1045 17 }
bsw@1045 18 else
bsw@1045 19 ui.image {
bsw@1045 20 attr = {
bsw@1045 21 title = member.name,
bsw@1045 22 class = "microAvatar"
bsw@1045 23 },
bsw@1045 24 module = "member_image",
bsw@1045 25 view = "show",
bsw@1045 26 extension = "jpg",
bsw@1045 27 id = member.id,
bsw@1045 28 params = {
bsw@1045 29 image_type = "avatar"
bsw@1045 30 }
bsw@1045 31 }
bsw@1045 32 end
bsw@1045 33 ui.tag { tag = "span", content = member.name }
bsw@1045 34 end
bsw@1045 35
bsw@1045 36 ui.tag {
bsw@1045 37 attr = { class = "microAvatar" },
bsw@1045 38 content = function ()
bsw@1045 39 if app.session:has_access("everything") then
bsw@1045 40 ui.link {
bsw@1045 41 module = "member", view = "show", id = member.id,
bsw@1045 42 content = doit
bsw@1045 43 }
bsw@1045 44 else
bsw@1045 45 ui.tag{ content = doit }
bsw@1045 46 end
bsw@1045 47 end
bsw@1045 48 }
bsw@1045 49 end

Impressum / About Us