|
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.58 2002-01-15 00:50:03 richard Exp $ |
| 18 | +# $Id: htmltemplate.py,v 1.59 2002-01-17 07:58:24 grubert Exp $ |
19 | 19 |
|
20 | 20 | __doc__ = """ |
21 | 21 | Template engine. |
@@ -79,6 +79,7 @@ def do_plain(self, property, escape=0): |
79 | 79 | if value is None: value = '' |
80 | 80 | else: value = _('*encrypted*') |
81 | 81 | elif isinstance(propclass, hyperdb.Date): |
| 82 | + # this gives "2002-01-17.06:54:39", maybe replace the "." by a " ". |
82 | 83 | value = str(value) |
83 | 84 | elif isinstance(propclass, hyperdb.Interval): |
84 | 85 | value = str(value) |
@@ -453,8 +454,21 @@ def do_history(self, **args): |
453 | 454 |
|
454 | 455 | for id, date, user, action, args in self.cl.history(self.nodeid): |
455 | 456 | date_s = str(date).replace("."," ") |
| 457 | + arg_s = "" |
| 458 | + if action=='link' and type(args)==type(()): |
| 459 | + if len(args) == 3: |
| 460 | + arg_s += '<a href="%s%s">%s%s %s</a>'% (args[0],args[1],args[0],args[1],args[2]) |
| 461 | + else: |
| 462 | + arg_s = str(arg) |
| 463 | + elif type(args)==type({}): |
| 464 | + for k in args.keys(): |
| 465 | + # special treatment of date, maybe links to files, authors, recipient ? |
| 466 | + arg_s += '%s: %s,'%(k,str(args[k])) |
| 467 | + else: |
| 468 | + arg_s = str(args) |
| 469 | + # shouldnt _() be used ? |
456 | 470 | l.append('<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>'%( |
457 | | - date_s, user, action, args)) |
| 471 | + date_s, user, action, arg_s)) |
458 | 472 | l.append('</table>') |
459 | 473 | return '\n'.join(l) |
460 | 474 |
|
@@ -884,6 +898,9 @@ def render(self, form): |
884 | 898 |
|
885 | 899 | # |
886 | 900 | # $Log: not supported by cvs2svn $ |
| 901 | +# Revision 1.58 2002/01/15 00:50:03 richard |
| 902 | +# #502949 ] index view for non-issues and redisplay |
| 903 | +# |
887 | 904 | # Revision 1.57 2002/01/14 23:31:21 richard |
888 | 905 | # reverted the change that had plain() hyperlinking the link displays - |
889 | 906 | # that's what link() is for! |
|
0 commit comments