Skip to content

Commit d21bf14

Browse files
author
Richard Jones
committed
*** empty log message ***
1 parent f274ab6 commit d21bf14

File tree

3 files changed

+33
-18
lines changed

3 files changed

+33
-18
lines changed

roundup/cgi_client.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: cgi_client.py,v 1.105 2002-02-20 05:52:10 richard Exp $
18+
# $Id: cgi_client.py,v 1.106 2002-02-21 06:23:00 richard Exp $
1919

2020
__doc__ = """
2121
WWW request handler (also used in the stand-alone server).
@@ -52,6 +52,11 @@ def __init__(self, instance, request, env, form=None):
5252
self.env = env
5353
self.path = env['PATH_INFO']
5454
self.split_path = self.path.split('/')
55+
url = self.env['SCRIPT_NAME'] + '/'
56+
machine = self.env['SERVER_NAME']
57+
port = self.env['SERVER_PORT']
58+
if port != '80': machine = machine + ':' + port
59+
self.base = urlparse.urlunparse(('http', machine, url, None,None,None))
5560

5661
if form is None:
5762
self.form = cgi.FieldStorage(environ=env)
@@ -80,7 +85,7 @@ def header(self, headers={'Content-Type':'text/html'}):
8085
if self.debug:
8186
self.headers_sent = headers
8287

83-
single_submit_script = '''
88+
global_javascript = '''
8489
<script language="javascript">
8590
submitted = false;
8691
function submit_once() {
@@ -91,15 +96,14 @@ def header(self, headers={'Content-Type':'text/html'}):
9196
submitted = true;
9297
return 1;
9398
}
99+
function help_window(helpurl) {
100+
helpwin = window.open(%(base)s + helpurl, 'HelpWindow',
101+
'scrollbars=yes,resizable=yes,toolbar=no,height=400,width=400');
102+
}
94103
</script>
95104
'''
96105

97106
def pagehead(self, title, message=None):
98-
url = self.env['SCRIPT_NAME'] + '/'
99-
machine = self.env['SERVER_NAME']
100-
port = self.env['SERVER_PORT']
101-
if port != '80': machine = machine + ':' + port
102-
base = urlparse.urlunparse(('http', machine, url, None, None, None))
103107
if message is not None:
104108
message = _('<div class="system-msg">%(message)s</div>')%locals()
105109
else:
@@ -127,12 +131,12 @@ def pagehead(self, title, message=None):
127131
''')
128132
else:
129133
add_links = ''
130-
single_submit_script = self.single_submit_script
134+
global_javascript = self.global_javascript%self.__dict__
131135
self.write(_('''<html><head>
132136
<title>%(title)s</title>
133137
<style type="text/css">%(style)s</style>
134138
</head>
135-
%(single_submit_script)s
139+
%(global_javascript)s
136140
<body bgcolor=#ffffff>
137141
%(message)s
138142
<table width=100%% border=0 cellspacing=0 cellpadding=2>
@@ -1160,11 +1164,6 @@ class ExtendedClient(Client):
11601164
default_index_filterspec = {'status': ['1', '2', '3', '4', '5', '6', '7']}
11611165

11621166
def pagehead(self, title, message=None):
1163-
url = self.env['SCRIPT_NAME'] + '/' #self.env.get('PATH_INFO', '/')
1164-
machine = self.env['SERVER_NAME']
1165-
port = self.env['SERVER_PORT']
1166-
if port != '80': machine = machine + ':' + port
1167-
base = urlparse.urlunparse(('http', machine, url, None, None, None))
11681167
if message is not None:
11691168
message = _('<div class="system-msg">%(message)s</div>')%locals()
11701169
else:
@@ -1194,12 +1193,12 @@ def pagehead(self, title, message=None):
11941193
''')
11951194
else:
11961195
add_links = ''
1197-
single_submit_script = self.single_submit_script
1196+
global_javascript = self.global_javascript%self.__dict__
11981197
self.write(_('''<html><head>
11991198
<title>%(title)s</title>
12001199
<style type="text/css">%(style)s</style>
12011200
</head>
1202-
%(single_submit_script)s
1201+
%(global_javascript)s
12031202
<body bgcolor=#ffffff>
12041203
%(message)s
12051204
<table width=100%% border=0 cellspacing=0 cellpadding=2>
@@ -1299,6 +1298,9 @@ def parsePropsFromForm(db, cl, form, nodeid=0):
12991298

13001299
#
13011300
# $Log: not supported by cvs2svn $
1301+
# Revision 1.105 2002/02/20 05:52:10 richard
1302+
# better error handling
1303+
#
13021304
# Revision 1.104 2002/02/20 05:45:17 richard
13031305
# Use the csv module for generating the form entry so it's correct.
13041306
# [also noted the sf.net feature request id in the change log]

roundup/htmltemplate.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: htmltemplate.py,v 1.77 2002-02-20 05:05:29 richard Exp $
18+
# $Id: htmltemplate.py,v 1.78 2002-02-21 06:23:00 richard Exp $
1919

2020
__doc__ = """
2121
Template engine.
@@ -655,7 +655,11 @@ def do_submit(self):
655655
else:
656656
return _('[Submit: not called from item]')
657657

658-
658+
def do_classhelp(self, classname, colums):
659+
'''pop up a javascript window with class help
660+
'''
661+
return '<a href="javascript:help_window(\'classhelp?classname=%s&' \
662+
'columns=%s\')"><b>(?)</b></a>'%(classname, columns)
659663
#
660664
# INDEX TEMPLATES
661665
#
@@ -1077,6 +1081,12 @@ def render(self, form):
10771081

10781082
#
10791083
# $Log: not supported by cvs2svn $
1084+
# Revision 1.77 2002/02/20 05:05:29 richard
1085+
# . Added simple editing for classes that don't define a templated interface.
1086+
# - access using the admin "class list" interface
1087+
# - limited to admin-only
1088+
# - requires the csv module from object-craft (url given if it's missing)
1089+
#
10801090
# Revision 1.76 2002/02/16 09:10:52 richard
10811091
# oops
10821092
#

tools/.cvsignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.pyc
2+
localconfig.py
3+
build

0 commit comments

Comments
 (0)