Пример #1
0
    def render(self, context, instance, placeholder):
        view = self.get_detail_view(context['request'], instance.node, opts=instance)
        context.update(view.get_context_data())
        if instance.link_type:
            context[view.context_object_name].link = PluginLink.create_from(instance)

        return context
Пример #2
0
    def render(self, context, instance, placeholder):
        view = self.get_detail_view(context['request'], instance.node, opts=instance)
        context.update(view.get_context_data())
        if instance.link_type:
            context[view.context_object_name].link = PluginLink.create_from(instance)

        return context
Пример #3
0
    def render(self, context, instance, placeholder):
        instance.node.link = PluginLink.create_from(instance)
        context.update({
            'image_node': instance.node,
        })
        if instance.width or instance.height:
            w = instance.width or widthratio(instance.height, instance.node.height, instance.node.width)
            h = instance.height or widthratio(instance.width, instance.node.width, instance.node.height)
            context.update({'thumbnail_size': (w, h)})

        return context
Пример #4
0
    def render(self, context, instance, placeholder):
        instance.node.link = PluginLink.create_from(instance)
        context.update({
            'image_node': instance.node,
        })
        if instance.width or instance.height:
            w = instance.width or widthratio(
                instance.height, instance.node.height, instance.node.width)
            h = instance.height or widthratio(
                instance.width, instance.node.width, instance.node.height)
            context.update({'thumbnail_size': (w, h)})

        return context