1
|
from quixote import get_publisher, get_request, redirect
|
2
|
from quixote.directory import Directory
|
3
|
from quixote.html import htmltext
|
4
|
|
5
|
import os
|
6
|
|
7
|
import wcs
|
8
|
import wcs.forms.root
|
9
|
import wcs.forms.preview
|
10
|
from qommon import template
|
11
|
from qommon import errors
|
12
|
from qommon.form import *
|
13
|
from wcs.roles import logged_users_role
|
14
|
|
15
|
from qommon import emails
|
16
|
|
17
|
OldFormPage = wcs.forms.root.FormPage
|
18
|
|
19
|
class AlternateFormPage(OldFormPage):
|
20
|
def form_side(self, *args, **kwargs):
|
21
|
form_side_html = OldFormPage.form_side(self, *args, **kwargs)
|
22
|
# add a 'Steps' title
|
23
|
form_side_html = str(form_side_html).replace('<ol>', '<h2>%s</h2>\n<ol>' % _('Steps'))
|
24
|
get_response().filter['gauche'] = form_side_html
|
25
|
get_response().filter['steps'] = form_side_html
|
26
|
return
|
27
|
|
28
|
wcs.forms.root.FormPage = AlternateFormPage
|
29
|
wcs.forms.root.PublicFormStatusPage.form_page_class = AlternateFormPage
|
30
|
wcs.forms.preview.PreviewFormPage.__bases__ = (AlternateFormPage,)
|
31
|
|
32
|
|
33
|
OldFormsRootDirectory = wcs.forms.root.RootDirectory
|
34
|
|
35
|
class AlternateFormsRootDirectory(OldFormsRootDirectory):
|
36
|
def form_list(self, *args, **kwargs):
|
37
|
form_list = OldFormsRootDirectory.form_list(self, *args, **kwargs)
|
38
|
return htmltext(str(form_list).replace('h2>', 'h3>'))
|
39
|
|
40
|
wcs.forms.root.RootDirectory = AlternateFormsRootDirectory
|