Show
Ignore:
Timestamp:
06/29/07 16:05:08 (3 years ago)
Author:
JensDiemer
Message:

* new additional Stylesheet/JavaScript handling. A middleware puts the collected data into the page.
* middleware "pagestats" renamed to "additional_content".
* some code cleanup

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/0.8(django)/PyLucid/index.py

    r1121 r1127  
    4040from PyLucid.system.URLs import URLs 
    4141 
    42 from PyLucid.tools.content_processors import apply_markup, render_template 
     42from PyLucid.tools.content_processors import apply_markup, \ 
     43                                                        render_string_template 
    4344 
    4445 
     
    6364        ) 
    6465 
    65     current_page.content = render_template(current_page.content, context) 
     66    current_page.content = render_string_template(current_page.content, context) 
    6667 
    6768    template = current_page.template 
    6869    template_content = template.content 
    6970 
    70     html = render_template(template_content, context) 
    71  
    72 #    import cgi, pprint 
    73 #    print context 
    74 #    debug = "<hr/><pre>%s</pre></html>" % cgi.escape(pprint.pformat(context)) 
    75 #    html = html.replace("</html>", debug) 
    76  
     71    html = render_string_template(template_content, context) 
    7772    return HttpResponse(html) 
    7873 
     
    107102    # For additional JavaScript and StyleSheet information. 
    108103    # JS+CSS from internal_pages or CSS data for pygments 
     104    # Add into the context object. Would be integraged in the page with the 
     105    # additional_content middleware. 
    109106    context["js_data"] = [] 
    110107    context["css_data"] = [] 
     108 
     109    # Add the context to the reponse object. 
     110    # Used in PyLucid.middlewares.additional_content 
     111    request.CONTEXT = context 
    111112 
    112113    return context