Mercurial > p > roundup > code
annotate roundup/htmltemplate.py @ 968:07d8a4e296f8
Whee! It's not finished yet, but I can create a new instance...
...and play with it a little bit :)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 22 Aug 2002 07:56:51 +0000 |
| parents | 14f37b1774ed |
| children |
| rev | line source |
|---|---|
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
1 # |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
2 # Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/) |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
3 # This module is free software, and you may redistribute it and/or modify |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
4 # under the same terms as Python, so long as this copyright message and |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
5 # disclaimer are retained in their original form. |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
6 # |
| 214 | 7 # IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR |
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
8 # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
9 # OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
10 # POSSIBILITY OF SUCH DAMAGE. |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
11 # |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
12 # BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
17 # |
|
947
14f37b1774ed
more helpful error messages (should make this switchable though)
Richard Jones <richard@users.sourceforge.net>
parents:
936
diff
changeset
|
18 # $Id: htmltemplate.py,v 1.112 2002-08-19 00:21:37 richard Exp $ |
|
406
bdc2ea127ae9
Added module docstrings to all modules.
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
401
diff
changeset
|
19 |
|
bdc2ea127ae9
Added module docstrings to all modules.
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
401
diff
changeset
|
20 __doc__ = """ |
|
bdc2ea127ae9
Added module docstrings to all modules.
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
401
diff
changeset
|
21 Template engine. |
|
902
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
22 |
|
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
23 Three types of template files exist: |
|
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
24 .index used by IndexTemplate |
|
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
25 .item used by ItemTemplate and NewItemTemplate |
|
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
26 .filter used by IndexTemplate |
|
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
27 |
|
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
28 Templating works by instantiating one of the *Template classes above, |
|
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
29 passing in a handle to the cgi client, identifying the class and the |
|
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
30 template source directory. |
|
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
31 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
32 The *Template class reads in the parsed template (parsing and caching |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
33 as needed). When the render() method is called, the parse tree is |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
34 traversed. Each node is either text (immediately output), a Require |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
35 instance (resulting in a call to _test()), a Property instance (treated |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
36 differently by .item and .index) or a Diplay instance (resulting in |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
37 a call to one of the template_funcs.py functions). |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
38 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
39 In a .index list, Property tags are used to determine columns, and |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
40 disappear before the actual rendering. Note that the template will |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
41 be rendered many times in a .index. |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
42 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
43 In a .item, Property tags check if the node has the property. |
|
902
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
44 |
|
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
45 Templating is tested by the test_htmltemplate unit test suite. If you add |
|
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
46 a template function, add a test for all data types or the angry pink bunny |
|
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
47 will hunt you down. |
|
406
bdc2ea127ae9
Added module docstrings to all modules.
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
401
diff
changeset
|
48 """ |
|
947
14f37b1774ed
more helpful error messages (should make this switchable though)
Richard Jones <richard@users.sourceforge.net>
parents:
936
diff
changeset
|
49 import weakref, os, types, cgi, sys, urllib, re, traceback |
|
14f37b1774ed
more helpful error messages (should make this switchable though)
Richard Jones <richard@users.sourceforge.net>
parents:
936
diff
changeset
|
50 try: |
|
14f37b1774ed
more helpful error messages (should make this switchable though)
Richard Jones <richard@users.sourceforge.net>
parents:
936
diff
changeset
|
51 import cStringIO as StringIO |
|
14f37b1774ed
more helpful error messages (should make this switchable though)
Richard Jones <richard@users.sourceforge.net>
parents:
936
diff
changeset
|
52 except ImportError: |
|
14f37b1774ed
more helpful error messages (should make this switchable though)
Richard Jones <richard@users.sourceforge.net>
parents:
936
diff
changeset
|
53 import StringIO |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
54 try: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
55 import cPickle as pickle |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
56 except ImportError: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
57 import pickle |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
58 from template_parser import RoundupTemplate, Display, Property, Require |
|
488
ab9e236cd524
I18N'ification
Richard Jones <richard@users.sourceforge.net>
parents:
467
diff
changeset
|
59 from i18n import _ |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
60 import hyperdb, template_funcs |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
61 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
62 MTIME = os.path.stat.ST_MTIME |
|
340
9311fa91f478
Added do_stext to htmltemplate, thanks Brad Clements.
Richard Jones <richard@users.sourceforge.net>
parents:
332
diff
changeset
|
63 |
|
627
952679be9e2c
Added simple editing for classes that don't define a templated interface.
Richard Jones <richard@users.sourceforge.net>
parents:
623
diff
changeset
|
64 class MissingTemplateError(ValueError): |
|
651
6257d4e49d2a
Ran it through pychecker, made fixes
Richard Jones <richard@users.sourceforge.net>
parents:
640
diff
changeset
|
65 '''Error raised when a template file is missing |
|
6257d4e49d2a
Ran it through pychecker, made fixes
Richard Jones <richard@users.sourceforge.net>
parents:
640
diff
changeset
|
66 ''' |
|
627
952679be9e2c
Added simple editing for classes that don't define a templated interface.
Richard Jones <richard@users.sourceforge.net>
parents:
623
diff
changeset
|
67 pass |
|
952679be9e2c
Added simple editing for classes that don't define a templated interface.
Richard Jones <richard@users.sourceforge.net>
parents:
623
diff
changeset
|
68 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
69 # what a <require> tag results in |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
70 def _test(attributes, client, classname, nodeid): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
71 tests = {} |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
72 for nm, val in attributes: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
73 tests[nm] = val |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
74 userid = client.db.user.lookup(client.user) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
75 security = client.db.security |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
76 perms = tests.get('permission', None) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
77 if perms: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
78 del tests['permission'] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
79 perms = perms.split(',') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
80 for value in perms: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
81 if security.hasPermission(value, userid, classname): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
82 # just passing the permission is OK |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
83 return 1 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
84 # try the attr conditions until one is met |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
85 if nodeid is None: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
86 return 0 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
87 if not tests: |
| 936 | 88 return 0 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
89 for propname, value in tests.items(): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
90 if value == '$userid': |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
91 tests[propname] = userid |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
92 return security.hasNodePermission(classname, nodeid, **tests) |
|
340
9311fa91f478
Added do_stext to htmltemplate, thanks Brad Clements.
Richard Jones <richard@users.sourceforge.net>
parents:
332
diff
changeset
|
93 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
94 # what a <display> tag results in |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
95 def _display(attributes, client, classname, cl, props, nodeid, filterspec=None): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
96 call = attributes[0][1] #eg "field('prop2')" |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
97 pos = call.find('(') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
98 funcnm = call[:pos] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
99 func = templatefuncs.get(funcnm, None) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
100 if func: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
101 argstr = call[pos:] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
102 args, kws = eval('splitargs'+argstr) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
103 args = (client, classname, cl, props, nodeid, filterspec) + args |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
104 rslt = func(*args, **kws) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
105 else: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
106 rslt = _('no template function %s' % funcnm) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
107 client.write(rslt) |
|
563
0f58d6a35a8b
Wrote more unit tests for htmltemplate...
Richard Jones <richard@users.sourceforge.net>
parents:
558
diff
changeset
|
108 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
109 # what a <property> tag results in |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
110 def _exists(attributes, cl, props, nodeid): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
111 nm = attributes[0][1] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
112 if nodeid: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
113 return cl.get(nodeid, nm) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
114 return props.get(nm, 0) |
| 936 | 115 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
116 class Template: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
117 ''' base class of all templates. |
|
563
0f58d6a35a8b
Wrote more unit tests for htmltemplate...
Richard Jones <richard@users.sourceforge.net>
parents:
558
diff
changeset
|
118 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
119 knows how to compile & load a template. |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
120 knows how to render one item. ''' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
121 def __init__(self, client, templates, classname): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
122 if isinstance(client, weakref.ProxyType): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
123 self.client = client |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
124 else: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
125 self.client = weakref.proxy(client) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
126 self.templatedir = templates |
| 936 | 127 self.compiledtemplatedir = self.templatedir + 'c' |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
128 self.classname = classname |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
129 self.cl = self.client.db.getclass(self.classname) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
130 self.properties = self.cl.getprops() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
131 self.template = self._load() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
132 self.filterspec = None |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
133 self.columns = None |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
134 self.nodeid = None |
| 936 | 135 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
136 def _load(self): |
| 936 | 137 ''' Load a template from disk and parse it. |
| 138 | |
| 139 Once parsed, the template is stored as a pickle in the | |
| 140 "htmlc" directory of the instance. If the file in there is | |
| 141 newer than the source template file, it's used in preference so | |
| 142 we don't have to re-parse. | |
| 143 ''' | |
| 144 # figure where the template source is | |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
145 src = os.path.join(self.templatedir, self.classname + self.extension) |
| 936 | 146 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
147 if not os.path.exists(src): |
| 936 | 148 # hrm, nothing exactly matching what we're after, see if we can |
| 149 # fall back on another template | |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
150 if hasattr(self, 'fallbackextension'): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
151 self.extension = self.fallbackextension |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
152 return self._load() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
153 raise MissingTemplateError, self.classname + self.extension |
| 936 | 154 |
| 155 # figure where the compiled template should be | |
| 156 cpl = os.path.join(self.compiledtemplatedir, | |
| 157 self.classname + self.extension) | |
| 158 | |
| 159 if (not os.path.exists(cpl) | |
| 160 or os.stat(cpl)[MTIME] < os.stat(src)[MTIME]): | |
| 161 # there's either no compiled template, or it's out of date | |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
162 parser = RoundupTemplate() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
163 parser.feed(open(src, 'r').read()) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
164 tmplt = parser.structure |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
165 try: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
166 if not os.path.exists(self.compiledtemplatedir): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
167 os.makedirs(self.compiledtemplatedir) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
168 f = open(cpl, 'wb') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
169 pickle.dump(tmplt, f) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
170 f.close() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
171 except Exception, e: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
172 print "ouch in pickling: got a %s %r" % (e, e.args) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
173 pass |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
174 else: |
| 936 | 175 # load the compiled template |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
176 f = open(cpl, 'rb') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
177 tmplt = pickle.load(f) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
178 return tmplt |
| 936 | 179 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
180 def _render(self, tmplt=None, test=_test, display=_display, exists=_exists): |
| 936 | 181 ''' Render the template |
| 182 ''' | |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
183 if tmplt is None: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
184 tmplt = self.template |
| 936 | 185 |
| 186 # go through the list of template "commands" | |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
187 for entry in tmplt: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
188 if isinstance(entry, type('')): |
| 936 | 189 # string - just write it out |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
190 self.client.write(entry) |
| 936 | 191 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
192 elif isinstance(entry, Require): |
| 936 | 193 # a <require> tag |
| 194 if test(entry.attributes, self.client, self.classname, | |
| 195 self.nodeid): | |
| 196 # require test passed, render the ok clause | |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
197 self._render(entry.ok) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
198 elif entry.fail: |
| 936 | 199 # if there's a fail clause, render it |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
200 self._render(entry.fail) |
| 936 | 201 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
202 elif isinstance(entry, Display): |
| 936 | 203 # execute the <display> function |
| 204 display(entry.attributes, self.client, self.classname, | |
| 205 self.cl, self.properties, self.nodeid, self.filterspec) | |
| 206 | |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
207 elif isinstance(entry, Property): |
| 936 | 208 # do a <property> test |
| 209 if self.columns is None: | |
| 210 # doing an Item - see if the property is present | |
| 211 if exists(entry.attributes, self.cl, self.properties, | |
| 212 self.nodeid): | |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
213 self._render(entry.ok) |
| 936 | 214 # XXX erm, should this be commented out? |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
215 #elif entry.attributes[0][1] in self.columns: |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
216 else: |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
217 self._render(entry.ok) |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
218 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
219 class IndexTemplate(Template): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
220 ''' renders lists of items |
|
568
c7ead967db85
more htmltemplate tests and cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
563
diff
changeset
|
221 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
222 shows filter form (for new queries / to refine queries) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
223 has clickable column headers (sort by this column / sort reversed) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
224 has group by lines |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
225 has full text search match lines ''' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
226 extension = '.index' |
| 936 | 227 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
228 def __init__(self, client, templates, classname): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
229 Template.__init__(self, client, templates, classname) |
| 936 | 230 |
| 231 def render(self, **kw): | |
| 232 ''' Render the template - well, wrap the rendering in a try/finally | |
| 233 so we're guaranteed to clean up after ourselves | |
| 234 ''' | |
| 235 try: | |
| 236 self.renderInner(**kw) | |
| 237 finally: | |
| 238 self.cl = self.properties = self.client = None | |
| 239 | |
| 240 def renderInner(self, filterspec={}, search_text='', filter=[], columns=[], | |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
241 sort=[], group=[], show_display_form=1, nodeids=None, |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
242 show_customization=1, show_nodes=1, pagesize=50, startwith=0, |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
243 simple_search=1, xtracols=None): |
| 936 | 244 ''' Take all the index arguments and render some HTML |
| 245 ''' | |
|
574
d41d94511170
more htmltemplate cleanups and unit tests
Richard Jones <richard@users.sourceforge.net>
parents:
568
diff
changeset
|
246 |
| 936 | 247 self.filterspec = filterspec |
| 248 w = self.client.write | |
| 249 cl = self.cl | |
| 250 properties = self.properties | |
| 251 if xtracols is None: | |
| 252 xtracols = [] | |
| 253 | |
| 254 # XXX deviate from spec here ... | |
| 255 # load the index section template and figure the default columns from it | |
| 256 displayable_props = [] | |
| 257 all_columns = [] | |
| 258 for node in self.template: | |
| 259 if isinstance(node, Property): | |
| 260 colnm = node.attributes[0][1] | |
| 261 if properties.has_key(colnm): | |
| 262 displayable_props.append(colnm) | |
| 263 all_columns.append(colnm) | |
| 264 elif colnm in xtracols: | |
| 265 all_columns.append(colnm) | |
| 266 if not columns: | |
| 267 columns = all_columns | |
| 268 else: | |
| 269 # re-sort columns to be the same order as displayable_props | |
| 270 l = [] | |
| 271 for name in all_columns: | |
| 272 if name in columns: | |
| 273 l.append(name) | |
| 274 columns = l | |
| 275 self.columns = columns | |
|
835
255bdcf39e8c
added sorting of checklist HTML display
Richard Jones <richard@users.sourceforge.net>
parents:
829
diff
changeset
|
276 |
| 936 | 277 # optimize the template |
| 278 self.template = self._optimize(self.template) | |
| 279 | |
| 280 # display the filter section | |
| 281 if (show_display_form and | |
| 282 self.client.instance.FILTER_POSITION.startswith('top')): | |
| 283 w('<form onSubmit="return submit_once()" action="%s">\n'% | |
| 284 self.client.classname) | |
| 285 self.filter_section(search_text, filter, columns, group, | |
| 286 displayable_props, sort, filterspec, pagesize, startwith, | |
| 287 simple_search) | |
|
577
334ae707ebfc
more HTML template cleanup and unit tests
Richard Jones <richard@users.sourceforge.net>
parents:
576
diff
changeset
|
288 |
| 936 | 289 # now display the index section |
| 290 w('<table width=100% border=0 cellspacing=0 cellpadding=2>\n') | |
| 291 w('<tr class="list-header">\n') | |
| 292 for name in columns: | |
| 293 cname = name.capitalize() | |
| 294 if show_display_form and not cname in xtracols: | |
| 295 sb = self.sortby(name, search_text, filterspec, columns, filter, | |
| 296 group, sort, pagesize) | |
| 297 anchor = "%s?%s"%(self.client.classname, sb) | |
| 298 w('<td><span class="list-header"><a href="%s">%s</a>' | |
| 299 '</span></td>\n'%(anchor, cname)) | |
| 300 else: | |
| 301 w('<td><span class="list-header">%s</span></td>\n'%cname) | |
| 302 w('</tr>\n') | |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
303 |
| 936 | 304 # this stuff is used for group headings - optimise the group names |
| 305 old_group = None | |
| 306 group_names = [] | |
| 307 if group: | |
| 308 for name in group: | |
| 309 if name[0] == '-': group_names.append(name[1:]) | |
| 310 else: group_names.append(name) | |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
311 |
| 936 | 312 # now actually loop through all the nodes we get from the filter and |
| 313 # apply the template | |
| 314 if show_nodes: | |
| 315 matches = None | |
| 316 if nodeids is None: | |
| 317 if search_text != '': | |
| 318 matches = self.client.db.indexer.search( | |
| 319 re.findall(r'\b\w{2,25}\b', search_text), cl) | |
| 320 nodeids = cl.filter(matches, filterspec, sort, group) | |
| 321 linecount = 0 | |
| 322 for nodeid in nodeids[startwith:startwith+pagesize]: | |
| 323 # check for a group heading | |
| 324 if group_names: | |
| 325 this_group = [cl.get(nodeid, name, _('[no value]')) | |
| 326 for name in group_names] | |
| 327 if this_group != old_group: | |
| 328 l = [] | |
| 329 for name in group_names: | |
| 330 prop = properties[name] | |
| 331 if isinstance(prop, hyperdb.Link): | |
| 332 group_cl = self.client.db.getclass(prop.classname) | |
| 333 key = group_cl.getkey() | |
| 334 if key is None: | |
| 335 key = group_cl.labelprop() | |
| 336 value = cl.get(nodeid, name) | |
| 337 if value is None: | |
| 338 l.append(_('[unselected %(classname)s]')%{ | |
| 339 'classname': prop.classname}) | |
| 340 else: | |
| 341 l.append(group_cl.get(value, key)) | |
| 342 elif isinstance(prop, hyperdb.Multilink): | |
| 343 group_cl = self.client.db.getclass(prop.classname) | |
| 344 key = group_cl.getkey() | |
| 345 for value in cl.get(nodeid, name): | |
| 346 l.append(group_cl.get(value, key)) | |
| 347 else: | |
| 348 value = cl.get(nodeid, name, | |
| 349 _('[no value]')) | |
| 350 if value is None: | |
| 351 value = _('[empty %(name)s]')%locals() | |
|
804
af4826d8773d
Default labelprops to id.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
757
diff
changeset
|
352 else: |
| 936 | 353 value = str(value) |
| 354 l.append(value) | |
| 355 w('<tr class="section-bar">' | |
| 356 '<td align=middle colspan=%s>' | |
| 357 '<strong>%s</strong></td></tr>\n'%( | |
| 358 len(columns), ', '.join(l))) | |
| 359 old_group = this_group | |
|
552
0f8734a5a004
much nicer history display (actualy real handling of property types etc)
Richard Jones <richard@users.sourceforge.net>
parents:
548
diff
changeset
|
360 |
| 936 | 361 # display this node's row |
| 362 self.nodeid = nodeid | |
| 363 self._render() | |
| 364 if matches: | |
| 365 self.node_matches(matches[nodeid], len(columns)) | |
| 366 self.nodeid = None | |
|
829
37ce3f2e05b2
added email display function
Richard Jones <richard@users.sourceforge.net>
parents:
826
diff
changeset
|
367 |
| 936 | 368 w('</table>\n') |
| 369 # the previous and next links | |
| 370 if nodeids: | |
| 371 baseurl = self.buildurl(filterspec, search_text, filter, | |
| 372 columns, sort, group, pagesize) | |
| 373 if startwith > 0: | |
| 374 prevurl = '<a href="%s&:startwith=%s"><< '\ | |
| 375 'Previous page</a>'%(baseurl, max(0, startwith-pagesize)) | |
| 376 else: | |
| 377 prevurl = "" | |
| 378 if startwith + pagesize < len(nodeids): | |
| 379 nexturl = '<a href="%s&:startwith=%s">Next page '\ | |
| 380 '>></a>'%(baseurl, startwith+pagesize) | |
| 381 else: | |
| 382 nexturl = "" | |
| 383 if prevurl or nexturl: | |
| 384 w('''<table width="100%%"><tr> | |
| 385 <td width="50%%" align="center">%s</td> | |
| 386 <td width="50%%" align="center">%s</td> | |
| 387 </tr></table>\n'''%(prevurl, nexturl)) | |
|
902
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
388 |
| 936 | 389 # display the filter section |
| 390 if (show_display_form and hasattr(self.client.instance, | |
| 391 'FILTER_POSITION') and | |
| 392 self.client.instance.FILTER_POSITION.endswith('bottom')): | |
| 393 w('<form onSubmit="return submit_once()" action="%s">\n'% | |
| 394 self.client.classname) | |
| 395 self.filter_section(search_text, filter, columns, group, | |
| 396 displayable_props, sort, filterspec, pagesize, startwith, | |
| 397 simple_search) | |
|
902
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
398 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
399 def _optimize(self, tmplt): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
400 columns = self.columns |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
401 t = [] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
402 for entry in tmplt: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
403 if isinstance(entry, Property): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
404 if entry.attributes[0][1] in columns: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
405 t.extend(entry.ok) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
406 else: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
407 t.append(entry) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
408 return t |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
409 |
| 936 | 410 def buildurl(self, filterspec, search_text, filter, columns, sort, group, |
| 411 pagesize): | |
| 412 d = {'pagesize':pagesize, 'pagesize':pagesize, | |
| 413 'classname':self.classname} | |
|
926
3216c4f06ec4
Fixes to the search form and saving queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
915
diff
changeset
|
414 if search_text: |
|
3216c4f06ec4
Fixes to the search form and saving queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
915
diff
changeset
|
415 d['searchtext'] = 'search_text=%s&' % search_text |
|
3216c4f06ec4
Fixes to the search form and saving queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
915
diff
changeset
|
416 else: |
|
3216c4f06ec4
Fixes to the search form and saving queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
915
diff
changeset
|
417 d['searchtext'] = '' |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
418 d['filter'] = ','.join(map(urllib.quote,filter)) |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
419 d['columns'] = ','.join(map(urllib.quote,columns)) |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
420 d['sort'] = ','.join(map(urllib.quote,sort)) |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
421 d['group'] = ','.join(map(urllib.quote,group)) |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
422 tmp = [] |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
423 for col, vals in filterspec.items(): |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
424 vals = ','.join(map(urllib.quote,vals)) |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
425 tmp.append('%s=%s' % (col, vals)) |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
426 d['filters'] = '&'.join(tmp) |
| 936 | 427 return ('%(classname)s?%(searchtext)s%(filters)s&:sort=%(sort)s&' |
| 428 ':filter=%(filter)s&:group=%(group)s&:columns=%(columns)s&' | |
| 429 ':pagesize=%(pagesize)s'%d) | |
| 430 | |
|
749
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
431 def node_matches(self, match, colspan): |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
432 ''' display the files and messages for a node that matched a |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
433 full text search |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
434 ''' |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
435 w = self.client.write |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
436 db = self.client.db |
|
749
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
437 message_links = [] |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
438 file_links = [] |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
439 if match.has_key('messages'): |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
440 for msgid in match['messages']: |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
441 k = db.msg.labelprop(1) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
442 lab = db.msg.get(msgid, k) |
|
749
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
443 msgpath = 'msg%s'%msgid |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
444 message_links.append('<a href="%(msgpath)s">%(lab)s</a>' |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
445 %locals()) |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
446 w(_('<tr class="row-hilite"><td colspan="%s">' |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
447 ' Matched messages: %s</td></tr>\n')%( |
|
749
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
448 colspan, ', '.join(message_links))) |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
449 |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
450 if match.has_key('files'): |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
451 for fileid in match['files']: |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
452 filename = db.file.get(fileid, 'name') |
|
749
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
453 filepath = 'file%s/%s'%(fileid, filename) |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
454 file_links.append('<a href="%(filepath)s">%(filename)s</a>' |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
455 %locals()) |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
456 w(_('<tr class="row-hilite"><td colspan="%s">' |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
457 ' Matched files: %s</td></tr>\n')%( |
|
749
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
458 colspan, ', '.join(file_links))) |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
459 |
|
902
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
460 def filter_form(self, search_text, filter, columns, group, all_columns, |
|
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
461 sort, filterspec, pagesize): |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
462 sortspec = {} |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
463 for i in range(len(sort)): |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
464 mod = '' |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
465 colnm = sort[i] |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
466 if colnm[0] == '-': |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
467 mod = '-' |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
468 colnm = colnm[1:] |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
469 sortspec[colnm] = '%d%s' % (i+1, mod) |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
470 |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
471 startwith = 0 |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
472 rslt = [] |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
473 w = rslt.append |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
474 |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
475 # display the filter section |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
476 w( '<br>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
477 w( '<table border=0 cellspacing=0 cellpadding=1>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
478 w( '<tr class="list-header">') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
479 w(_(' <th align="left" colspan="7">Filter specification...</th>')) |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
480 w( '</tr>') |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
481 # see if we have any indexed properties |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
482 if self.client.classname in self.client.db.config.HEADER_SEARCH_LINKS: |
| 936 | 483 w('<tr class="location-bar">') |
| 484 w(' <td align="right" class="form-label"><b>Search Terms</b></td>') | |
| 485 w(' <td colspan=6 class="form-text"> ' | |
| 486 '<input type="text"name="search_text" value="%s" size="50">' | |
| 487 '</td>'%search_text) | |
| 488 w('</tr>') | |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
489 w( '<tr class="location-bar">') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
490 w( ' <th align="center" width="20%"> </th>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
491 w(_(' <th align="center" width="10%">Show</th>')) |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
492 w(_(' <th align="center" width="10%">Group</th>')) |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
493 w(_(' <th align="center" width="10%">Sort</th>')) |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
494 w(_(' <th colspan="3" align="center">Condition</th>')) |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
495 w( '</tr>') |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
496 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
497 properties = self.client.db.getclass(self.classname).getprops() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
498 all_columns = properties.keys() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
499 all_columns.sort() |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
500 for nm in all_columns: |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
501 propdescr = properties.get(nm, None) |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
502 if not propdescr: |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
503 print "hey sysadmin - %s is not a property of %r" % (nm, self.classname) |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
504 continue |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
505 w( '<tr class="location-bar">') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
506 w(_(' <td align="right" class="form-label"><b>%s</b></td>' % nm.capitalize())) |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
507 # show column - can't show multilinks |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
508 if isinstance(propdescr, hyperdb.Multilink): |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
509 w(' <td></td>') |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
510 else: |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
511 checked = columns and nm in columns or 0 |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
512 checked = ('', 'checked')[checked] |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
513 w(' <td align="center" class="form-text"><input type="checkbox" name=":columns"' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
514 'value="%s" %s></td>' % (nm, checked) ) |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
515 # can only group on Link |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
516 if isinstance(propdescr, hyperdb.Link): |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
517 checked = group and nm in group or 0 |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
518 checked = ('', 'checked')[checked] |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
519 w(' <td align="center" class="form-text"><input type="checkbox" name=":group"' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
520 'value="%s" %s></td>' % (nm, checked) ) |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
521 else: |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
522 w(' <td></td>') |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
523 # sort - no sort on Multilinks |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
524 if isinstance(propdescr, hyperdb.Multilink): |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
525 w('<td></td>') |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
526 else: |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
527 val = sortspec.get(nm, '') |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
528 w('<td align="center" class="form-text"><input type="text" name=":%s_ss" size="3"' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
529 'value="%s"></td>' % (nm,val)) |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
530 # condition |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
531 val = '' |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
532 if isinstance(propdescr, hyperdb.Link): |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
533 op = "is in " |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
534 xtra = '<a href="javascript:help_window(\'classhelp?classname=%s&properties=id,%s\', \'200\', \'400\')"><b>(list)</b></a>' \ |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
535 % (propdescr.classname, self.client.db.getclass(propdescr.classname).labelprop()) |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
536 val = ','.join(filterspec.get(nm, '')) |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
537 elif isinstance(propdescr, hyperdb.Multilink): |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
538 op = "contains " |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
539 xtra = '<a href="javascript:help_window(\'classhelp?classname=%s&properties=id,%s\', \'200\', \'400\')"><b>(list)</b></a>' \ |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
540 % (propdescr.classname, self.client.db.getclass(propdescr.classname).labelprop()) |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
541 val = ','.join(filterspec.get(nm, '')) |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
542 elif isinstance(propdescr, hyperdb.String) and nm != 'id': |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
543 op = "equals " |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
544 xtra = "" |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
545 val = filterspec.get(nm, '') |
|
880
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
546 elif isinstance(propdescr, hyperdb.Boolean): |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
547 op = "is " |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
548 xtra = "" |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
549 val = filterspec.get(nm, None) |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
550 if val is not None: |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
551 val = 'True' and val or 'False' |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
552 else: |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
553 val = '' |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
554 elif isinstance(propdescr, hyperdb.Number): |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
555 op = "equals " |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
556 xtra = "" |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
557 val = str(filterspec.get(nm, '')) |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
558 else: |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
559 w('<td></td><td></td><td></td></tr>') |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
560 continue |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
561 checked = filter and nm in filter or 0 |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
562 checked = ('', 'checked')[checked] |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
563 w( ' <td class="form-text"><input type="checkbox" name=":filter" value="%s" %s></td>' \ |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
564 % (nm, checked)) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
565 w(_(' <td class="form-label" nowrap>%s</td><td class="form-text" nowrap>' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
566 '<input type="text" name=":%s_fs" value="%s" size=50>%s</td>' % (op, nm, val, xtra))) |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
567 w( '</tr>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
568 w('<tr class="location-bar">') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
569 w(' <td colspan=7><hr></td>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
570 w('</tr>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
571 w('<tr class="location-bar">') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
572 w(_(' <td align="right" class="form-label">Pagesize</td>')) |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
573 w(' <td colspan=2 align="center" class="form-text"><input type="text" name=":pagesize"' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
574 'size="3" value="%s"></td>' % pagesize) |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
575 w(' <td colspan=4></td>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
576 w('</tr>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
577 w('<tr class="location-bar">') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
578 w(_(' <td align="right" class="form-label">Start With</td>')) |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
579 w(' <td colspan=2 align="center" class="form-text"><input type="text" name=":startwith"' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
580 'size="3" value="%s"></td>' % startwith) |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
581 w(' <td colspan=3></td>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
582 w(' <td></td>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
583 w('</tr>') |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
584 w('<input type=hidden name=":advancedsearch" value="1">') |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
585 |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
586 return '\n'.join(rslt) |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
587 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
588 def simple_filter_form(self, search_text, filter, columns, group, all_columns, |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
589 sort, filterspec, pagesize): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
590 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
591 startwith = 0 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
592 rslt = [] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
593 w = rslt.append |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
594 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
595 # display the filter section |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
596 w( '<br>') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
597 w( '<table border=0 cellspacing=0 cellpadding=1>') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
598 w( '<tr class="list-header">') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
599 w(_(' <th align="left" colspan="7">Query modifications...</th>')) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
600 w( '</tr>') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
601 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
602 if group: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
603 selectedgroup = group[0] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
604 groupopts = ['<select name=":group">','<option value="">--no selection--</option>'] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
605 else: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
606 selectedgroup = None |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
607 groupopts = ['<select name=":group">','<option value="" selected>--no selection--</option>'] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
608 descending = 0 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
609 if sort: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
610 selectedsort = sort[0] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
611 if selectedsort[0] == '-': |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
612 selectedsort = selectedsort[1:] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
613 descending = 1 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
614 sortopts = ['<select name=":sort">', '<option value="">--no selection--</option>'] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
615 else: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
616 selectedsort = None |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
617 sortopts = ['<select name=":sort">', '<option value="" selected>--no selection--</option>'] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
618 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
619 for nm in all_columns: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
620 propdescr = self.client.db.getclass(self.client.classname).getprops().get(nm, None) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
621 if not propdescr: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
622 print "hey sysadmin - %s is not a property of %r" % (nm, self.classname) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
623 continue |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
624 if isinstance(propdescr, hyperdb.Link): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
625 selected = '' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
626 if nm == selectedgroup: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
627 selected = 'selected' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
628 groupopts.append('<option value="%s" %s>%s</option>' % (nm, selected, nm.capitalize())) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
629 selected = '' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
630 if nm == selectedsort: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
631 selected = 'selected' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
632 sortopts.append('<option value="%s" %s>%s</option>' % (nm, selected, nm.capitalize())) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
633 if len(groupopts) > 2: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
634 groupopts.append('</select>') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
635 groupopts = '\n'.join(groupopts) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
636 w('<tr class="location-bar">') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
637 w(' <td align="right" class="form-label"><b>Group</b></td>') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
638 w(' <td class="form-text">%s</td>' % groupopts) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
639 w('</tr>') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
640 if len(sortopts) > 2: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
641 sortopts.append('</select>') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
642 sortopts = '\n'.join(sortopts) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
643 w('<tr class="location-bar">') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
644 w(' <td align="right" class="form-label"><b>Sort</b></td>') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
645 checked = descending and 'checked' or '' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
646 w(' <td class="form-text">%s <span class="form-label">Descending</span>' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
647 '<input type=checkbox name=":descending" value="1" %s></td>' % (sortopts, checked)) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
648 w('</tr>') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
649 w('<input type=hidden name="search_text" value="%s">' % urllib.quote(search_text)) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
650 w('<input type=hidden name=":filter" value="%s">' % ','.join(filter)) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
651 w('<input type=hidden name=":columns" value="%s">' % ','.join(columns)) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
652 for nm in filterspec.keys(): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
653 w('<input type=hidden name=":%s_fs" value="%s">' % (nm, ','.join(filterspec[nm]))) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
654 w('<input type=hidden name=":pagesize" value="%s">' % pagesize) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
655 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
656 return '\n'.join(rslt) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
657 |
|
902
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
658 def filter_section(self, search_text, filter, columns, group, all_columns, |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
659 sort, filterspec, pagesize, startwith, simpleform=1): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
660 w = self.client.write |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
661 if simpleform: |
| 936 | 662 w(self.simple_filter_form(search_text, filter, columns, group, |
| 663 all_columns, sort, filterspec, pagesize)) | |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
664 else: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
665 w(self.filter_form(search_text, filter, columns, group, all_columns, |
| 936 | 666 sort, filterspec, pagesize)) |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
667 w(' <tr class="location-bar">\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
668 w(' <td colspan=7><hr></td>\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
669 w(' </tr>\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
670 w(' <tr class="location-bar">\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
671 w(' <td> </td>\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
672 w(' <td colspan=6><input type="submit" name="Query" value="Redisplay"></td>\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
673 w(' </tr>\n') |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
674 if (not simpleform |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
675 and self.client.db.getclass('user').getprops().has_key('queries') |
|
893
897425e40859
Fixes/improvements to the search form & saved queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
890
diff
changeset
|
676 and not self.client.user in (None, "anonymous")): |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
677 w(' <tr class="location-bar">\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
678 w(' <td colspan=7><hr></td>\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
679 w(' </tr>\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
680 w(' <tr class="location-bar">\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
681 w(' <td align=right class="form-label">Name</td>\n') |
|
893
897425e40859
Fixes/improvements to the search form & saved queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
890
diff
changeset
|
682 w(' <td colspan=2 class="form-text"><input type="text" name=":name" value=""></td>\n') |
|
897425e40859
Fixes/improvements to the search form & saved queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
890
diff
changeset
|
683 w(' <td colspan=4 rowspan=2 class="form-help">If you give the query a name ' |
|
897425e40859
Fixes/improvements to the search form & saved queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
890
diff
changeset
|
684 'and click <b>Save</b>, it will appear on your menu. Saved queries may be ' |
|
897425e40859
Fixes/improvements to the search form & saved queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
890
diff
changeset
|
685 'edited by going to <b>My Details</b> and clicking on the query name.</td>') |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
686 w(' </tr>\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
687 w(' <tr class="location-bar">\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
688 w(' <td> </td><input type="hidden" name=":classname" value="%s">\n' % self.classname) |
|
893
897425e40859
Fixes/improvements to the search form & saved queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
890
diff
changeset
|
689 w(' <td colspan=2><input type="submit" name="Query" value="Save"></td>\n') |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
690 w(' </tr>\n') |
|
351
6932067a8f31
More HTML compliance fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
350
diff
changeset
|
691 w('</table>\n') |
|
307
dac78e092228
CGI interface view customisation section may now be hidden
Richard Jones <richard@users.sourceforge.net>
parents:
306
diff
changeset
|
692 |
| 936 | 693 def sortby(self, sort_name, search_text, filterspec, columns, filter, |
| 694 group, sort, pagesize): | |
|
913
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
695 ''' Figure the link for a column heading so we can sort by that |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
696 column |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
697 ''' |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
698 l = [] |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
699 w = l.append |
|
926
3216c4f06ec4
Fixes to the search form and saving queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
915
diff
changeset
|
700 if search_text: |
|
3216c4f06ec4
Fixes to the search form and saving queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
915
diff
changeset
|
701 w('search_text=%s' % search_text) |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
702 for k, v in filterspec.items(): |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
703 k = urllib.quote(k) |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
704 if type(v) == type([]): |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
705 w('%s=%s'%(k, ','.join(map(urllib.quote, v)))) |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
706 else: |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
707 w('%s=%s'%(k, urllib.quote(v))) |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
708 if columns: |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
709 w(':columns=%s'%','.join(map(urllib.quote, columns))) |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
710 if filter: |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
711 w(':filter=%s'%','.join(map(urllib.quote, filter))) |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
712 if group: |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
713 w(':group=%s'%','.join(map(urllib.quote, group))) |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
714 w(':pagesize=%s' % pagesize) |
|
926
3216c4f06ec4
Fixes to the search form and saving queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
915
diff
changeset
|
715 w(':startwith=0') |
|
913
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
716 |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
717 # handle the sorting - if we're already sorting by this column, |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
718 # then reverse the sorting, otherwise set the sorting to be this |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
719 # column only |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
720 sorting = None |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
721 if len(sort) == 1: |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
722 name = sort[0] |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
723 dir = name[0] |
|
913
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
724 if dir == '-' and name[1:] == sort_name: |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
725 sorting = ':sort=%s'%sort_name |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
726 elif name == sort_name: |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
727 sorting = ':sort=-%s'%sort_name |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
728 if sorting is None: |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
729 sorting = ':sort=%s'%sort_name |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
730 w(sorting) |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
731 |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
732 return '&'.join(l) |
|
307
dac78e092228
CGI interface view customisation section may now be hidden
Richard Jones <richard@users.sourceforge.net>
parents:
306
diff
changeset
|
733 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
734 class ItemTemplate(Template): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
735 ''' show one node as a form ''' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
736 extension = '.item' |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
737 def __init__(self, client, templates, classname): |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
738 Template.__init__(self, client, templates, classname) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
739 self.nodeid = client.nodeid |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
740 def render(self, nodeid): |
|
915
930b57864dc8
nicer error messages, and a bugfix
Richard Jones <richard@users.sourceforge.net>
parents:
913
diff
changeset
|
741 try: |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
742 cl = self.cl |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
743 properties = self.properties |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
744 if (properties.has_key('type') and |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
745 properties.has_key('content')): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
746 pass |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
747 # XXX we really want to return this as a downloadable... |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
748 # currently I handle this at a higher level by detecting 'file' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
749 # designators... |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
750 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
751 w = self.client.write |
| 936 | 752 w('<form onSubmit="return submit_once()" action="%s%s" ' |
| 753 'method="POST" enctype="multipart/form-data">'%(self.classname, | |
| 754 nodeid)) | |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
755 try: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
756 self._render() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
757 except: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
758 # make sure we don't commit any changes |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
759 self.client.db.rollback() |
|
947
14f37b1774ed
more helpful error messages (should make this switchable though)
Richard Jones <richard@users.sourceforge.net>
parents:
936
diff
changeset
|
760 s = StringIO.StringIO() |
|
14f37b1774ed
more helpful error messages (should make this switchable though)
Richard Jones <richard@users.sourceforge.net>
parents:
936
diff
changeset
|
761 traceback.print_exc(None, s) |
|
14f37b1774ed
more helpful error messages (should make this switchable though)
Richard Jones <richard@users.sourceforge.net>
parents:
936
diff
changeset
|
762 w('<pre class="system-msg">%s</pre>'%cgi.escape(s.getvalue())) |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
763 w('</form>') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
764 finally: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
765 self.cl = self.properties = self.client = None |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
766 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
767 class NewItemTemplate(Template): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
768 ''' display a form for creating a new node ''' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
769 extension = '.newitem' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
770 fallbackextension = '.item' |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
771 def __init__(self, client, templates, classname): |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
772 Template.__init__(self, client, templates, classname) |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
773 def render(self, form): |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
774 try: |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
775 self.form = form |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
776 w = self.client.write |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
777 c = self.client.classname |
| 936 | 778 w('<form onSubmit="return submit_once()" action="new%s" ' |
| 779 'method="POST" enctype="multipart/form-data">'%c) | |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
780 for key in form.keys(): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
781 if key[0] == ':': |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
782 value = form[key].value |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
783 if type(value) != type([]): value = [value] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
784 for value in value: |
| 936 | 785 w('<input type="hidden" name="%s" value="%s">'%(key, |
| 786 value)) | |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
787 self._render() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
788 w('</form>') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
789 finally: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
790 self.cl = self.properties = self.client = None |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
791 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
792 def splitargs(*args, **kws): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
793 return args, kws |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
794 # [('permission', 'perm2,perm3'), ('assignedto', '$userid'), ('status', 'open')] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
795 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
796 templatefuncs = {} |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
797 for nm in template_funcs.__dict__.keys(): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
798 if nm.startswith('do_'): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
799 templatefuncs[nm[3:]] = getattr(template_funcs, nm) |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
800 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
801 # |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
802 # $Log: not supported by cvs2svn $ |
|
947
14f37b1774ed
more helpful error messages (should make this switchable though)
Richard Jones <richard@users.sourceforge.net>
parents:
936
diff
changeset
|
803 # Revision 1.111 2002/08/15 00:40:10 richard |
|
14f37b1774ed
more helpful error messages (should make this switchable though)
Richard Jones <richard@users.sourceforge.net>
parents:
936
diff
changeset
|
804 # cleanup |
|
14f37b1774ed
more helpful error messages (should make this switchable though)
Richard Jones <richard@users.sourceforge.net>
parents:
936
diff
changeset
|
805 # |
| 936 | 806 # Revision 1.110 2002/08/13 20:16:09 gmcm |
| 807 # Use a real parser for templates. | |
| 808 # Rewrite htmltemplate to use the parser (hack, hack). | |
| 809 # Move the "do_XXX" methods to template_funcs.py. | |
| 810 # Redo the funcion tests (but not Template tests - they're hopeless). | |
| 811 # Simplified query form in cgi_client. | |
| 812 # Ability to delete msgs, files, queries. | |
| 813 # Ability to edit the metadata on files. | |
| 814 # | |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
815 # Revision 1.109 2002/08/01 15:06:08 gmcm |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
816 # Use same regex to split search terms as used to index text. |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
817 # Fix to back_metakit for not changing journaltag on reopen. |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
818 # Fix htmltemplate's do_link so [No <whatever>] strings are href'd. |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
819 # Fix bogus "nosy edited ok" msg - the **d syntax does NOT share d between caller and callee. |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
820 # |
|
930
3c344e942055
Use same regex to split search terms as used to index text.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
926
diff
changeset
|
821 # Revision 1.108 2002/07/31 22:40:50 gmcm |
|
3c344e942055
Use same regex to split search terms as used to index text.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
926
diff
changeset
|
822 # Fixes to the search form and saving queries. |
|
3c344e942055
Use same regex to split search terms as used to index text.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
926
diff
changeset
|
823 # Fixes to sorting in back_metakit.py. |
|
3c344e942055
Use same regex to split search terms as used to index text.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
926
diff
changeset
|
824 # |
|
926
3216c4f06ec4
Fixes to the search form and saving queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
915
diff
changeset
|
825 # Revision 1.107 2002/07/30 05:27:30 richard |
|
3216c4f06ec4
Fixes to the search form and saving queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
915
diff
changeset
|
826 # nicer error messages, and a bugfix |
|
3216c4f06ec4
Fixes to the search form and saving queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
915
diff
changeset
|
827 # |
|
915
930b57864dc8
nicer error messages, and a bugfix
Richard Jones <richard@users.sourceforge.net>
parents:
913
diff
changeset
|
828 # Revision 1.106 2002/07/30 02:41:04 richard |
|
930b57864dc8
nicer error messages, and a bugfix
Richard Jones <richard@users.sourceforge.net>
parents:
913
diff
changeset
|
829 # Removed the confusing, ugly two-column sorting stuff. Column heading clicks |
|
930b57864dc8
nicer error messages, and a bugfix
Richard Jones <richard@users.sourceforge.net>
parents:
913
diff
changeset
|
830 # now only sort on one column. Nice and simple and obvious. |
|
930b57864dc8
nicer error messages, and a bugfix
Richard Jones <richard@users.sourceforge.net>
parents:
913
diff
changeset
|
831 # |
|
913
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
832 # Revision 1.105 2002/07/26 08:26:59 richard |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
833 # Very close now. The cgi and mailgw now use the new security API. The two |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
834 # templates have been migrated to that setup. Lots of unit tests. Still some |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
835 # issue in the web form for editing Roles assigned to users. |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
836 # |
|
905
502a5ae11cc5
Very close now. The cgi and mailgw now use the new security API.
Richard Jones <richard@users.sourceforge.net>
parents:
902
diff
changeset
|
837 # Revision 1.104 2002/07/25 07:14:05 richard |
|
502a5ae11cc5
Very close now. The cgi and mailgw now use the new security API.
Richard Jones <richard@users.sourceforge.net>
parents:
902
diff
changeset
|
838 # Bugger it. Here's the current shape of the new security implementation. |
|
502a5ae11cc5
Very close now. The cgi and mailgw now use the new security API.
Richard Jones <richard@users.sourceforge.net>
parents:
902
diff
changeset
|
839 # Still to do: |
|
502a5ae11cc5
Very close now. The cgi and mailgw now use the new security API.
Richard Jones <richard@users.sourceforge.net>
parents:
902
diff
changeset
|
840 # . call the security funcs from cgi and mailgw |
|
502a5ae11cc5
Very close now. The cgi and mailgw now use the new security API.
Richard Jones <richard@users.sourceforge.net>
parents:
902
diff
changeset
|
841 # . change shipped templates to include correct initialisation and remove |
|
502a5ae11cc5
Very close now. The cgi and mailgw now use the new security API.
Richard Jones <richard@users.sourceforge.net>
parents:
902
diff
changeset
|
842 # the old config vars |
|
502a5ae11cc5
Very close now. The cgi and mailgw now use the new security API.
Richard Jones <richard@users.sourceforge.net>
parents:
902
diff
changeset
|
843 # ... that seems like a lot. The bulk of the work has been done though. Honest :) |
|
502a5ae11cc5
Very close now. The cgi and mailgw now use the new security API.
Richard Jones <richard@users.sourceforge.net>
parents:
902
diff
changeset
|
844 # |
|
902
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
845 # Revision 1.103 2002/07/20 19:29:10 gmcm |
|
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
846 # Fixes/improvements to the search form & saved queries. |
|
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
847 # |
|
893
897425e40859
Fixes/improvements to the search form & saved queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
890
diff
changeset
|
848 # Revision 1.102 2002/07/18 23:07:08 richard |
|
897425e40859
Fixes/improvements to the search form & saved queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
890
diff
changeset
|
849 # Unit tests and a few fixes. |
|
897425e40859
Fixes/improvements to the search form & saved queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
890
diff
changeset
|
850 # |
|
890
a568596dbea7
Unit tests and a few fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
880
diff
changeset
|
851 # Revision 1.101 2002/07/18 11:17:30 gmcm |
|
a568596dbea7
Unit tests and a few fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
880
diff
changeset
|
852 # Add Number and Boolean types to hyperdb. |
|
a568596dbea7
Unit tests and a few fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
880
diff
changeset
|
853 # Add conversion cases to web, mail & admin interfaces. |
|
a568596dbea7
Unit tests and a few fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
880
diff
changeset
|
854 # Add storage/serialization cases to back_anydbm & back_metakit. |
|
a568596dbea7
Unit tests and a few fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
880
diff
changeset
|
855 # |
|
880
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
856 # Revision 1.100 2002/07/18 07:01:54 richard |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
857 # minor bugfix |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
858 # |
| 878 | 859 # Revision 1.99 2002/07/17 12:39:10 gmcm |
| 860 # Saving, running & editing queries. | |
| 861 # | |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
862 # Revision 1.98 2002/07/10 00:17:46 richard |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
863 # . added sorting of checklist HTML display |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
864 # |
|
835
255bdcf39e8c
added sorting of checklist HTML display
Richard Jones <richard@users.sourceforge.net>
parents:
829
diff
changeset
|
865 # Revision 1.97 2002/07/09 05:20:09 richard |
|
255bdcf39e8c
added sorting of checklist HTML display
Richard Jones <richard@users.sourceforge.net>
parents:
829
diff
changeset
|
866 # . added email display function - mangles email addrs so they're not so easily |
|
255bdcf39e8c
added sorting of checklist HTML display
Richard Jones <richard@users.sourceforge.net>
parents:
829
diff
changeset
|
867 # scraped from the web |
|
255bdcf39e8c
added sorting of checklist HTML display
Richard Jones <richard@users.sourceforge.net>
parents:
829
diff
changeset
|
868 # |
|
829
37ce3f2e05b2
added email display function
Richard Jones <richard@users.sourceforge.net>
parents:
826
diff
changeset
|
869 # Revision 1.96 2002/07/09 04:19:09 richard |
|
37ce3f2e05b2
added email display function
Richard Jones <richard@users.sourceforge.net>
parents:
826
diff
changeset
|
870 # Added reindex command to roundup-admin. |
|
37ce3f2e05b2
added email display function
Richard Jones <richard@users.sourceforge.net>
parents:
826
diff
changeset
|
871 # Fixed reindex on first access. |
|
37ce3f2e05b2
added email display function
Richard Jones <richard@users.sourceforge.net>
parents:
826
diff
changeset
|
872 # Also fixed reindexing of entries that change. |
|
37ce3f2e05b2
added email display function
Richard Jones <richard@users.sourceforge.net>
parents:
826
diff
changeset
|
873 # |
|
826
6d7a45c8464a
Added reindex command to roundup-admin.
Richard Jones <richard@users.sourceforge.net>
parents:
821
diff
changeset
|
874 # Revision 1.95 2002/07/08 15:32:06 gmcm |
|
6d7a45c8464a
Added reindex command to roundup-admin.
Richard Jones <richard@users.sourceforge.net>
parents:
821
diff
changeset
|
875 # Pagination of index pages. |
|
6d7a45c8464a
Added reindex command to roundup-admin.
Richard Jones <richard@users.sourceforge.net>
parents:
821
diff
changeset
|
876 # New search form. |
|
6d7a45c8464a
Added reindex command to roundup-admin.
Richard Jones <richard@users.sourceforge.net>
parents:
821
diff
changeset
|
877 # |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
878 # Revision 1.94 2002/06/27 15:38:53 gmcm |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
879 # Fix the cycles (a clear method, called after render, that removes |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
880 # the bound methods from the globals dict). |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
881 # Use cl.filter instead of cl.list followed by sortfunc. For some |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
882 # backends (Metakit), filter can sort at C speeds, cutting >10 secs |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
883 # off of filling in the <select...> box for assigned_to when you |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
884 # have 600+ users. |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
885 # |
|
806
83becf3faa2f
Fix the cycles (a clear method, called after render...
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
804
diff
changeset
|
886 # Revision 1.93 2002/06/27 12:05:25 gmcm |
|
83becf3faa2f
Fix the cycles (a clear method, called after render...
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
804
diff
changeset
|
887 # Default labelprops to id. |
|
83becf3faa2f
Fix the cycles (a clear method, called after render...
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
804
diff
changeset
|
888 # In history, make sure there's a .item before making a link / multilink into an href. |
|
83becf3faa2f
Fix the cycles (a clear method, called after render...
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
804
diff
changeset
|
889 # Also in history, cgi.escape String properties. |
|
83becf3faa2f
Fix the cycles (a clear method, called after render...
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
804
diff
changeset
|
890 # Clean up some of the reference cycles. |
|
83becf3faa2f
Fix the cycles (a clear method, called after render...
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
804
diff
changeset
|
891 # |
|
804
af4826d8773d
Default labelprops to id.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
757
diff
changeset
|
892 # Revision 1.92 2002/06/11 04:57:04 richard |
|
af4826d8773d
Default labelprops to id.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
757
diff
changeset
|
893 # Added optional additional property to display in a Multilink form menu. |
|
af4826d8773d
Default labelprops to id.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
757
diff
changeset
|
894 # |
|
757
00d360a4978a
Added optional additional property to display in a Multilink form menu.
Richard Jones <richard@users.sourceforge.net>
parents:
755
diff
changeset
|
895 # Revision 1.91 2002/05/31 00:08:02 richard |
|
00d360a4978a
Added optional additional property to display in a Multilink form menu.
Richard Jones <richard@users.sourceforge.net>
parents:
755
diff
changeset
|
896 # can now just display a link/multilink id - useful for stylesheet stuff |
|
00d360a4978a
Added optional additional property to display in a Multilink form menu.
Richard Jones <richard@users.sourceforge.net>
parents:
755
diff
changeset
|
897 # |
|
755
49c9522675b9
can now just display a link/multilink id - useful for stylesheet stuff
Richard Jones <richard@users.sourceforge.net>
parents:
749
diff
changeset
|
898 # Revision 1.90 2002/05/25 07:16:24 rochecompaan |
|
49c9522675b9
can now just display a link/multilink id - useful for stylesheet stuff
Richard Jones <richard@users.sourceforge.net>
parents:
749
diff
changeset
|
899 # Merged search_indexing-branch with HEAD |
|
49c9522675b9
can now just display a link/multilink id - useful for stylesheet stuff
Richard Jones <richard@users.sourceforge.net>
parents:
749
diff
changeset
|
900 # |
|
749
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
901 # Revision 1.89 2002/05/15 06:34:47 richard |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
902 # forgot to fix the templating for last change |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
903 # |
|
721
c63b71a949a8
forgot to fix the templating for last change
Richard Jones <richard@users.sourceforge.net>
parents:
696
diff
changeset
|
904 # Revision 1.88 2002/04/24 08:34:35 rochecompaan |
|
c63b71a949a8
forgot to fix the templating for last change
Richard Jones <richard@users.sourceforge.net>
parents:
696
diff
changeset
|
905 # Sorting was applied to all nodes of the MultiLink class instead of |
|
c63b71a949a8
forgot to fix the templating for last change
Richard Jones <richard@users.sourceforge.net>
parents:
696
diff
changeset
|
906 # the nodes that are actually linked to in the "field" template |
|
c63b71a949a8
forgot to fix the templating for last change
Richard Jones <richard@users.sourceforge.net>
parents:
696
diff
changeset
|
907 # function. This adds about 20+ seconds in the display of an issue if |
|
c63b71a949a8
forgot to fix the templating for last change
Richard Jones <richard@users.sourceforge.net>
parents:
696
diff
changeset
|
908 # your database has a 1000 or more issue in it. |
|
c63b71a949a8
forgot to fix the templating for last change
Richard Jones <richard@users.sourceforge.net>
parents:
696
diff
changeset
|
909 # |
|
696
709f8f1d5661
Sorting was applied to all nodes of the MultiLink class...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
678
diff
changeset
|
910 # Revision 1.87 2002/04/03 06:12:46 richard |
|
709f8f1d5661
Sorting was applied to all nodes of the MultiLink class...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
678
diff
changeset
|
911 # Fix for date properties as labels. |
|
709f8f1d5661
Sorting was applied to all nodes of the MultiLink class...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
678
diff
changeset
|
912 # |
|
678
9fe50036e8df
Fix for date properties as labels.
Richard Jones <richard@users.sourceforge.net>
parents:
676
diff
changeset
|
913 # Revision 1.86 2002/04/03 05:54:31 richard |
|
9fe50036e8df
Fix for date properties as labels.
Richard Jones <richard@users.sourceforge.net>
parents:
676
diff
changeset
|
914 # Fixed serialisation problem by moving the serialisation step out of the |
|
9fe50036e8df
Fix for date properties as labels.
Richard Jones <richard@users.sourceforge.net>
parents:
676
diff
changeset
|
915 # hyperdb.Class (get, set) into the hyperdb.Database. |
|
9fe50036e8df
Fix for date properties as labels.
Richard Jones <richard@users.sourceforge.net>
parents:
676
diff
changeset
|
916 # |
|
9fe50036e8df
Fix for date properties as labels.
Richard Jones <richard@users.sourceforge.net>
parents:
676
diff
changeset
|
917 # Also fixed htmltemplate after the showid changes I made yesterday. |
|
9fe50036e8df
Fix for date properties as labels.
Richard Jones <richard@users.sourceforge.net>
parents:
676
diff
changeset
|
918 # |
|
9fe50036e8df
Fix for date properties as labels.
Richard Jones <richard@users.sourceforge.net>
parents:
676
diff
changeset
|
919 # Unit tests for all of the above written. |
|
9fe50036e8df
Fix for date properties as labels.
Richard Jones <richard@users.sourceforge.net>
parents:
676
diff
changeset
|
920 # |
|
676
bc46480e2a2b
Fixed serialisation problem...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
921 # Revision 1.85 2002/04/02 01:40:58 richard |
|
bc46480e2a2b
Fixed serialisation problem...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
922 # . link() htmltemplate function now has a "showid" option for links and |
|
bc46480e2a2b
Fixed serialisation problem...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
923 # multilinks. When true, it only displays the linked node id as the anchor |
|
bc46480e2a2b
Fixed serialisation problem...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
924 # text. The link value is displayed as a tooltip using the title anchor |
|
bc46480e2a2b
Fixed serialisation problem...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
925 # attribute. |
|
bc46480e2a2b
Fixed serialisation problem...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
926 # |
|
749
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
927 # Revision 1.84.2.2 2002/04/20 13:23:32 rochecompaan |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
928 # We now have a separate search page for nodes. Search links for |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
929 # different classes can be customized in instance_config similar to |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
930 # index links. |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
931 # |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
932 # Revision 1.84.2.1 2002/04/19 19:54:42 rochecompaan |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
933 # cgi_client.py |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
934 # removed search link for the time being |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
935 # moved rendering of matches to htmltemplate |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
936 # hyperdb.py |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
937 # filtering of nodes on full text search incorporated in filter method |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
938 # roundupdb.py |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
939 # added paramater to call of filter method |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
940 # roundup_indexer.py |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
941 # added search method to RoundupIndexer class |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
942 # |
|
673
604c84696461
link() htmltemplate function now has a "showid" option for links & multilinks.
Richard Jones <richard@users.sourceforge.net>
parents:
672
diff
changeset
|
943 # Revision 1.84 2002/03/29 19:41:48 rochecompaan |
|
604c84696461
link() htmltemplate function now has a "showid" option for links & multilinks.
Richard Jones <richard@users.sourceforge.net>
parents:
672
diff
changeset
|
944 # . Fixed display of mutlilink properties when using the template |
|
604c84696461
link() htmltemplate function now has a "showid" option for links & multilinks.
Richard Jones <richard@users.sourceforge.net>
parents:
672
diff
changeset
|
945 # functions, menu and plain. |
|
604c84696461
link() htmltemplate function now has a "showid" option for links & multilinks.
Richard Jones <richard@users.sourceforge.net>
parents:
672
diff
changeset
|
946 # |
|
672
d92e06a3a56e
Fixed display of mutlilink properties...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
651
diff
changeset
|
947 # Revision 1.83 2002/02/27 04:14:31 richard |
|
d92e06a3a56e
Fixed display of mutlilink properties...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
651
diff
changeset
|
948 # Ran it through pychecker, made fixes |
|
d92e06a3a56e
Fixed display of mutlilink properties...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
651
diff
changeset
|
949 # |
|
651
6257d4e49d2a
Ran it through pychecker, made fixes
Richard Jones <richard@users.sourceforge.net>
parents:
640
diff
changeset
|
950 # Revision 1.82 2002/02/21 23:11:45 richard |
|
6257d4e49d2a
Ran it through pychecker, made fixes
Richard Jones <richard@users.sourceforge.net>
parents:
640
diff
changeset
|
951 # . fixed some problems in date calculations (calendar.py doesn't handle over- |
|
6257d4e49d2a
Ran it through pychecker, made fixes
Richard Jones <richard@users.sourceforge.net>
parents:
640
diff
changeset
|
952 # and under-flow). Also, hour/minute/second intervals may now be more than |
|
6257d4e49d2a
Ran it through pychecker, made fixes
Richard Jones <richard@users.sourceforge.net>
parents:
640
diff
changeset
|
953 # 99 each. |
|
6257d4e49d2a
Ran it through pychecker, made fixes
Richard Jones <richard@users.sourceforge.net>
parents:
640
diff
changeset
|
954 # |
|
640
7dd13fd5d8ea
fixed some problems in date calculations
Richard Jones <richard@users.sourceforge.net>
parents:
639
diff
changeset
|
955 # Revision 1.81 2002/02/21 07:21:38 richard |
|
7dd13fd5d8ea
fixed some problems in date calculations
Richard Jones <richard@users.sourceforge.net>
parents:
639
diff
changeset
|
956 # docco |
|
7dd13fd5d8ea
fixed some problems in date calculations
Richard Jones <richard@users.sourceforge.net>
parents:
639
diff
changeset
|
957 # |
| 639 | 958 # Revision 1.80 2002/02/21 07:19:08 richard |
| 959 # ... and label, width and height control for extra flavour! | |
| 960 # | |
|
638
21b3cfa7d99a
... and label, width and height control for extra flavour!
Richard Jones <richard@users.sourceforge.net>
parents:
635
diff
changeset
|
961 # Revision 1.79 2002/02/21 06:57:38 richard |
|
21b3cfa7d99a
... and label, width and height control for extra flavour!
Richard Jones <richard@users.sourceforge.net>
parents:
635
diff
changeset
|
962 # . Added popup help for classes using the classhelp html template function. |
|
21b3cfa7d99a
... and label, width and height control for extra flavour!
Richard Jones <richard@users.sourceforge.net>
parents:
635
diff
changeset
|
963 # - add <display call="classhelp('priority', 'id,name,description')"> |
|
21b3cfa7d99a
... and label, width and height control for extra flavour!
Richard Jones <richard@users.sourceforge.net>
parents:
635
diff
changeset
|
964 # to an item page, and it generates a link to a popup window which displays |
|
21b3cfa7d99a
... and label, width and height control for extra flavour!
Richard Jones <richard@users.sourceforge.net>
parents:
635
diff
changeset
|
965 # the id, name and description for the priority class. The description |
|
21b3cfa7d99a
... and label, width and height control for extra flavour!
Richard Jones <richard@users.sourceforge.net>
parents:
635
diff
changeset
|
966 # field won't exist in most installations, but it will be added to the |
|
21b3cfa7d99a
... and label, width and height control for extra flavour!
Richard Jones <richard@users.sourceforge.net>
parents:
635
diff
changeset
|
967 # default templates. |
|
21b3cfa7d99a
... and label, width and height control for extra flavour!
Richard Jones <richard@users.sourceforge.net>
parents:
635
diff
changeset
|
968 # |
|
635
3d61b5d2243e
Added popup help for classes using the classhelp html template function.
Richard Jones <richard@users.sourceforge.net>
parents:
634
diff
changeset
|
969 # Revision 1.78 2002/02/21 06:23:00 richard |
|
3d61b5d2243e
Added popup help for classes using the classhelp html template function.
Richard Jones <richard@users.sourceforge.net>
parents:
634
diff
changeset
|
970 # *** empty log message *** |
|
3d61b5d2243e
Added popup help for classes using the classhelp html template function.
Richard Jones <richard@users.sourceforge.net>
parents:
634
diff
changeset
|
971 # |
|
634
53549c6a7b33
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
627
diff
changeset
|
972 # Revision 1.77 2002/02/20 05:05:29 richard |
|
53549c6a7b33
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
627
diff
changeset
|
973 # . Added simple editing for classes that don't define a templated interface. |
|
53549c6a7b33
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
627
diff
changeset
|
974 # - access using the admin "class list" interface |
|
53549c6a7b33
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
627
diff
changeset
|
975 # - limited to admin-only |
|
53549c6a7b33
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
627
diff
changeset
|
976 # - requires the csv module from object-craft (url given if it's missing) |
|
53549c6a7b33
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
627
diff
changeset
|
977 # |
|
627
952679be9e2c
Added simple editing for classes that don't define a templated interface.
Richard Jones <richard@users.sourceforge.net>
parents:
623
diff
changeset
|
978 # Revision 1.76 2002/02/16 09:10:52 richard |
|
952679be9e2c
Added simple editing for classes that don't define a templated interface.
Richard Jones <richard@users.sourceforge.net>
parents:
623
diff
changeset
|
979 # oops |
|
952679be9e2c
Added simple editing for classes that don't define a templated interface.
Richard Jones <richard@users.sourceforge.net>
parents:
623
diff
changeset
|
980 # |
| 623 | 981 # Revision 1.75 2002/02/16 08:43:23 richard |
| 982 # . #517906 ] Attribute order in "View customisation" | |
| 983 # | |
|
622
1b16ddd69f31
[SF#517906] Attribute order in "View customisation"
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
984 # Revision 1.74 2002/02/16 08:39:42 richard |
|
1b16ddd69f31
[SF#517906] Attribute order in "View customisation"
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
985 # . #516854 ] "My Issues" and redisplay |
|
1b16ddd69f31
[SF#517906] Attribute order in "View customisation"
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
986 # |
|
621
f333f6decdc2
[SF#516854] "My Issues" and redisplay
Richard Jones <richard@users.sourceforge.net>
parents:
617
diff
changeset
|
987 # Revision 1.73 2002/02/15 07:08:44 richard |
|
f333f6decdc2
[SF#516854] "My Issues" and redisplay
Richard Jones <richard@users.sourceforge.net>
parents:
617
diff
changeset
|
988 # . Alternate email addresses are now available for users. See the MIGRATION |
|
f333f6decdc2
[SF#516854] "My Issues" and redisplay
Richard Jones <richard@users.sourceforge.net>
parents:
617
diff
changeset
|
989 # file for info on how to activate the feature. |
|
f333f6decdc2
[SF#516854] "My Issues" and redisplay
Richard Jones <richard@users.sourceforge.net>
parents:
617
diff
changeset
|
990 # |
|
617
edd210915e64
Alternate email addresses are now available for users.
Richard Jones <richard@users.sourceforge.net>
parents:
614
diff
changeset
|
991 # Revision 1.72 2002/02/14 23:39:18 richard |
|
edd210915e64
Alternate email addresses are now available for users.
Richard Jones <richard@users.sourceforge.net>
parents:
614
diff
changeset
|
992 # . All forms now have "double-submit" protection when Javascript is enabled |
|
edd210915e64
Alternate email addresses are now available for users.
Richard Jones <richard@users.sourceforge.net>
parents:
614
diff
changeset
|
993 # on the client-side. |
|
edd210915e64
Alternate email addresses are now available for users.
Richard Jones <richard@users.sourceforge.net>
parents:
614
diff
changeset
|
994 # |
|
614
5fdf95e6c20a
. All forms now have "double-submit" protection...
Richard Jones <richard@users.sourceforge.net>
parents:
581
diff
changeset
|
995 # Revision 1.71 2002/01/23 06:15:24 richard |
|
5fdf95e6c20a
. All forms now have "double-submit" protection...
Richard Jones <richard@users.sourceforge.net>
parents:
581
diff
changeset
|
996 # real (non-string, duh) sorting of lists by node id |
|
5fdf95e6c20a
. All forms now have "double-submit" protection...
Richard Jones <richard@users.sourceforge.net>
parents:
581
diff
changeset
|
997 # |
|
581
137d7fc5234d
real (non-string, duh) sorting of lists by node id
Richard Jones <richard@users.sourceforge.net>
parents:
577
diff
changeset
|
998 # Revision 1.70 2002/01/23 05:47:57 richard |
|
137d7fc5234d
real (non-string, duh) sorting of lists by node id
Richard Jones <richard@users.sourceforge.net>
parents:
577
diff
changeset
|
999 # more HTML template cleanup and unit tests |
|
137d7fc5234d
real (non-string, duh) sorting of lists by node id
Richard Jones <richard@users.sourceforge.net>
parents:
577
diff
changeset
|
1000 # |
|
577
334ae707ebfc
more HTML template cleanup and unit tests
Richard Jones <richard@users.sourceforge.net>
parents:
576
diff
changeset
|
1001 # Revision 1.69 2002/01/23 05:10:27 richard |
|
334ae707ebfc
more HTML template cleanup and unit tests
Richard Jones <richard@users.sourceforge.net>
parents:
576
diff
changeset
|
1002 # More HTML template cleanup and unit tests. |
|
334ae707ebfc
more HTML template cleanup and unit tests
Richard Jones <richard@users.sourceforge.net>
parents:
576
diff
changeset
|
1003 # - download() now implemented correctly, replacing link(is_download=1) [fixed in the |
|
334ae707ebfc
more HTML template cleanup and unit tests
Richard Jones <richard@users.sourceforge.net>
parents:
576
diff
changeset
|
1004 # templates, but link(is_download=1) will still work for existing templates] |
|
334ae707ebfc
more HTML template cleanup and unit tests
Richard Jones <richard@users.sourceforge.net>
parents:
576
diff
changeset
|
1005 # |
|
576
f98f37697f4c
More HTML template cleanup and unit tests.
Richard Jones <richard@users.sourceforge.net>
parents:
575
diff
changeset
|
1006 # Revision 1.68 2002/01/22 22:55:28 richard |
|
f98f37697f4c
More HTML template cleanup and unit tests.
Richard Jones <richard@users.sourceforge.net>
parents:
575
diff
changeset
|
1007 # . htmltemplate list() wasn't sorting... |
|
f98f37697f4c
More HTML template cleanup and unit tests.
Richard Jones <richard@users.sourceforge.net>
parents:
575
diff
changeset
|
1008 # |
|
575
2df17627528d
htmltemplate list() wasn't sorting...
Richard Jones <richard@users.sourceforge.net>
parents:
574
diff
changeset
|
1009 # Revision 1.67 2002/01/22 22:46:22 richard |
|
2df17627528d
htmltemplate list() wasn't sorting...
Richard Jones <richard@users.sourceforge.net>
parents:
574
diff
changeset
|
1010 # more htmltemplate cleanups and unit tests |
|
2df17627528d
htmltemplate list() wasn't sorting...
Richard Jones <richard@users.sourceforge.net>
parents:
574
diff
changeset
|
1011 # |
|
574
d41d94511170
more htmltemplate cleanups and unit tests
Richard Jones <richard@users.sourceforge.net>
parents:
568
diff
changeset
|
1012 # Revision 1.66 2002/01/22 06:35:40 richard |
|
d41d94511170
more htmltemplate cleanups and unit tests
Richard Jones <richard@users.sourceforge.net>
parents:
568
diff
changeset
|
1013 # more htmltemplate tests and cleanup |
|
d41d94511170
more htmltemplate cleanups and unit tests
Richard Jones <richard@users.sourceforge.net>
parents:
568
diff
changeset
|
1014 # |
|
568
c7ead967db85
more htmltemplate tests and cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
563
diff
changeset
|
1015 # Revision 1.65 2002/01/22 00:12:06 richard |
|
c7ead967db85
more htmltemplate tests and cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
563
diff
changeset
|
1016 # Wrote more unit tests for htmltemplate, and while I was at it, I polished |
|
c7ead967db85
more htmltemplate tests and cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
563
diff
changeset
|
1017 # off the implementation of some of the functions so they behave sanely. |
|
c7ead967db85
more htmltemplate tests and cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
563
diff
changeset
|
1018 # |
|
563
0f58d6a35a8b
Wrote more unit tests for htmltemplate...
Richard Jones <richard@users.sourceforge.net>
parents:
558
diff
changeset
|
1019 # Revision 1.64 2002/01/21 03:25:59 richard |
|
0f58d6a35a8b
Wrote more unit tests for htmltemplate...
Richard Jones <richard@users.sourceforge.net>
parents:
558
diff
changeset
|
1020 # oops |
|
0f58d6a35a8b
Wrote more unit tests for htmltemplate...
Richard Jones <richard@users.sourceforge.net>
parents:
558
diff
changeset
|
1021 # |
| 558 | 1022 # Revision 1.63 2002/01/21 02:59:10 richard |
| 1023 # Fixed up the HTML display of history so valid links are actually displayed. | |
| 1024 # Oh for some unit tests! :( | |
| 1025 # | |
|
556
50359de2800b
Fixed up the HTML display of history so valid links are actually displayed.
Richard Jones <richard@users.sourceforge.net>
parents:
554
diff
changeset
|
1026 # Revision 1.62 2002/01/18 08:36:12 grubert |
|
50359de2800b
Fixed up the HTML display of history so valid links are actually displayed.
Richard Jones <richard@users.sourceforge.net>
parents:
554
diff
changeset
|
1027 # . add nowrap to history table date cell i.e. <td nowrap ... |
|
50359de2800b
Fixed up the HTML display of history so valid links are actually displayed.
Richard Jones <richard@users.sourceforge.net>
parents:
554
diff
changeset
|
1028 # |
|
554
7e7b4183a8bd
add nowrap to history table date cell i.e. <td nowrap ...
Engelbert Gruber <grubert@users.sourceforge.net>
parents:
552
diff
changeset
|
1029 # Revision 1.61 2002/01/17 23:04:53 richard |
|
7e7b4183a8bd
add nowrap to history table date cell i.e. <td nowrap ...
Engelbert Gruber <grubert@users.sourceforge.net>
parents:
552
diff
changeset
|
1030 # . much nicer history display (actualy real handling of property types etc) |
|
7e7b4183a8bd
add nowrap to history table date cell i.e. <td nowrap ...
Engelbert Gruber <grubert@users.sourceforge.net>
parents:
552
diff
changeset
|
1031 # |
|
552
0f8734a5a004
much nicer history display (actualy real handling of property types etc)
Richard Jones <richard@users.sourceforge.net>
parents:
548
diff
changeset
|
1032 # Revision 1.60 2002/01/17 08:48:19 grubert |
|
0f8734a5a004
much nicer history display (actualy real handling of property types etc)
Richard Jones <richard@users.sourceforge.net>
parents:
548
diff
changeset
|
1033 # . display superseder as html link in history. |
|
0f8734a5a004
much nicer history display (actualy real handling of property types etc)
Richard Jones <richard@users.sourceforge.net>
parents:
548
diff
changeset
|
1034 # |
|
548
3f25182ed425
display superseder as html link in history.
Engelbert Gruber <grubert@users.sourceforge.net>
parents:
547
diff
changeset
|
1035 # Revision 1.59 2002/01/17 07:58:24 grubert |
|
3f25182ed425
display superseder as html link in history.
Engelbert Gruber <grubert@users.sourceforge.net>
parents:
547
diff
changeset
|
1036 # . display links a html link in history. |
|
3f25182ed425
display superseder as html link in history.
Engelbert Gruber <grubert@users.sourceforge.net>
parents:
547
diff
changeset
|
1037 # |
|
547
e4ef6df2345c
display links a html link in history.
Engelbert Gruber <grubert@users.sourceforge.net>
parents:
538
diff
changeset
|
1038 # Revision 1.58 2002/01/15 00:50:03 richard |
|
e4ef6df2345c
display links a html link in history.
Engelbert Gruber <grubert@users.sourceforge.net>
parents:
538
diff
changeset
|
1039 # #502949 ] index view for non-issues and redisplay |
|
e4ef6df2345c
display links a html link in history.
Engelbert Gruber <grubert@users.sourceforge.net>
parents:
538
diff
changeset
|
1040 # |
|
538
67379bcc5da4
[SF#502949] index view for non-issues and redisplay
Richard Jones <richard@users.sourceforge.net>
parents:
535
diff
changeset
|
1041 # Revision 1.57 2002/01/14 23:31:21 richard |
|
67379bcc5da4
[SF#502949] index view for non-issues and redisplay
Richard Jones <richard@users.sourceforge.net>
parents:
535
diff
changeset
|
1042 # reverted the change that had plain() hyperlinking the link displays - |
|
67379bcc5da4
[SF#502949] index view for non-issues and redisplay
Richard Jones <richard@users.sourceforge.net>
parents:
535
diff
changeset
|
1043 # that's what link() is for! |
|
67379bcc5da4
[SF#502949] index view for non-issues and redisplay
Richard Jones <richard@users.sourceforge.net>
parents:
535
diff
changeset
|
1044 # |
|
535
78711b29c746
reverted the change that had plain() hyperlinking the link displays
Richard Jones <richard@users.sourceforge.net>
parents:
531
diff
changeset
|
1045 # Revision 1.56 2002/01/14 07:04:36 richard |
|
78711b29c746
reverted the change that had plain() hyperlinking the link displays
Richard Jones <richard@users.sourceforge.net>
parents:
531
diff
changeset
|
1046 # . plain rendering of links in the htmltemplate now generate a hyperlink to |
|
78711b29c746
reverted the change that had plain() hyperlinking the link displays
Richard Jones <richard@users.sourceforge.net>
parents:
531
diff
changeset
|
1047 # the linked node's page. |
|
78711b29c746
reverted the change that had plain() hyperlinking the link displays
Richard Jones <richard@users.sourceforge.net>
parents:
531
diff
changeset
|
1048 # ... this allows a display very similar to bugzilla's where you can actually |
|
78711b29c746
reverted the change that had plain() hyperlinking the link displays
Richard Jones <richard@users.sourceforge.net>
parents:
531
diff
changeset
|
1049 # find out information about the linked node. |
|
78711b29c746
reverted the change that had plain() hyperlinking the link displays
Richard Jones <richard@users.sourceforge.net>
parents:
531
diff
changeset
|
1050 # |
|
531
32c1dd156605
plain rendering of links in the htmltemplate now generate a hyperlink...
Richard Jones <richard@users.sourceforge.net>
parents:
528
diff
changeset
|
1051 # Revision 1.55 2002/01/14 06:45:03 richard |
|
32c1dd156605
plain rendering of links in the htmltemplate now generate a hyperlink...
Richard Jones <richard@users.sourceforge.net>
parents:
528
diff
changeset
|
1052 # . #502953 ] nosy-like treatment of other multilinks |
|
32c1dd156605
plain rendering of links in the htmltemplate now generate a hyperlink...
Richard Jones <richard@users.sourceforge.net>
parents:
528
diff
changeset
|
1053 # ... had to revert most of the previous change to the multilink field |
|
32c1dd156605
plain rendering of links in the htmltemplate now generate a hyperlink...
Richard Jones <richard@users.sourceforge.net>
parents:
528
diff
changeset
|
1054 # display... not good. |
|
32c1dd156605
plain rendering of links in the htmltemplate now generate a hyperlink...
Richard Jones <richard@users.sourceforge.net>
parents:
528
diff
changeset
|
1055 # |
|
528
72fe808ff5b8
[SF#502953] nosy-like treatment of other multilinks
Richard Jones <richard@users.sourceforge.net>
parents:
526
diff
changeset
|
1056 # Revision 1.54 2002/01/14 05:16:51 richard |
|
72fe808ff5b8
[SF#502953] nosy-like treatment of other multilinks
Richard Jones <richard@users.sourceforge.net>
parents:
526
diff
changeset
|
1057 # The submit buttons need a name attribute or mozilla won't submit without a |
|
72fe808ff5b8
[SF#502953] nosy-like treatment of other multilinks
Richard Jones <richard@users.sourceforge.net>
parents:
526
diff
changeset
|
1058 # file upload. Yeah, that's bloody obscure. Grr. |
|
72fe808ff5b8
[SF#502953] nosy-like treatment of other multilinks
Richard Jones <richard@users.sourceforge.net>
parents:
526
diff
changeset
|
1059 # |
|
526
523b22a2c021
The submit buttons need a name attribute...
Richard Jones <richard@users.sourceforge.net>
parents:
525
diff
changeset
|
1060 # Revision 1.53 2002/01/14 04:03:32 richard |
|
523b22a2c021
The submit buttons need a name attribute...
Richard Jones <richard@users.sourceforge.net>
parents:
525
diff
changeset
|
1061 # How about that ... date fields have never worked ... |
|
523b22a2c021
The submit buttons need a name attribute...
Richard Jones <richard@users.sourceforge.net>
parents:
525
diff
changeset
|
1062 # |
|
525
d046cc4ba7d3
How about that ... date fields have never worked ...
Richard Jones <richard@users.sourceforge.net>
parents:
524
diff
changeset
|
1063 # Revision 1.52 2002/01/14 02:20:14 richard |
|
d046cc4ba7d3
How about that ... date fields have never worked ...
Richard Jones <richard@users.sourceforge.net>
parents:
524
diff
changeset
|
1064 # . changed all config accesses so they access either the instance or the |
|
d046cc4ba7d3
How about that ... date fields have never worked ...
Richard Jones <richard@users.sourceforge.net>
parents:
524
diff
changeset
|
1065 # config attriubute on the db. This means that all config is obtained from |
|
d046cc4ba7d3
How about that ... date fields have never worked ...
Richard Jones <richard@users.sourceforge.net>
parents:
524
diff
changeset
|
1066 # instance_config instead of the mish-mash of classes. This will make |
|
d046cc4ba7d3
How about that ... date fields have never worked ...
Richard Jones <richard@users.sourceforge.net>
parents:
524
diff
changeset
|
1067 # switching to a ConfigParser setup easier too, I hope. |
|
d046cc4ba7d3
How about that ... date fields have never worked ...
Richard Jones <richard@users.sourceforge.net>
parents:
524
diff
changeset
|
1068 # |
|
d046cc4ba7d3
How about that ... date fields have never worked ...
Richard Jones <richard@users.sourceforge.net>
parents:
524
diff
changeset
|
1069 # At a minimum, this makes migration a _little_ easier (a lot easier in the |
|
d046cc4ba7d3
How about that ... date fields have never worked ...
Richard Jones <richard@users.sourceforge.net>
parents:
524
diff
changeset
|
1070 # 0.5.0 switch, I hope!) |
|
d046cc4ba7d3
How about that ... date fields have never worked ...
Richard Jones <richard@users.sourceforge.net>
parents:
524
diff
changeset
|
1071 # |
|
524
dce4c75bef5a
changed all config accesses...
Richard Jones <richard@users.sourceforge.net>
parents:
515
diff
changeset
|
1072 # Revision 1.51 2002/01/10 10:02:15 grubert |
|
dce4c75bef5a
changed all config accesses...
Richard Jones <richard@users.sourceforge.net>
parents:
515
diff
changeset
|
1073 # In do_history: replace "." in date by " " so html wraps more sensible. |
|
dce4c75bef5a
changed all config accesses...
Richard Jones <richard@users.sourceforge.net>
parents:
515
diff
changeset
|
1074 # Should this be done in date's string converter ? |
|
dce4c75bef5a
changed all config accesses...
Richard Jones <richard@users.sourceforge.net>
parents:
515
diff
changeset
|
1075 # |
|
515
59e721a72a30
In do_history: replace "." in date by " " so html wraps more sensible.
Engelbert Gruber <grubert@users.sourceforge.net>
parents:
488
diff
changeset
|
1076 # Revision 1.50 2002/01/05 02:35:10 richard |
|
59e721a72a30
In do_history: replace "." in date by " " so html wraps more sensible.
Engelbert Gruber <grubert@users.sourceforge.net>
parents:
488
diff
changeset
|
1077 # I18N'ification |
|
59e721a72a30
In do_history: replace "." in date by " " so html wraps more sensible.
Engelbert Gruber <grubert@users.sourceforge.net>
parents:
488
diff
changeset
|
1078 # |
|
488
ab9e236cd524
I18N'ification
Richard Jones <richard@users.sourceforge.net>
parents:
467
diff
changeset
|
1079 # Revision 1.49 2001/12/20 15:43:01 rochecompaan |
|
ab9e236cd524
I18N'ification
Richard Jones <richard@users.sourceforge.net>
parents:
467
diff
changeset
|
1080 # Features added: |
|
ab9e236cd524
I18N'ification
Richard Jones <richard@users.sourceforge.net>
parents:
467
diff
changeset
|
1081 # . Multilink properties are now displayed as comma separated values in |
|
ab9e236cd524
I18N'ification
Richard Jones <richard@users.sourceforge.net>
parents:
467
diff
changeset
|
1082 # a textbox |
|
ab9e236cd524
I18N'ification
Richard Jones <richard@users.sourceforge.net>
parents:
467
diff
changeset
|
1083 # . The add user link is now only visible to the admin user |
|
ab9e236cd524
I18N'ification
Richard Jones <richard@users.sourceforge.net>
parents:
467
diff
changeset
|
1084 # . Modified the mail gateway to reject submissions from unknown |
|
ab9e236cd524
I18N'ification
Richard Jones <richard@users.sourceforge.net>
parents:
467
diff
changeset
|
1085 # addresses if ANONYMOUS_ACCESS is denied |
|
ab9e236cd524
I18N'ification
Richard Jones <richard@users.sourceforge.net>
parents:
467
diff
changeset
|
1086 # |
|
467
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1087 # Revision 1.48 2001/12/20 06:13:24 rochecompaan |
|
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1088 # Bugs fixed: |
|
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1089 # . Exception handling in hyperdb for strings-that-look-like numbers got |
|
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1090 # lost somewhere |
|
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1091 # . Internet Explorer submits full path for filename - we now strip away |
|
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1092 # the path |
|
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1093 # Features added: |
|
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1094 # . Link and multilink properties are now displayed sorted in the cgi |
|
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1095 # interface |
|
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1096 # |
|
466
a3548136f7bb
Two bug fixes and a feature.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
411
diff
changeset
|
1097 # Revision 1.47 2001/11/26 22:55:56 richard |
|
a3548136f7bb
Two bug fixes and a feature.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
411
diff
changeset
|
1098 # Feature: |
|
a3548136f7bb
Two bug fixes and a feature.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
411
diff
changeset
|
1099 # . Added INSTANCE_NAME to configuration - used in web and email to identify |
|
a3548136f7bb
Two bug fixes and a feature.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
411
diff
changeset
|
1100 # the instance. |
|
a3548136f7bb
Two bug fixes and a feature.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
411
diff
changeset
|
1101 # . Added EMAIL_SIGNATURE_POSITION to indicate where to place the roundup |
|
a3548136f7bb
Two bug fixes and a feature.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
411
diff
changeset
|
1102 # signature info in e-mails. |
|
a3548136f7bb
Two bug fixes and a feature.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
411
diff
changeset
|
1103 # . Some more flexibility in the mail gateway and more error handling. |
|
a3548136f7bb
Two bug fixes and a feature.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
411
diff
changeset
|
1104 # . Login now takes you to the page you back to the were denied access to. |
|
a3548136f7bb
Two bug fixes and a feature.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
411
diff
changeset
|
1105 # |
|
a3548136f7bb
Two bug fixes and a feature.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
411
diff
changeset
|
1106 # Fixed: |
|
a3548136f7bb
Two bug fixes and a feature.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
411
diff
changeset
|
1107 # . Lots of bugs, thanks Roché and others on the devel mailing list! |
|
a3548136f7bb
Two bug fixes and a feature.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
411
diff
changeset
|
1108 # |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
408
diff
changeset
|
1109 # Revision 1.46 2001/11/24 00:53:12 jhermann |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
408
diff
changeset
|
1110 # "except:" is bad, bad , bad! |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
408
diff
changeset
|
1111 # |
|
408
424bfccd4118
"except:" is bad, bad , bad!
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
406
diff
changeset
|
1112 # Revision 1.45 2001/11/22 15:46:42 jhermann |
|
424bfccd4118
"except:" is bad, bad , bad!
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
406
diff
changeset
|
1113 # Added module docstrings to all modules. |
|
424bfccd4118
"except:" is bad, bad , bad!
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
406
diff
changeset
|
1114 # |
|
406
bdc2ea127ae9
Added module docstrings to all modules.
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
401
diff
changeset
|
1115 # Revision 1.44 2001/11/21 23:35:45 jhermann |
|
bdc2ea127ae9
Added module docstrings to all modules.
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
401
diff
changeset
|
1116 # Added globbing for win32, and sample marking in a 2nd file to test it |
|
bdc2ea127ae9
Added module docstrings to all modules.
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
401
diff
changeset
|
1117 # |
|
401
a930feb07dc4
Added globbing for win32, and sample marking in a 2nd file to test it
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
398
diff
changeset
|
1118 # Revision 1.43 2001/11/21 04:04:43 richard |
|
a930feb07dc4
Added globbing for win32, and sample marking in a 2nd file to test it
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
398
diff
changeset
|
1119 # *sigh* more missing value handling |
|
a930feb07dc4
Added globbing for win32, and sample marking in a 2nd file to test it
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
398
diff
changeset
|
1120 # |
|
398
bbbcdee47762
*sigh* more missing value handling
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
1121 # Revision 1.42 2001/11/21 03:40:54 richard |
|
bbbcdee47762
*sigh* more missing value handling
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
1122 # more new property handling |
|
bbbcdee47762
*sigh* more missing value handling
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
1123 # |
|
397
d47818b09265
more new property handling
Richard Jones <richard@users.sourceforge.net>
parents:
392
diff
changeset
|
1124 # Revision 1.41 2001/11/15 10:26:01 richard |
|
d47818b09265
more new property handling
Richard Jones <richard@users.sourceforge.net>
parents:
392
diff
changeset
|
1125 # . missing "return" in filter_section (thanks Roch'e Compaan) |
|
d47818b09265
more new property handling
Richard Jones <richard@users.sourceforge.net>
parents:
392
diff
changeset
|
1126 # |
|
392
a9edec536e0a
missing "return" in filter_section (thanks Roch'e Compaan)
Richard Jones <richard@users.sourceforge.net>
parents:
351
diff
changeset
|
1127 # Revision 1.40 2001/11/03 01:56:51 richard |
|
a9edec536e0a
missing "return" in filter_section (thanks Roch'e Compaan)
Richard Jones <richard@users.sourceforge.net>
parents:
351
diff
changeset
|
1128 # More HTML compliance fixes. This will probably fix the Netscape problem |
|
a9edec536e0a
missing "return" in filter_section (thanks Roch'e Compaan)
Richard Jones <richard@users.sourceforge.net>
parents:
351
diff
changeset
|
1129 # too. |
|
a9edec536e0a
missing "return" in filter_section (thanks Roch'e Compaan)
Richard Jones <richard@users.sourceforge.net>
parents:
351
diff
changeset
|
1130 # |
|
351
6932067a8f31
More HTML compliance fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
350
diff
changeset
|
1131 # Revision 1.39 2001/11/03 01:43:47 richard |
|
6932067a8f31
More HTML compliance fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
350
diff
changeset
|
1132 # Ahah! Fixed the lynx problem - there was a hidden input field misplaced. |
|
6932067a8f31
More HTML compliance fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
350
diff
changeset
|
1133 # |
|
350
e8d244a98ffd
Ahah! Fixed the lynx problem - there was a hidden input field misplaced.
Richard Jones <richard@users.sourceforge.net>
parents:
342
diff
changeset
|
1134 # Revision 1.38 2001/10/31 06:58:51 richard |
|
e8d244a98ffd
Ahah! Fixed the lynx problem - there was a hidden input field misplaced.
Richard Jones <richard@users.sourceforge.net>
parents:
342
diff
changeset
|
1135 # Added the wrap="hard" attribute to the textarea of the note field so the |
|
e8d244a98ffd
Ahah! Fixed the lynx problem - there was a hidden input field misplaced.
Richard Jones <richard@users.sourceforge.net>
parents:
342
diff
changeset
|
1136 # messages wrap sanely. |
|
e8d244a98ffd
Ahah! Fixed the lynx problem - there was a hidden input field misplaced.
Richard Jones <richard@users.sourceforge.net>
parents:
342
diff
changeset
|
1137 # |
|
342
0b7d62e414b6
Added the wrap="hard" attribute to the textarea of the note field...
Richard Jones <richard@users.sourceforge.net>
parents:
340
diff
changeset
|
1138 # Revision 1.37 2001/10/31 06:24:35 richard |
|
0b7d62e414b6
Added the wrap="hard" attribute to the textarea of the note field...
Richard Jones <richard@users.sourceforge.net>
parents:
340
diff
changeset
|
1139 # Added do_stext to htmltemplate, thanks Brad Clements. |
|
0b7d62e414b6
Added the wrap="hard" attribute to the textarea of the note field...
Richard Jones <richard@users.sourceforge.net>
parents:
340
diff
changeset
|
1140 # |
|
340
9311fa91f478
Added do_stext to htmltemplate, thanks Brad Clements.
Richard Jones <richard@users.sourceforge.net>
parents:
332
diff
changeset
|
1141 # Revision 1.36 2001/10/28 22:51:38 richard |
|
9311fa91f478
Added do_stext to htmltemplate, thanks Brad Clements.
Richard Jones <richard@users.sourceforge.net>
parents:
332
diff
changeset
|
1142 # Fixed ENOENT/WindowsError thing, thanks Juergen Hermann |
|
9311fa91f478
Added do_stext to htmltemplate, thanks Brad Clements.
Richard Jones <richard@users.sourceforge.net>
parents:
332
diff
changeset
|
1143 # |
|
332
1fe356fc3d3e
Fixed ENOENT/WindowsError thing, thanks Juergen Hermann
Richard Jones <richard@users.sourceforge.net>
parents:
327
diff
changeset
|
1144 # Revision 1.35 2001/10/24 00:04:41 richard |
|
1fe356fc3d3e
Fixed ENOENT/WindowsError thing, thanks Juergen Hermann
Richard Jones <richard@users.sourceforge.net>
parents:
327
diff
changeset
|
1145 # Removed the "infinite authentication loop", thanks Roch'e |
|
1fe356fc3d3e
Fixed ENOENT/WindowsError thing, thanks Juergen Hermann
Richard Jones <richard@users.sourceforge.net>
parents:
327
diff
changeset
|
1146 # |
|
327
ee8882029150
Removed the "infinite authentication loop", thanks Roch'e
Richard Jones <richard@users.sourceforge.net>
parents:
320
diff
changeset
|
1147 # Revision 1.34 2001/10/23 22:56:36 richard |
|
ee8882029150
Removed the "infinite authentication loop", thanks Roch'e
Richard Jones <richard@users.sourceforge.net>
parents:
320
diff
changeset
|
1148 # Bugfix in filter "widget" placement, thanks Roch'e |
|
ee8882029150
Removed the "infinite authentication loop", thanks Roch'e
Richard Jones <richard@users.sourceforge.net>
parents:
320
diff
changeset
|
1149 # |
|
320
61c42790c3f1
Bugfix in filter "widget" placement, thanks Roch'e
Richard Jones <richard@users.sourceforge.net>
parents:
318
diff
changeset
|
1150 # Revision 1.33 2001/10/23 01:00:18 richard |
|
61c42790c3f1
Bugfix in filter "widget" placement, thanks Roch'e
Richard Jones <richard@users.sourceforge.net>
parents:
318
diff
changeset
|
1151 # Re-enabled login and registration access after lopping them off via |
|
61c42790c3f1
Bugfix in filter "widget" placement, thanks Roch'e
Richard Jones <richard@users.sourceforge.net>
parents:
318
diff
changeset
|
1152 # disabling access for anonymous users. |
|
61c42790c3f1
Bugfix in filter "widget" placement, thanks Roch'e
Richard Jones <richard@users.sourceforge.net>
parents:
318
diff
changeset
|
1153 # Major re-org of the htmltemplate code, cleaning it up significantly. Fixed |
|
61c42790c3f1
Bugfix in filter "widget" placement, thanks Roch'e
Richard Jones <richard@users.sourceforge.net>
parents:
318
diff
changeset
|
1154 # a couple of bugs while I was there. Probably introduced a couple, but |
|
61c42790c3f1
Bugfix in filter "widget" placement, thanks Roch'e
Richard Jones <richard@users.sourceforge.net>
parents:
318
diff
changeset
|
1155 # things seem to work OK at the moment. |
|
61c42790c3f1
Bugfix in filter "widget" placement, thanks Roch'e
Richard Jones <richard@users.sourceforge.net>
parents:
318
diff
changeset
|
1156 # |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
1157 # Revision 1.32 2001/10/22 03:25:01 richard |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
1158 # Added configuration for: |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
1159 # . anonymous user access and registration (deny/allow) |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
1160 # . filter "widget" location on index page (top, bottom, both) |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
1161 # Updated some documentation. |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
1162 # |
|
316
c0ca7f35e0c5
Added configuration for:
Richard Jones <richard@users.sourceforge.net>
parents:
313
diff
changeset
|
1163 # Revision 1.31 2001/10/21 07:26:35 richard |
|
c0ca7f35e0c5
Added configuration for:
Richard Jones <richard@users.sourceforge.net>
parents:
313
diff
changeset
|
1164 # feature #473127: Filenames. I modified the file.index and htmltemplate |
|
c0ca7f35e0c5
Added configuration for:
Richard Jones <richard@users.sourceforge.net>
parents:
313
diff
changeset
|
1165 # source so that the filename is used in the link and the creation |
|
c0ca7f35e0c5
Added configuration for:
Richard Jones <richard@users.sourceforge.net>
parents:
313
diff
changeset
|
1166 # information is displayed. |
|
c0ca7f35e0c5
Added configuration for:
Richard Jones <richard@users.sourceforge.net>
parents:
313
diff
changeset
|
1167 # |
|
313
489b70c37f32
feature [SF#473127]: Filenames.
Richard Jones <richard@users.sourceforge.net>
parents:
312
diff
changeset
|
1168 # Revision 1.30 2001/10/21 04:44:50 richard |
|
489b70c37f32
feature [SF#473127]: Filenames.
Richard Jones <richard@users.sourceforge.net>
parents:
312
diff
changeset
|
1169 # bug #473124: UI inconsistency with Link fields. |
|
489b70c37f32
feature [SF#473127]: Filenames.
Richard Jones <richard@users.sourceforge.net>
parents:
312
diff
changeset
|
1170 # This also prompted me to fix a fairly long-standing usability issue - |
|
489b70c37f32
feature [SF#473127]: Filenames.
Richard Jones <richard@users.sourceforge.net>
parents:
312
diff
changeset
|
1171 # that of being able to turn off certain filters. |
|
489b70c37f32
feature [SF#473127]: Filenames.
Richard Jones <richard@users.sourceforge.net>
parents:
312
diff
changeset
|
1172 # |
|
312
5a2c43891c20
[SF#473124]: UI inconsistency with Link fields.
Richard Jones <richard@users.sourceforge.net>
parents:
307
diff
changeset
|
1173 # Revision 1.29 2001/10/21 00:17:56 richard |
|
5a2c43891c20
[SF#473124]: UI inconsistency with Link fields.
Richard Jones <richard@users.sourceforge.net>
parents:
307
diff
changeset
|
1174 # CGI interface view customisation section may now be hidden (patch from |
|
5a2c43891c20
[SF#473124]: UI inconsistency with Link fields.
Richard Jones <richard@users.sourceforge.net>
parents:
307
diff
changeset
|
1175 # Roch'e Compaan.) |
|
5a2c43891c20
[SF#473124]: UI inconsistency with Link fields.
Richard Jones <richard@users.sourceforge.net>
parents:
307
diff
changeset
|
1176 # |
|
307
dac78e092228
CGI interface view customisation section may now be hidden
Richard Jones <richard@users.sourceforge.net>
parents:
306
diff
changeset
|
1177 # Revision 1.28 2001/10/21 00:00:16 richard |
|
dac78e092228
CGI interface view customisation section may now be hidden
Richard Jones <richard@users.sourceforge.net>
parents:
306
diff
changeset
|
1178 # Fixed Checklist function - wasn't always working on a list. |
|
dac78e092228
CGI interface view customisation section may now be hidden
Richard Jones <richard@users.sourceforge.net>
parents:
306
diff
changeset
|
1179 # |
|
306
36ae7ffb8a42
Fixed Checklist function - wasn't always working on a list.
Richard Jones <richard@users.sourceforge.net>
parents:
303
diff
changeset
|
1180 # Revision 1.27 2001/10/20 12:13:44 richard |
|
36ae7ffb8a42
Fixed Checklist function - wasn't always working on a list.
Richard Jones <richard@users.sourceforge.net>
parents:
303
diff
changeset
|
1181 # Fixed grouping of non-str properties (thanks Roch'e Compaan) |
|
36ae7ffb8a42
Fixed Checklist function - wasn't always working on a list.
Richard Jones <richard@users.sourceforge.net>
parents:
303
diff
changeset
|
1182 # |
|
303
3d5031f834f0
Fixed grouping of non-str properties (thanks Roch'e Compaan)
Richard Jones <richard@users.sourceforge.net>
parents:
292
diff
changeset
|
1183 # Revision 1.26 2001/10/14 10:55:00 richard |
|
3d5031f834f0
Fixed grouping of non-str properties (thanks Roch'e Compaan)
Richard Jones <richard@users.sourceforge.net>
parents:
292
diff
changeset
|
1184 # Handle empty strings in HTML template Link function |
|
3d5031f834f0
Fixed grouping of non-str properties (thanks Roch'e Compaan)
Richard Jones <richard@users.sourceforge.net>
parents:
292
diff
changeset
|
1185 # |
|
292
4340cdc694d4
Handle empty strings in HTML template Link function
Richard Jones <richard@users.sourceforge.net>
parents:
270
diff
changeset
|
1186 # Revision 1.25 2001/10/09 07:25:59 richard |
|
4340cdc694d4
Handle empty strings in HTML template Link function
Richard Jones <richard@users.sourceforge.net>
parents:
270
diff
changeset
|
1187 # Added the Password property type. See "pydoc roundup.password" for |
|
4340cdc694d4
Handle empty strings in HTML template Link function
Richard Jones <richard@users.sourceforge.net>
parents:
270
diff
changeset
|
1188 # implementation details. Have updated some of the documentation too. |
|
4340cdc694d4
Handle empty strings in HTML template Link function
Richard Jones <richard@users.sourceforge.net>
parents:
270
diff
changeset
|
1189 # |
|
270
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
250
diff
changeset
|
1190 # Revision 1.24 2001/09/27 06:45:58 richard |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
250
diff
changeset
|
1191 # *gak* ... xmp is Old Skool apparently. Am using pre again by have the option |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
250
diff
changeset
|
1192 # on the plain() template function to escape the text for HTML. |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
250
diff
changeset
|
1193 # |
|
250
1d428068485c
*gak* ... xmp is Old Skool apparently.
Richard Jones <richard@users.sourceforge.net>
parents:
245
diff
changeset
|
1194 # Revision 1.23 2001/09/10 09:47:18 richard |
|
1d428068485c
*gak* ... xmp is Old Skool apparently.
Richard Jones <richard@users.sourceforge.net>
parents:
245
diff
changeset
|
1195 # Fixed bug in the generation of links to Link/Multilink in indexes. |
|
1d428068485c
*gak* ... xmp is Old Skool apparently.
Richard Jones <richard@users.sourceforge.net>
parents:
245
diff
changeset
|
1196 # (thanks Hubert Hoegl) |
|
1d428068485c
*gak* ... xmp is Old Skool apparently.
Richard Jones <richard@users.sourceforge.net>
parents:
245
diff
changeset
|
1197 # Added AssignedTo to the "classic" schema's item page. |
|
1d428068485c
*gak* ... xmp is Old Skool apparently.
Richard Jones <richard@users.sourceforge.net>
parents:
245
diff
changeset
|
1198 # |
|
245
8a0d548c07a1
Fixed bug in the generation of links to Link/Multilink in indexes.
Richard Jones <richard@users.sourceforge.net>
parents:
244
diff
changeset
|
1199 # Revision 1.22 2001/08/30 06:01:17 richard |
|
8a0d548c07a1
Fixed bug in the generation of links to Link/Multilink in indexes.
Richard Jones <richard@users.sourceforge.net>
parents:
244
diff
changeset
|
1200 # Fixed missing import in mailgw :( |
|
8a0d548c07a1
Fixed bug in the generation of links to Link/Multilink in indexes.
Richard Jones <richard@users.sourceforge.net>
parents:
244
diff
changeset
|
1201 # |
|
244
6bf584784e31
Fixed missing import in mailgw :(
Richard Jones <richard@users.sourceforge.net>
parents:
231
diff
changeset
|
1202 # Revision 1.21 2001/08/16 07:34:59 richard |
|
6bf584784e31
Fixed missing import in mailgw :(
Richard Jones <richard@users.sourceforge.net>
parents:
231
diff
changeset
|
1203 # better CGI text searching - but hidden filter fields are disappearing... |
|
6bf584784e31
Fixed missing import in mailgw :(
Richard Jones <richard@users.sourceforge.net>
parents:
231
diff
changeset
|
1204 # |
|
231
afd428ba6523
better CGI text searching - but hidden filter fields are disappearing...
Richard Jones <richard@users.sourceforge.net>
parents:
228
diff
changeset
|
1205 # Revision 1.20 2001/08/15 23:43:18 richard |
|
afd428ba6523
better CGI text searching - but hidden filter fields are disappearing...
Richard Jones <richard@users.sourceforge.net>
parents:
228
diff
changeset
|
1206 # Fixed some isFooTypes that I missed. |
|
afd428ba6523
better CGI text searching - but hidden filter fields are disappearing...
Richard Jones <richard@users.sourceforge.net>
parents:
228
diff
changeset
|
1207 # Refactored some code in the CGI code. |
|
afd428ba6523
better CGI text searching - but hidden filter fields are disappearing...
Richard Jones <richard@users.sourceforge.net>
parents:
228
diff
changeset
|
1208 # |
|
228
1d1848c99abe
Fixed some isFooTypes that I missed.
Richard Jones <richard@users.sourceforge.net>
parents:
224
diff
changeset
|
1209 # Revision 1.19 2001/08/12 06:32:36 richard |
|
1d1848c99abe
Fixed some isFooTypes that I missed.
Richard Jones <richard@users.sourceforge.net>
parents:
224
diff
changeset
|
1210 # using isinstance(blah, Foo) now instead of isFooType |
|
1d1848c99abe
Fixed some isFooTypes that I missed.
Richard Jones <richard@users.sourceforge.net>
parents:
224
diff
changeset
|
1211 # |
|
224
ad2c98faec97
using isinstance(blah, Foo) now instead of isFooType
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
1212 # Revision 1.18 2001/08/07 00:24:42 richard |
|
ad2c98faec97
using isinstance(blah, Foo) now instead of isFooType
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
1213 # stupid typo |
|
ad2c98faec97
using isinstance(blah, Foo) now instead of isFooType
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
1214 # |
| 214 | 1215 # Revision 1.17 2001/08/07 00:15:51 richard |
| 1216 # Added the copyright/license notice to (nearly) all files at request of | |
| 1217 # Bizar Software. | |
| 1218 # | |
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
1219 # Revision 1.16 2001/08/01 03:52:23 richard |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
1220 # Checklist was using wrong name. |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
1221 # |
|
171
3c19bc818711
Checklist was using wrong name.
Richard Jones <richard@users.sourceforge.net>
parents:
167
diff
changeset
|
1222 # Revision 1.15 2001/07/30 08:12:17 richard |
|
3c19bc818711
Checklist was using wrong name.
Richard Jones <richard@users.sourceforge.net>
parents:
167
diff
changeset
|
1223 # Added time logging and file uploading to the templates. |
|
3c19bc818711
Checklist was using wrong name.
Richard Jones <richard@users.sourceforge.net>
parents:
167
diff
changeset
|
1224 # |
|
167
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
162
diff
changeset
|
1225 # Revision 1.14 2001/07/30 06:17:45 richard |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
162
diff
changeset
|
1226 # Features: |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
162
diff
changeset
|
1227 # . Added ability for cgi newblah forms to indicate that the new node |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
162
diff
changeset
|
1228 # should be linked somewhere. |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
162
diff
changeset
|
1229 # Fixed: |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
162
diff
changeset
|
1230 # . Fixed the agument handling for the roundup-admin find command. |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
162
diff
changeset
|
1231 # . Fixed handling of summary when no note supplied for newblah. Again. |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
162
diff
changeset
|
1232 # . Fixed detection of no form in htmltemplate Field display. |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
162
diff
changeset
|
1233 # |
|
162
717f12e6ccf2
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
155
diff
changeset
|
1234 # Revision 1.13 2001/07/30 02:37:53 richard |
|
717f12e6ccf2
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
155
diff
changeset
|
1235 # Temporary measure until we have decent schema migration. |
|
717f12e6ccf2
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
155
diff
changeset
|
1236 # |
|
155
03bdef2d645b
Temporary measure until we have decent schema migration.
Richard Jones <richard@users.sourceforge.net>
parents:
141
diff
changeset
|
1237 # Revision 1.12 2001/07/30 01:24:33 richard |
|
03bdef2d645b
Temporary measure until we have decent schema migration.
Richard Jones <richard@users.sourceforge.net>
parents:
141
diff
changeset
|
1238 # Handles new node display now. |
|
03bdef2d645b
Temporary measure until we have decent schema migration.
Richard Jones <richard@users.sourceforge.net>
parents:
141
diff
changeset
|
1239 # |
|
141
5e8da9d010bd
Handles new node display now.
Richard Jones <richard@users.sourceforge.net>
parents:
131
diff
changeset
|
1240 # Revision 1.11 2001/07/29 09:31:35 richard |
|
5e8da9d010bd
Handles new node display now.
Richard Jones <richard@users.sourceforge.net>
parents:
131
diff
changeset
|
1241 # oops |
|
5e8da9d010bd
Handles new node display now.
Richard Jones <richard@users.sourceforge.net>
parents:
131
diff
changeset
|
1242 # |
| 131 | 1243 # Revision 1.10 2001/07/29 09:28:23 richard |
| 1244 # Fixed sorting by clicking on column headings. | |
| 1245 # | |
|
130
204f99944de0
Fixed sorting by clicking on column headings.
Richard Jones <richard@users.sourceforge.net>
parents:
128
diff
changeset
|
1246 # Revision 1.9 2001/07/29 08:27:40 richard |
|
204f99944de0
Fixed sorting by clicking on column headings.
Richard Jones <richard@users.sourceforge.net>
parents:
128
diff
changeset
|
1247 # Fixed handling of passed-in values in form elements (ie. during a |
|
204f99944de0
Fixed sorting by clicking on column headings.
Richard Jones <richard@users.sourceforge.net>
parents:
128
diff
changeset
|
1248 # drill-down) |
|
204f99944de0
Fixed sorting by clicking on column headings.
Richard Jones <richard@users.sourceforge.net>
parents:
128
diff
changeset
|
1249 # |
|
128
ce36f2962b94
Fixed handling of passed-in values in form elements (ie. during a drill-down)
Richard Jones <richard@users.sourceforge.net>
parents:
127
diff
changeset
|
1250 # Revision 1.8 2001/07/29 07:01:39 richard |
|
ce36f2962b94
Fixed handling of passed-in values in form elements (ie. during a drill-down)
Richard Jones <richard@users.sourceforge.net>
parents:
127
diff
changeset
|
1251 # Added vim command to all source so that we don't get no steenkin' tabs :) |
|
ce36f2962b94
Fixed handling of passed-in values in form elements (ie. during a drill-down)
Richard Jones <richard@users.sourceforge.net>
parents:
127
diff
changeset
|
1252 # |
|
127
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
123
diff
changeset
|
1253 # Revision 1.7 2001/07/29 05:36:14 richard |
|
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
123
diff
changeset
|
1254 # Cleanup of the link label generation. |
|
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
123
diff
changeset
|
1255 # |
|
123
51cce9671db0
Cleanup of the link label generation.
Richard Jones <richard@users.sourceforge.net>
parents:
119
diff
changeset
|
1256 # Revision 1.6 2001/07/29 04:06:42 richard |
|
51cce9671db0
Cleanup of the link label generation.
Richard Jones <richard@users.sourceforge.net>
parents:
119
diff
changeset
|
1257 # Fixed problem in link display when Link value is None. |
|
51cce9671db0
Cleanup of the link label generation.
Richard Jones <richard@users.sourceforge.net>
parents:
119
diff
changeset
|
1258 # |
|
119
ad64dade1769
Fixed problem in link display when Link value is None.
Richard Jones <richard@users.sourceforge.net>
parents:
116
diff
changeset
|
1259 # Revision 1.5 2001/07/28 08:17:09 richard |
|
ad64dade1769
Fixed problem in link display when Link value is None.
Richard Jones <richard@users.sourceforge.net>
parents:
116
diff
changeset
|
1260 # fixed use of stylesheet |
|
ad64dade1769
Fixed problem in link display when Link value is None.
Richard Jones <richard@users.sourceforge.net>
parents:
116
diff
changeset
|
1261 # |
|
116
c73f727208b0
fixed use of stylesheet
Richard Jones <richard@users.sourceforge.net>
parents:
113
diff
changeset
|
1262 # Revision 1.4 2001/07/28 07:59:53 richard |
|
c73f727208b0
fixed use of stylesheet
Richard Jones <richard@users.sourceforge.net>
parents:
113
diff
changeset
|
1263 # Replaced errno integers with their module values. |
|
c73f727208b0
fixed use of stylesheet
Richard Jones <richard@users.sourceforge.net>
parents:
113
diff
changeset
|
1264 # De-tabbed templatebuilder.py |
|
c73f727208b0
fixed use of stylesheet
Richard Jones <richard@users.sourceforge.net>
parents:
113
diff
changeset
|
1265 # |
|
113
2ab86442799a
Replaced errno integers with their module values.
Richard Jones <richard@users.sourceforge.net>
parents:
72
diff
changeset
|
1266 # Revision 1.3 2001/07/25 03:39:47 richard |
|
2ab86442799a
Replaced errno integers with their module values.
Richard Jones <richard@users.sourceforge.net>
parents:
72
diff
changeset
|
1267 # Hrm - displaying links to classes that don't specify a key property. I've |
|
2ab86442799a
Replaced errno integers with their module values.
Richard Jones <richard@users.sourceforge.net>
parents:
72
diff
changeset
|
1268 # got it defaulting to 'name', then 'title' and then a "random" property (first |
|
2ab86442799a
Replaced errno integers with their module values.
Richard Jones <richard@users.sourceforge.net>
parents:
72
diff
changeset
|
1269 # one returned by getprops().keys(). |
|
2ab86442799a
Replaced errno integers with their module values.
Richard Jones <richard@users.sourceforge.net>
parents:
72
diff
changeset
|
1270 # Needs to be moved onto the Class I think... |
|
2ab86442799a
Replaced errno integers with their module values.
Richard Jones <richard@users.sourceforge.net>
parents:
72
diff
changeset
|
1271 # |
|
72
c186b637fee0
Hrm - displaying links to classes that don't specify a key property.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
1272 # Revision 1.2 2001/07/22 12:09:32 richard |
|
c186b637fee0
Hrm - displaying links to classes that don't specify a key property.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
1273 # Final commit of Grande Splite |
|
c186b637fee0
Hrm - displaying links to classes that don't specify a key property.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
1274 # |
|
26
c7c14960f413
Final commit of Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
25
diff
changeset
|
1275 # Revision 1.1 2001/07/22 11:58:35 richard |
|
c7c14960f413
Final commit of Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
25
diff
changeset
|
1276 # More Grande Splite |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1277 # |
|
127
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
123
diff
changeset
|
1278 # |
|
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
123
diff
changeset
|
1279 # vim: set filetype=python ts=4 sw=4 et si |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
1280 |
