Commit 661a5646 authored by 's avatar

finally got around to fixing some long-standing tree indentation issues

that have always bugged me.
parent 0b1bdf0e
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
############################################################################## ##############################################################################
"""Rendering object hierarchies as Trees """Rendering object hierarchies as Trees
""" """
__rcs_id__='$Id: TreeTag.py,v 1.38 1999/09/29 13:40:44 brian Exp $' __rcs_id__='$Id: TreeTag.py,v 1.39 1999/11/12 16:25:49 brian Exp $'
__version__='$Revision: 1.38 $'[11:-2] __version__='$Revision: 1.39 $'[11:-2]
from DocumentTemplate.DT_Util import * from DocumentTemplate.DT_Util import *
from DocumentTemplate.DT_String import String from DocumentTemplate.DT_String import String
...@@ -342,6 +342,10 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -342,6 +342,10 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
diff.append(id) diff.append(id)
_td_colspan='<TD COLSPAN="%s" NOWRAP></TD>'
_td_single ='<TD WIDTH="16" NOWRAP></TD>'
sub=None sub=None
if substate is state: if substate is state:
output('<TABLE CELLSPACING="0">\n') output('<TABLE CELLSPACING="0">\n')
...@@ -354,10 +358,11 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -354,10 +358,11 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
# Add +/- icon # Add +/- icon
if items: if items:
if level: if level:
if level > 3: output( '<TD COLSPAN="%s"></TD>' % (level-1)) if level > 3: output(_td_colspan % (level-1))
elif level > 1: output('<TD></TD>' * (level-1)) elif level > 1: output(_td_single * (level-1))
output('<TD WIDTH="16"></TD>\n') output(_td_single)
output('<TD WIDTH="16" VALIGN="TOP">') output('\n')
output('<TD WIDTH="16" VALIGN="TOP" NOWRAP>')
for i in range(len(substate)): for i in range(len(substate)):
sub=substate[i] sub=substate[i]
if sub[0]==id: if sub[0]==id:
...@@ -388,9 +393,10 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -388,9 +393,10 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
output('</TD>\n') output('</TD>\n')
else: else:
if level > 2: output('<TD COLSPAN="%s"></TD>' % level) if level > 2: output(_td_colspan % level)
elif level > 0: output('<TD></TD>' * level) elif level > 0: output(_td_single * level)
output('<TD WIDTH="16"></TD>\n') output(_td_single)
output('\n')
# add item text # add item text
...@@ -407,8 +413,8 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -407,8 +413,8 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
level=level+1 level=level+1
dataspan=colspan-level dataspan=colspan-level
if level > 3: h='<TD COLSPAN="%s"></TD>' % (level-1) if level > 3: h=_td_colspan % (level-1)
elif level > 1: h='<TD></TD>' * (level-1) elif level > 1: h=_td_single * (level-1)
else: h='' else: h=''
if have_arg('header'): if have_arg('header'):
...@@ -419,7 +425,7 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -419,7 +425,7 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
output(doc( output(doc(
None, md, None, md,
standard_html_header=( standard_html_header=(
'<TR>%s<TD WIDTH="16"></TD>' '<TR>%s<TD WIDTH="16" NOWRAP></TD>'
'<TD%s VALIGN="TOP">' '<TD%s VALIGN="TOP">'
% (h, % (h,
(dataspan > 1 and (' COLSPAN="%s"' % dataspan) (dataspan > 1 and (' COLSPAN="%s"' % dataspan)
...@@ -440,7 +446,7 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -440,7 +446,7 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
try: output(doc( try: output(doc(
None,md, None,md,
standard_html_header=( standard_html_header=(
'<TR>%s<TD WIDTH="16"></TD>' '<TR>%s<TD WIDTH="16" NOWRAP></TD>'
'<TD%s VALIGN="TOP">' '<TD%s VALIGN="TOP">'
% (h, % (h,
(dataspan > 1 and (dataspan > 1 and
...@@ -459,7 +465,7 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -459,7 +465,7 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
try: output(doc( try: output(doc(
None,md, None,md,
standard_html_header=( standard_html_header=(
'<TR>%s<TD WIDTH="16"></TD>' '<TR>%s<TD WIDTH="16" NOWRAP></TD>'
'<TD%s VALIGN="TOP">' '<TD%s VALIGN="TOP">'
% (h, % (h,
(dataspan > 1 and (dataspan > 1 and
...@@ -498,7 +504,7 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -498,7 +504,7 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
output(doc( output(doc(
None, md, None, md,
standard_html_header=( standard_html_header=(
'<TR>%s<TD WIDTH="16"></TD>' '<TR>%s<TD WIDTH="16" NOWRAP></TD>'
'<TD%s VALIGN="TOP">' '<TD%s VALIGN="TOP">'
% (h, % (h,
(dataspan > 1 and (' COLSPAN="%s"' % dataspan) (dataspan > 1 and (' COLSPAN="%s"' % dataspan)
......
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