Project

General

Profile

« Previous | Next » 

Revision 6f1fb6bd

Added by Frédéric Péters almost 14 years ago

Fixed display of error pages

View differences:

extra/modules/template.py
1
from quixote import get_request, get_publisher
1
from quixote import get_request, get_publisher, get_response
2
from quixote.html import htmltext
2 3

  
3 4
from qommon import template
4 5
from wcs.categories import Category
5 6

  
6 7
wcs_decorate = template.decorate
8
wcs_error_page = template.error_page
7 9

  
8 10
def decorate(body, response):
9 11
    body = str(body)
......
40 42
            section_title = '<h2 id="services">%s</h2>\n' % _('Services')
41 43
            response.filter['bigdiv'] = 'rub_service'
42 44

  
43
    if not 'auquotiden-no-titles-in-section' in response.filter.get('keywords', []):
45
    if not 'auquotidien-no-titles-in-section' in response.filter.get('keywords', []):
44 46
        if page_title:
45 47
            if section_title:
46 48
                page_title = '<h3>%s</h3>' % page_title
......
57 59

  
58 60
    return wcs_decorate(body, response)
59 61

  
60
template.decorate = decorate
61 62

  
63
def error_page(*args, **kwargs):
64
    get_response().filter['keywords'] = template.get_current_theme().get('keywords')
65
    get_response().filter['title'] = template.get_current_theme().get('keywords')
66
    error_page = wcs_error_page(*args, **kwargs)
67
    title = get_response().filter['title']
68
    get_response().filter['title'] = None
69
    return htmltext('<div id="info"><h2>%s</h2>' % title) + error_page + htmltext('</div>')
70

  
71
template.decorate = decorate
72
template.error_page = error_page

Also available in: Unified diff