|
15 | 15 | # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
16 | 16 | # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
17 | 17 | # |
18 | | -# $Id: htmltemplate.py,v 1.20 2001-08-15 23:43:18 richard Exp $ |
| 18 | +# $Id: htmltemplate.py,v 1.21 2001-08-16 07:34:59 richard Exp $ |
19 | 19 |
|
20 | 20 | import os, re, StringIO, urllib, cgi, errno |
21 | 21 |
|
@@ -505,18 +505,18 @@ def index(client, templates, db, classname, filterspec={}, filter=[], |
505 | 505 | columns = l |
506 | 506 |
|
507 | 507 | # now display the index section |
508 | | - w('<table width=100% border=0 cellspacing=0 cellpadding=2>') |
509 | | - w('<tr class="list-header">') |
| 508 | + w('<table width=100% border=0 cellspacing=0 cellpadding=2>\n') |
| 509 | + w('<tr class="list-header">\n') |
510 | 510 | for name in columns: |
511 | 511 | cname = name.capitalize() |
512 | 512 | if show_display_form: |
513 | 513 | anchor = "%s?%s"%(classname, sortby(name, columns, filter, |
514 | 514 | sort, group, filterspec)) |
515 | | - w('<td><span class="list-item"><a href="%s">%s</a></span></td>'%( |
| 515 | + w('<td><span class="list-item"><a href="%s">%s</a></span></td>\n'%( |
516 | 516 | anchor, cname)) |
517 | 517 | else: |
518 | | - w('<td><span class="list-item">%s</span></td>'%cname) |
519 | | - w('</tr>') |
| 518 | + w('<td><span class="list-item">%s</span></td>\n'%cname) |
| 519 | + w('</tr>\n') |
520 | 520 |
|
521 | 521 | # this stuff is used for group headings - optimise the group names |
522 | 522 | old_group = None |
@@ -575,66 +575,66 @@ def index(client, templates, db, classname, filterspec={}, filter=[], |
575 | 575 |
|
576 | 576 | # now add in the filter/columns/group/etc config table form |
577 | 577 | w('<p>') |
578 | | - w('<table width=100% border=0 cellspacing=0 cellpadding=2>') |
| 578 | + w('<table width=100% border=0 cellspacing=0 cellpadding=2>\n') |
579 | 579 | names = [] |
580 | 580 | for name in cl.getprops().keys(): |
581 | 581 | if name in all_filters or name in all_columns: |
582 | 582 | names.append(name) |
583 | 583 | w('<tr class="location-bar">') |
584 | | - w('<th align="left" colspan=%s>View customisation...</th></tr>'% |
| 584 | + w('<th align="left" colspan=%s>View customisation...</th></tr>\n'% |
585 | 585 | (len(names)+1)) |
586 | 586 | w('<tr class="location-bar"><th> </th>') |
587 | 587 | for name in names: |
588 | 588 | w('<th>%s</th>'%name.capitalize()) |
589 | | - w('</tr>') |
| 589 | + w('</tr>\n') |
590 | 590 |
|
591 | 591 | # filter |
592 | 592 | if all_filters: |
593 | | - w('<tr><th width="1%" align=right class="location-bar">Filters</th>') |
| 593 | + w('<tr><th width="1%" align=right class="location-bar">Filters</th>\n') |
594 | 594 | for name in names: |
595 | 595 | if name not in all_filters: |
596 | 596 | w('<td> </td>') |
597 | 597 | continue |
598 | 598 | if name in filter: checked=' checked' |
599 | 599 | else: checked='' |
600 | | - w('<td align=middle>') |
601 | | - w('<input type="checkbox" name=":filter" value="%s" %s></td>'%(name, |
602 | | - checked)) |
603 | | - w('</tr>') |
| 600 | + w('<td align=middle>\n') |
| 601 | + w(' <input type="checkbox" name=":filter" value="%s" %s></td>\n'%( |
| 602 | + name, checked)) |
| 603 | + w('</tr>\n') |
604 | 604 |
|
605 | 605 | # columns |
606 | 606 | if all_columns: |
607 | | - w('<tr><th width="1%" align=right class="location-bar">Columns</th>') |
| 607 | + w('<tr><th width="1%" align=right class="location-bar">Columns</th>\n') |
608 | 608 | for name in names: |
609 | 609 | if name not in all_columns: |
610 | 610 | w('<td> </td>') |
611 | 611 | continue |
612 | 612 | if name in columns: checked=' checked' |
613 | 613 | else: checked='' |
614 | | - w('<td align=middle>') |
615 | | - w('<input type="checkbox" name=":columns" value="%s" %s></td>'%( |
| 614 | + w('<td align=middle>\n') |
| 615 | + w(' <input type="checkbox" name=":columns" value="%s" %s></td>\n'%( |
616 | 616 | name, checked)) |
617 | | - w('</tr>') |
| 617 | + w('</tr>\n') |
618 | 618 |
|
619 | 619 | # group |
620 | | - w('<tr><th width="1%" align=right class="location-bar">Grouping</th>') |
| 620 | + w('<tr><th width="1%" align=right class="location-bar">Grouping</th>\n') |
621 | 621 | for name in names: |
622 | 622 | prop = properties[name] |
623 | 623 | if name not in all_columns: |
624 | 624 | w('<td> </td>') |
625 | 625 | continue |
626 | 626 | if name in group: checked=' checked' |
627 | 627 | else: checked='' |
628 | | - w('<td align=middle>') |
629 | | - w('<input type="checkbox" name=":group" value="%s" %s></td>'%( |
| 628 | + w('<td align=middle>\n') |
| 629 | + w(' <input type="checkbox" name=":group" value="%s" %s></td>\n'%( |
630 | 630 | name, checked)) |
631 | | - w('</tr>') |
| 631 | + w('</tr>\n') |
632 | 632 |
|
633 | 633 | w('<tr class="location-bar"><td width="1%"> </td>') |
634 | 634 | w('<td colspan="%s">'%len(names)) |
635 | | - w('<input type="submit" value="Redisplay"></td></tr>') |
636 | | - w('</table>') |
637 | | - w('</form>') |
| 635 | + w('<input type="submit" value="Redisplay"></td></tr>\n') |
| 636 | + w('</table>\n') |
| 637 | + w('</form>\n') |
638 | 638 |
|
639 | 639 |
|
640 | 640 | # |
@@ -742,6 +742,10 @@ def newitem(client, templates, db, classname, form, replace=re.compile( |
742 | 742 |
|
743 | 743 | # |
744 | 744 | # $Log: not supported by cvs2svn $ |
| 745 | +# Revision 1.20 2001/08/15 23:43:18 richard |
| 746 | +# Fixed some isFooTypes that I missed. |
| 747 | +# Refactored some code in the CGI code. |
| 748 | +# |
745 | 749 | # Revision 1.19 2001/08/12 06:32:36 richard |
746 | 750 | # using isinstance(blah, Foo) now instead of isFooType |
747 | 751 | # |
|
0 commit comments