Пример #1
0
def folder_view(context, request):

    template = context.template()

    if context.custom_view:
        template = context.custom_view

    default_content = None
    result = ""
    alt_body = ""

    logging.info('Original folder_view')

    if context.default_content and context.default_content in context.contentNames(
    ):
        default_content = context[context.default_content]

        alt_body = render_template('replaceable_body.pt',
                                   request=request,
                                   context=default_content,
                                   template_name=default_content.template())

    result = render_template_to_response(template,
                                         request=request,
                                         context=context,
                                         alt_body=alt_body)

    return result
Пример #2
0
def folder_view(context, request):
 
    template = context.template()
    
    if context.custom_view:
        template = context.custom_view
        
    default_content = None
    result = ""
    alt_body = ""
  
    logging.info('Original folder_view')
    
    if context.default_content and context.default_content in context.contentNames():
        default_content=context[context.default_content]
        
        alt_body  = render_template('replaceable_body.pt',
                                       request = request,
                                       context = default_content,
                                       template_name = default_content.template()
                                       )
        
    result = render_template_to_response(template,
                                       request = request,
                                       context = context,
                                       alt_body = alt_body
                                       )
    
    return result                                                                          
Пример #3
0
    def __call__(self):

        template = self.template

        if self.portlet.portlet_template:
            template = self.portlet.portlet_template

        return render_template(template,
                               request=self.request,
                               context=self.context,
                               portlet=self.portlet,
                               view=self,
                               root=self.root)
Пример #4
0
 def __call__(self):
     
     template = self.template
     
     if self.portlet.portlet_template:
         template = self.portlet.portlet_template
   
     return render_template(template,
         request=self.request,
         context=self.context,
         portlet=self.portlet,
         view=self,
         root=self.root)