Commit b8757f3a authored by Jim Fulton's avatar Jim Fulton

cleaned up formatting of generated reports and fixed bug for record reports

parent 2af8d36c
...@@ -96,8 +96,8 @@ ...@@ -96,8 +96,8 @@
############################################################################## ##############################################################################
__doc__='''Shared classes and functions __doc__='''Shared classes and functions
$Id: Aqueduct.py,v 1.29 1998/12/29 17:02:55 jim Exp $''' $Id: Aqueduct.py,v 1.30 1998/12/29 19:55:01 jim Exp $'''
__version__='$Revision: 1.29 $'[11:-2] __version__='$Revision: 1.30 $'[11:-2]
import Globals, os import Globals, os
from Globals import HTMLFile, Persistent from Globals import HTMLFile, Persistent
...@@ -235,10 +235,10 @@ def default_input_form(id,arguments,action='query', ...@@ -235,10 +235,10 @@ def default_input_form(id,arguments,action='query',
string.joinfields( string.joinfields(
map( map(
lambda a: lambda a:
('<tr><th>%s</th>\n' ('<tr> <th>%s</th>\n'
' <td><input name="%s"\n' ' <td><input name="%s"\n'
' width=30 value="%s">' ' width=30 value="%s">'
'</td></tr>' ' </td></tr>'
% (nicify(a[0]), % (nicify(a[0]),
( (
a[1].has_key('type') and a[1].has_key('type') and
...@@ -286,29 +286,26 @@ def custom_default_report(id, result, action='', no_table=0, ...@@ -286,29 +286,26 @@ def custom_default_report(id, result, action='', no_table=0,
): ):
columns=result._searchable_result_columns() columns=result._searchable_result_columns()
__traceback_info__=columns __traceback_info__=columns
heading=('<tr>\n%s\n</tr>' % heading=('<tr>\n%s </tr>' %
string.joinfields( string.joinfields(
map(lambda c: map(lambda c:
' <th>%s</th>\n' % nicify(c['name']), ' <th>%s</th>\n' % nicify(c['name']),
columns), columns),
'' ''
) )
) )
if no_table: tr, _tr, td, _td, delim = '<p>', '</p>', '', '', ', ' if no_table: tr, _tr, td, _td, delim = '<p>', '</p>', '', '', ',\n'
else: tr, _tr, td, _td, delim = '<tr>', '</tr>', '<td>', '</td>', '' else: tr, _tr, td, _td, delim = '<tr>', '</tr>', '<td>', '</td>', '\n'
if no_table: tr='<p>', '</p>'
else: tr, _tr = '<tr>', '</tr>'
row=[] row=[]
for c in columns: for c in columns:
n=c['name'] n=c['name']
if goofy(n) >= 0: n='expr="_vars[\'%s]"' % (`'"'+n`[2:]) if goofy(n) >= 0: n='expr="_vars[\'%s]"' % (`'"'+n`[2:])
row.append(' %s<!--#var %s%s-->%s\n' row.append(' %s<!--#var %s%s-->%s'
% (td,n,c['type']!='s' and ' null=""' or '',_td)) % (td,n,c['type']!='s' and ' null=""' or '',_td))
row=('%s\n%s\n%s' % (tr,string.joinfields(row,delim), _tr)) row=(' %s\n%s\n %s' % (tr,string.joinfields(row,delim), _tr))
return custom_default_report_src( return custom_default_report_src(
id=id,heading=heading,row=row,action=action,no_table=no_table) id=id,heading=heading,row=row,action=action,no_table=no_table)
...@@ -446,7 +443,6 @@ def decapitate(html, RESPONSE=None, ...@@ -446,7 +443,6 @@ def decapitate(html, RESPONSE=None,
return html return html
def delimited_output(results,REQUEST,RESPONSE): def delimited_output(results,REQUEST,RESPONSE):
delim=REQUEST['output-delimiter'] delim=REQUEST['output-delimiter']
try: output_type=REQUEST['output-type'] try: output_type=REQUEST['output-type']
......
...@@ -2,12 +2,15 @@ ...@@ -2,12 +2,15 @@
<!--#if sequence-start--> <!--#if sequence-start-->
<!--#if previous-sequence--> <!--#if previous-sequence-->
<a href="<!--#var URL--><!--#var sequence-query <a href="<!--#var URL--><!--#var sequence-query
-->query_start=<!--#var -->query_start=<!--#var
previous-sequence-start-number-->"> previous-sequence-start-number-->">
(Previous <!--#var previous-sequence-size--> results) (Previous <!--#var previous-sequence-size--> results)
</a> </a>
<!--#/if previous-sequence--> <!--#/if previous-sequence-->
%(else no_table)[<table border> %(else no_table)[<table border>
%(heading)s %(heading)s
%(else)] %(else)]
...@@ -17,13 +20,17 @@ ...@@ -17,13 +20,17 @@
%(row)s %(row)s
<!--#if sequence-end--> <!--#if sequence-end-->
%(else no_table)[</table>%(else)] %(else no_table)[</table>%(else)]
<!--#if next-sequence--> <!--#if next-sequence-->
<a href="<!--#var URL--><!--#var sequence-query <a href="<!--#var URL--><!--#var sequence-query
-->query_start=<!--#var -->query_start=<!--#var
next-sequence-start-number-->"> next-sequence-start-number-->">
(Next <!--#var next-sequence-size--> results) (Next <!--#var next-sequence-size--> results)
</a> </a>
<!--#/if next-sequence--> <!--#/if next-sequence-->
<!--#/if sequence-end--> <!--#/if sequence-end-->
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment