Mercurial > p > roundup > code
comparison roundup/htmltemplate.py @ 245:8a0d548c07a1
Fixed bug in the generation of links to Link/Multilink in indexes.
(thanks Hubert Hoegl)
Added AssignedTo to the "classic" schema's item page.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 10 Sep 2001 09:47:18 +0000 |
| parents | 6bf584784e31 |
| children | 1d428068485c |
comparison
equal
deleted
inserted
replaced
| 244:6bf584784e31 | 245:8a0d548c07a1 |
|---|---|
| 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 17 # | 17 # |
| 18 # $Id: htmltemplate.py,v 1.22 2001-08-30 06:01:17 richard Exp $ | 18 # $Id: htmltemplate.py,v 1.23 2001-09-10 09:47:18 richard Exp $ |
| 19 | 19 |
| 20 import os, re, StringIO, urllib, cgi, errno | 20 import os, re, StringIO, urllib, cgi, errno |
| 21 | 21 |
| 22 import hyperdb, date | 22 import hyperdb, date |
| 23 | 23 |
| 205 value = self.cl.get(self.nodeid, property) | 205 value = self.cl.get(self.nodeid, property) |
| 206 else: | 206 else: |
| 207 if isinstance(propclass, hyperdb.Multilink): value = [] | 207 if isinstance(propclass, hyperdb.Multilink): value = [] |
| 208 else: value = '' | 208 else: value = '' |
| 209 if isinstance(propclass, hyperdb.Link): | 209 if isinstance(propclass, hyperdb.Link): |
| 210 linkname = propclass.classname | |
| 210 if value is None: | 211 if value is None: |
| 211 return '[not assigned]' | 212 return '[not assigned]' |
| 212 linkcl = self.db.classes[propclass.classname] | 213 linkcl = self.db.classes[linkname] |
| 213 k = linkcl.labelprop() | 214 k = linkcl.labelprop() |
| 214 linkvalue = linkcl.get(value, k) | 215 linkvalue = linkcl.get(value, k) |
| 215 return '<a href="%s%s">%s</a>'%(linkcl, value, linkvalue) | 216 return '<a href="%s%s">%s</a>'%(linkname, value, linkvalue) |
| 216 if isinstance(propclass, hyperdb.Multilink): | 217 if isinstance(propclass, hyperdb.Multilink): |
| 217 linkcl = self.db.classes[propclass.classname] | 218 linkname = propclass.classname |
| 219 linkcl = self.db.classes[linkname] | |
| 218 k = linkcl.labelprop() | 220 k = linkcl.labelprop() |
| 219 l = [] | 221 l = [] |
| 220 for value in value: | 222 for value in value: |
| 221 linkvalue = linkcl.get(value, k) | 223 linkvalue = linkcl.get(value, k) |
| 222 l.append('<a href="%s%s">%s</a>'%(linkcl, value, linkvalue)) | 224 l.append('<a href="%s%s">%s</a>'%(linkname, value, linkvalue)) |
| 223 return ', '.join(l) | 225 return ', '.join(l) |
| 224 return '<a href="%s%s">%s</a>'%(self.classname, self.nodeid, value) | 226 return '<a href="%s%s">%s</a>'%(self.classname, self.nodeid, value) |
| 225 | 227 |
| 226 class Count(Base): | 228 class Count(Base): |
| 227 ''' for a Multilink property, display a count of the number of links in | 229 ''' for a Multilink property, display a count of the number of links in |
| 741 w(replace.go(s)) | 743 w(replace.go(s)) |
| 742 w('</form>') | 744 w('</form>') |
| 743 | 745 |
| 744 # | 746 # |
| 745 # $Log: not supported by cvs2svn $ | 747 # $Log: not supported by cvs2svn $ |
| 748 # Revision 1.22 2001/08/30 06:01:17 richard | |
| 749 # Fixed missing import in mailgw :( | |
| 750 # | |
| 746 # Revision 1.21 2001/08/16 07:34:59 richard | 751 # Revision 1.21 2001/08/16 07:34:59 richard |
| 747 # better CGI text searching - but hidden filter fields are disappearing... | 752 # better CGI text searching - but hidden filter fields are disappearing... |
| 748 # | 753 # |
| 749 # Revision 1.20 2001/08/15 23:43:18 richard | 754 # Revision 1.20 2001/08/15 23:43:18 richard |
| 750 # Fixed some isFooTypes that I missed. | 755 # Fixed some isFooTypes that I missed. |
