annotate app/main/member_image/_show.lua @ 1218:bb10f001443e
Fixed syntax error in unit sidebar occured after last bug fix again again
 | author | 
 bsw | 
 | date | 
 Mon Jul 27 23:33:26 2015 +0200 (2015-07-27) | 
 | parents | 
 8874448bbb7a  | 
 | children | 
 32cc544d5a5b  | 
 
 | rev | 
   line source | 
| 
bsw/jbe@4
 | 
     1 local member = param.get("member", "table")
 | 
| 
bsw@525
 | 
     2 local member_id = member and member.id or param.get("member_id", atom.integer)
 | 
| 
bsw@525
 | 
     3 
 | 
| 
bsw/jbe@4
 | 
     4 local image_type = param.get("image_type")
 | 
| 
bsw@274
 | 
     5 local class = param.get("class")
 | 
| 
bsw@274
 | 
     6 local popup_text = param.get("popup_text")
 | 
| 
bsw@274
 | 
     7 
 | 
| 
bsw@1148
 | 
     8 local force_update = param.get("force_update", atom.boolean)
 | 
| 
bsw@1148
 | 
     9 
 | 
| 
bsw@274
 | 
    10 if class then
 | 
| 
bsw@274
 | 
    11   class = " " .. class
 | 
| 
bsw@274
 | 
    12 else
 | 
| 
bsw@274
 | 
    13   class = ""
 | 
| 
bsw@274
 | 
    14 end
 | 
| 
bsw/jbe@4
 | 
    15 
 | 
| 
poelzi@154
 | 
    16 
 | 
| 
bsw@720
 | 
    17 if config.fastpath_url_func then
 | 
| 
bsw@720
 | 
    18   ui.image{
 | 
| 
bsw@720
 | 
    19     attr = { title = popup_text, class = "member_image member_image_" .. image_type .. class },
 | 
| 
bsw@721
 | 
    20     external = config.fastpath_url_func(member_id, image_type)
 | 
| 
bsw@720
 | 
    21   }
 | 
| 
bsw@720
 | 
    22 else
 | 
| 
bsw@720
 | 
    23   ui.image{
 | 
| 
bsw@720
 | 
    24     attr = { title = popup_text, class = "member_image member_image_" .. image_type .. class },
 | 
| 
bsw@720
 | 
    25     module = "member_image",
 | 
| 
bsw@720
 | 
    26     view = "show",
 | 
| 
bsw@720
 | 
    27     extension = "jpg",
 | 
| 
bsw@720
 | 
    28     id = member_id,
 | 
| 
bsw@720
 | 
    29     params = {
 | 
| 
bsw@1148
 | 
    30       image_type = image_type,
 | 
| 
bsw@1148
 | 
    31       dynamic = force_update and os.time() or nil
 | 
| 
bsw/jbe@4
 | 
    32     }
 | 
| 
bsw@720
 | 
    33   }
 | 
| 
bsw/jbe@4
 | 
    34 end
 |