Project

General

Profile

« Previous | Next » 

Revision 01908fa1

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

Possibility to add some assistance text in error pages

View differences:

extra/modules/template.py
2 2
from quixote.html import htmltext
3 3

  
4 4
from qommon import template
5
from qommon.admin.texts import TextsDirectory
5 6
from wcs.categories import Category
6 7

  
7 8
wcs_decorate = template.decorate
......
23 24

  
24 25
    section_title = ''
25 26
    page_title = response.filter.get('title')
26
    if section == 'consultations':
27
    if 'error-page' in response.filter:
28
        pass
29
    elif section == 'consultations':
27 30
        section_title = '<h2 id="consultations">%s</h2>\n' % _('Consultations')
28 31
        response.filter['bigdiv'] = 'rub_consultation'
29 32
    elif section == 'announces':
......
61 64

  
62 65

  
63 66
def error_page(*args, **kwargs):
67
    get_response().filter = {}
68
    get_response().filter['error-page'] = None
64 69
    get_response().filter['keywords'] = template.get_current_theme().get('keywords')
65 70
    get_response().filter['title'] = template.get_current_theme().get('keywords')
71
    get_response().filter['gauche'] = TextsDirectory.get_html_text('aq-error-assistance')
66 72
    error_page = wcs_error_page(*args, **kwargs)
67 73
    title = get_response().filter['title']
68 74
    get_response().filter['title'] = None
......
70 76

  
71 77
template.decorate = decorate
72 78
template.error_page = error_page
79

  
80

  
81
TextsDirectory.register('aq-error-assistance', N_('Assistance text next to errors'))

Also available in: Unified diff