liquid_feedback_frontend
view env/util/micro_avatar.lua @ 1448:969d6aa521d6
Changed order in admin sidebar, added whitespace between links
| author | bsw | 
|---|---|
| date | Thu Oct 18 17:13:59 2018 +0200 (2018-10-18) | 
| parents | 32cc544d5a5b | 
| children | 70121e414479 | 
 line source
     1 function util.micro_avatar(member, member_name)
     2   if type ( member ) == "number" then
     3     member = {
     4       id = member,
     5       name = member_name
     6     }
     7   end
     9   local function doit()
    10     if config.fastpath_url_func then
    11       ui.image{
    12         attr = {
    13           title = member.name,
    14           class = "mdl-chip__contact"
    15         },
    16         external = config.fastpath_url_func(member.id, "avatar")
    17       }
    18     else
    19       ui.image {
    20         attr = {
    21           title = member.name,
    22           class = "mdl-chip__contact"
    23         },
    24         module = "member_image",
    25         view = "show",
    26         extension = "jpg",
    27         id = member.id,
    28         params = {
    29           image_type = "avatar"
    30         }
    31       } 
    32     end
    33     ui.tag { attr = { class = "mdl-chip__text" }, content = member.name }
    34   end
    36   ui.tag {
    37     attr = { class = "microAvatar" },
    38     content = function ()
    39       if app.session:has_access("everything") then
    40         ui.link {
    41 	  attr = { class = "mdl-chip mdl-chip--contact" },
    42           module = "member", view = "show", id = member.id,
    43           content = doit
    44         }
    45       else
    46         ui.tag{ 
    47 	  attr = { class = "mdl-chip mdl-chip--contact" },
    48 	  content = doit 
    49 	}
    50       end
    51     end
    52   }
    53 end
