|
1 | 1 | # |
2 | | -# $Id: template_funcs.py,v 1.2 2002-08-15 00:40:10 richard Exp $ |
| 2 | +# $Id: template_funcs.py,v 1.3 2002-08-19 00:22:47 richard Exp $ |
3 | 3 | # |
4 | 4 | import hyperdb, date, password |
5 | 5 | from i18n import _ |
@@ -618,25 +618,34 @@ def do_history(client, classname, cl, props, nodeid, filterspec, |
618 | 618 | len(args[k]) > 0: |
619 | 619 | ml = [] |
620 | 620 | for linkid in args[k]: |
621 | | - label = classname + linkid |
622 | | - # if we have a label property, try to use it |
623 | | - # TODO: test for node existence even when |
624 | | - # there's no labelprop! |
625 | | - try: |
626 | | - if labelprop is not None: |
627 | | - label = linkcl.get(linkid, labelprop) |
628 | | - except IndexError: |
629 | | - comments['no_link'] = _('''<strike>The |
630 | | - linked node no longer |
631 | | - exists</strike>''') |
632 | | - ml.append('<strike>%s</strike>'%label) |
| 621 | + if isinstance(linkid, type(())): |
| 622 | + sublabel = linkid[0] + ' ' |
| 623 | + linkids = linkid[1] |
633 | 624 | else: |
634 | | - if hrefable: |
635 | | - ml.append('<a href="%s%s">%s</a>'%( |
636 | | - classname, linkid, label)) |
| 625 | + sublabel = '' |
| 626 | + linkids = [linkid] |
| 627 | + subml = [] |
| 628 | + for linkid in linkids: |
| 629 | + label = classname + linkid |
| 630 | + # if we have a label property, try to use it |
| 631 | + # TODO: test for node existence even when |
| 632 | + # there's no labelprop! |
| 633 | + try: |
| 634 | + if labelprop is not None: |
| 635 | + label = linkcl.get(linkid, labelprop) |
| 636 | + except IndexError: |
| 637 | + comments['no_link'] = _('''<strike>The |
| 638 | + linked node no longer |
| 639 | + exists</strike>''') |
| 640 | + subml.append('<strike>%s</strike>'%label) |
637 | 641 | else: |
638 | | - ml.append(label) |
639 | | - cell.append('%s:\n %s'%(k, ',\n '.join(ml))) |
| 642 | + if hrefable: |
| 643 | + subml.append('<a href="%s%s">%s</a>'%( |
| 644 | + classname, linkid, label)) |
| 645 | + else: |
| 646 | + subml.append(label) |
| 647 | + ml.append(sublabel + ', '.join(subml)) |
| 648 | + cell.append('%s:\n %s'%(k, ', '.join(ml))) |
640 | 649 | elif isinstance(prop, hyperdb.Link) and args[k]: |
641 | 650 | label = classname + args[k] |
642 | 651 | # if we have a label property, try to use it |
@@ -809,6 +818,9 @@ def do_remove(client, classname, cl, props, nodeid, filterspec): |
809 | 818 |
|
810 | 819 | # |
811 | 820 | # $Log: not supported by cvs2svn $ |
| 821 | +# Revision 1.2 2002/08/15 00:40:10 richard |
| 822 | +# cleanup |
| 823 | +# |
812 | 824 | # |
813 | 825 | # |
814 | 826 | # vim: set filetype=python ts=4 sw=4 et si |
0 commit comments