Example #1
0
 def admin_thumb(*args):
     obj = args[1 if for_admin else 0]
     return '<a href="{url}"><img height="{height}" src="{src}" /></a>'.format(
         url=url_to_edit_object(obj),
         height=height,
         width=width,
         src=get_resized_image(obj.image, height=height, width=width)
     )
Example #2
0
    def admin_thumb(*args):
        obj = args[1 if for_admin else 0]
        vid = obj.original if isinstance(obj, ConvertedVideo) else obj

        screens = vid.screen.all()
        if len(screens) > 1:
            screen = screens[1]
        else:
            screen = screens[0]
        return '<a href="{url}"><img height="{height}" src="{src}" /></a>'.format(
            url=url_to_edit_object(obj),
            height=height,
            src=get_resized_image(screen.image, height=height, width=width)
        )