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