Mercurial > p > roundup > code
annotate roundup/htmltemplate.py @ 934:fdcf16b444a9
Use a real parser for templates.
Rewrite htmltemplate to use the parser (hack, hack).
Move the "do_XXX" methods to template_funcs.py.
Redo the funcion tests (but not Template tests - they're hopeless).
Simplified query form in cgi_client.
Ability to delete msgs, files, queries.
Ability to edit the metadata on files.
| author | Gordon B. McMillan <gmcm@users.sourceforge.net> |
|---|---|
| date | Tue, 13 Aug 2002 20:16:10 +0000 |
| parents | 3c344e942055 |
| children | 57d09949380e |
| 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 # |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
18 # $Id: htmltemplate.py,v 1.110 2002-08-13 20:16:09 gmcm 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 """ |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
49 import weakref, os, types, cgi, sys, urllib, re |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
50 try: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
51 import cPickle as pickle |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
52 except ImportError: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
53 import pickle |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
54 from template_parser import RoundupTemplate, Display, Property, Require |
|
488
ab9e236cd524
I18N'ification
Richard Jones <richard@users.sourceforge.net>
parents:
467
diff
changeset
|
55 from i18n import _ |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
56 import hyperdb, template_funcs |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
57 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
58 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
|
59 |
|
627
952679be9e2c
Added simple editing for classes that don't define a templated interface.
Richard Jones <richard@users.sourceforge.net>
parents:
623
diff
changeset
|
60 class MissingTemplateError(ValueError): |
|
651
6257d4e49d2a
Ran it through pychecker, made fixes
Richard Jones <richard@users.sourceforge.net>
parents:
640
diff
changeset
|
61 '''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
|
62 ''' |
|
627
952679be9e2c
Added simple editing for classes that don't define a templated interface.
Richard Jones <richard@users.sourceforge.net>
parents:
623
diff
changeset
|
63 pass |
|
952679be9e2c
Added simple editing for classes that don't define a templated interface.
Richard Jones <richard@users.sourceforge.net>
parents:
623
diff
changeset
|
64 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
65 # what a <require> tag results in |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
66 def _test(attributes, client, classname, nodeid): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
67 tests = {} |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
68 for nm, val in attributes: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
69 tests[nm] = val |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
70 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
|
71 security = client.db.security |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
72 perms = tests.get('permission', None) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
73 if perms: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
74 del tests['permission'] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
75 perms = perms.split(',') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
76 for value in perms: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
77 if security.hasPermission(value, userid, classname): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
78 # just passing the permission is OK |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
79 return 1 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
80 # 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
|
81 if nodeid is None: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
82 return 0 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
83 if not tests: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
84 return 0 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
85 for propname, value in tests.items(): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
86 if value == '$userid': |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
87 tests[propname] = userid |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
88 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
|
89 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
90 # what a <display> tag results in |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
91 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
|
92 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
|
93 pos = call.find('(') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
94 funcnm = call[:pos] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
95 func = templatefuncs.get(funcnm, None) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
96 if func: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
97 argstr = call[pos:] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
98 args, kws = eval('splitargs'+argstr) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
99 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
|
100 rslt = func(*args, **kws) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
101 else: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
102 rslt = _('no template function %s' % funcnm) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
103 client.write(rslt) |
|
563
0f58d6a35a8b
Wrote more unit tests for htmltemplate...
Richard Jones <richard@users.sourceforge.net>
parents:
558
diff
changeset
|
104 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
105 # what a <property> tag results in |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
106 def _exists(attributes, cl, props, nodeid): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
107 nm = attributes[0][1] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
108 if nodeid: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
109 return cl.get(nodeid, nm) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
110 return props.get(nm, 0) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
111 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
112 class Template: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
113 ''' base class of all templates. |
|
563
0f58d6a35a8b
Wrote more unit tests for htmltemplate...
Richard Jones <richard@users.sourceforge.net>
parents:
558
diff
changeset
|
114 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
115 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
|
116 knows how to render one item. ''' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
117 def __init__(self, client, templates, classname): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
118 if isinstance(client, weakref.ProxyType): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
119 self.client = client |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
120 else: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
121 self.client = weakref.proxy(client) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
122 self.templatedir = templates |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
123 self.compiledtemplatedir = self.templatedir+'c' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
124 self.classname = classname |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
125 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
|
126 self.properties = self.cl.getprops() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
127 self.template = self._load() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
128 self.filterspec = None |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
129 self.columns = None |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
130 self.nodeid = None |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
131 def _load(self): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
132 src = os.path.join(self.templatedir, self.classname + self.extension) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
133 if not os.path.exists(src): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
134 if hasattr(self, 'fallbackextension'): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
135 self.extension = self.fallbackextension |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
136 return self._load() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
137 raise MissingTemplateError, self.classname + self.extension |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
138 cpl = os.path.join(self.compiledtemplatedir, self.classname + self.extension) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
139 if ( not os.path.exists(cpl) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
140 or os.stat(cpl)[MTIME] < os.stat(src)[MTIME] ): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
141 parser = RoundupTemplate() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
142 parser.feed(open(src, 'r').read()) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
143 tmplt = parser.structure |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
144 try: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
145 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
|
146 os.makedirs(self.compiledtemplatedir) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
147 f = open(cpl, 'wb') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
148 pickle.dump(tmplt, f) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
149 f.close() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
150 except Exception, e: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
151 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
|
152 pass |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
153 else: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
154 f = open(cpl, 'rb') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
155 tmplt = pickle.load(f) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
156 return tmplt |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
157 def _render(self, tmplt=None, test=_test, display=_display, exists=_exists): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
158 if tmplt is None: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
159 tmplt = self.template |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
160 for entry in tmplt: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
161 if isinstance(entry, type('')): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
162 self.client.write(entry) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
163 elif isinstance(entry, Require): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
164 if test(entry.attributes, self.client, self.classname, self.nodeid): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
165 self._render(entry.ok) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
166 elif entry.fail: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
167 self._render(entry.fail) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
168 elif isinstance(entry, Display): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
169 display(entry.attributes, self.client, self.classname, self.cl, self.properties, self.nodeid, self.filterspec) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
170 elif isinstance(entry, Property): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
171 if self.columns is None: # doing an Item |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
172 if exists(entry.attributes, self.cl, self.properties, self.nodeid): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
173 self._render(entry.ok) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
174 #elif entry.attributes[0][1] in self.columns: |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
175 else: |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
176 self._render(entry.ok) |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
177 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
178 class IndexTemplate(Template): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
179 ''' renders lists of items |
|
568
c7ead967db85
more htmltemplate tests and cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
563
diff
changeset
|
180 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
181 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
|
182 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
|
183 has group by lines |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
184 has full text search match lines ''' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
185 extension = '.index' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
186 def __init__(self, client, templates, classname): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
187 Template.__init__(self, client, templates, classname) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
188 def render(self, filterspec={}, search_text='', filter=[], columns=[], |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
189 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
|
190 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
|
191 simple_search=1, xtracols=None): |
|
574
d41d94511170
more htmltemplate cleanups and unit tests
Richard Jones <richard@users.sourceforge.net>
parents:
568
diff
changeset
|
192 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
193 try: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
194 self.filterspec = filterspec |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
195 w = self.client.write |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
196 cl = self.cl |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
197 properties = self.properties |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
198 if xtracols is None: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
199 xtracols = [] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
200 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
201 # XXX deviate from spec here ... |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
202 # load the index section template and figure the default columns from it |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
203 displayable_props = [] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
204 all_columns = [] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
205 for node in self.template: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
206 if isinstance(node, Property): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
207 colnm = node.attributes[0][1] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
208 if properties.has_key(colnm): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
209 displayable_props.append(colnm) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
210 all_columns.append(colnm) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
211 elif colnm in xtracols: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
212 all_columns.append(colnm) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
213 if not columns: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
214 columns = all_columns |
|
306
36ae7ffb8a42
Fixed Checklist function - wasn't always working on a list.
Richard Jones <richard@users.sourceforge.net>
parents:
303
diff
changeset
|
215 else: |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
216 # re-sort columns to be the same order as displayable_props |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
217 l = [] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
218 for name in all_columns: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
219 if name in columns: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
220 l.append(name) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
221 columns = l |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
222 self.columns = columns |
|
835
255bdcf39e8c
added sorting of checklist HTML display
Richard Jones <richard@users.sourceforge.net>
parents:
829
diff
changeset
|
223 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
224 # optimize the template |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
225 self.template = self._optimize(self.template) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
226 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
227 # display the filter section |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
228 if (show_display_form and |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
229 self.client.instance.FILTER_POSITION in ('top and bottom', 'top')): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
230 w('<form onSubmit="return submit_once()" action="%s">\n'%self.client.classname) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
231 self.filter_section(search_text, filter, columns, group, |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
232 displayable_props, sort, filterspec, pagesize, startwith, simple_search) |
|
577
334ae707ebfc
more HTML template cleanup and unit tests
Richard Jones <richard@users.sourceforge.net>
parents:
576
diff
changeset
|
233 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
234 # now display the index section |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
235 w('<table width=100% border=0 cellspacing=0 cellpadding=2>\n') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
236 w('<tr class="list-header">\n') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
237 for name in columns: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
238 cname = name.capitalize() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
239 if show_display_form and not cname in xtracols: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
240 sb = self.sortby(name, search_text, filterspec, columns, filter, |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
241 group, sort, pagesize) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
242 anchor = "%s?%s"%(self.client.classname, sb) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
243 w('<td><span class="list-header"><a href="%s">%s</a>' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
244 '</span></td>\n'%(anchor, cname)) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
245 else: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
246 w('<td><span class="list-header">%s</span></td>\n'%cname) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
247 w('</tr>\n') |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
248 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
249 # this stuff is used for group headings - optimise the group names |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
250 old_group = None |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
251 group_names = [] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
252 if group: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
253 for name in group: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
254 if name[0] == '-': group_names.append(name[1:]) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
255 else: group_names.append(name) |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
256 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
257 # now actually loop through all the nodes we get from the filter and |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
258 # apply the template |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
259 if show_nodes: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
260 matches = None |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
261 if nodeids is None: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
262 if search_text != '': |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
263 matches = self.client.db.indexer.search( |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
264 re.findall(r'\b\w{2,25}\b', search_text), cl) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
265 nodeids = cl.filter(matches, filterspec, sort, group) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
266 linecount = 0 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
267 for nodeid in nodeids[startwith:startwith+pagesize]: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
268 # check for a group heading |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
269 if group_names: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
270 this_group = [cl.get(nodeid, name, _('[no value]')) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
271 for name in group_names] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
272 if this_group != old_group: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
273 l = [] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
274 for name in group_names: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
275 prop = properties[name] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
276 if isinstance(prop, hyperdb.Link): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
277 group_cl = self.client.db.getclass(prop.classname) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
278 key = group_cl.getkey() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
279 if key is None: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
280 key = group_cl.labelprop() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
281 value = cl.get(nodeid, name) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
282 if value is None: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
283 l.append(_('[unselected %(classname)s]')%{ |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
284 'classname': prop.classname}) |
|
804
af4826d8773d
Default labelprops to id.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
757
diff
changeset
|
285 else: |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
286 l.append(group_cl.get(value, key)) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
287 elif isinstance(prop, hyperdb.Multilink): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
288 group_cl = self.client.db.getclass(prop.classname) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
289 key = group_cl.getkey() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
290 for value in cl.get(nodeid, name): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
291 l.append(group_cl.get(value, key)) |
|
804
af4826d8773d
Default labelprops to id.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
757
diff
changeset
|
292 else: |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
293 value = cl.get(nodeid, name, |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
294 _('[no value]')) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
295 if value is None: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
296 value = _('[empty %(name)s]')%locals() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
297 else: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
298 value = str(value) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
299 l.append(value) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
300 w('<tr class="section-bar">' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
301 '<td align=middle colspan=%s>' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
302 '<strong>%s</strong></td></tr>\n'%( |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
303 len(columns), ', '.join(l))) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
304 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
|
305 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
306 # display this node's row |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
307 self.nodeid = nodeid |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
308 self._render() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
309 if matches: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
310 self.node_matches(matches[nodeid], len(columns)) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
311 self.nodeid = None |
|
829
37ce3f2e05b2
added email display function
Richard Jones <richard@users.sourceforge.net>
parents:
826
diff
changeset
|
312 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
313 w('</table>\n') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
314 # the previous and next links |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
315 if nodeids: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
316 baseurl = self.buildurl(filterspec, search_text, filter, |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
317 columns, sort, group, pagesize) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
318 if startwith > 0: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
319 prevurl = '<a href="%s&:startwith=%s"><< '\ |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
320 'Previous page</a>'%(baseurl, max(0, startwith-pagesize)) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
321 else: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
322 prevurl = "" |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
323 if startwith + pagesize < len(nodeids): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
324 nexturl = '<a href="%s&:startwith=%s">Next page '\ |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
325 '>></a>'%(baseurl, startwith+pagesize) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
326 else: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
327 nexturl = "" |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
328 if prevurl or nexturl: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
329 w('''<table width="100%%"><tr> |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
330 <td width="50%%" align="center">%s</td> |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
331 <td width="50%%" align="center">%s</td> |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
332 </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
|
333 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
334 # display the filter section |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
335 if (show_display_form and hasattr(self.client.instance, 'FILTER_POSITION') and |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
336 self.client.instance.FILTER_POSITION in ('top and bottom', 'bottom')): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
337 w('<form onSubmit="return submit_once()" action="%s">\n'% |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
338 self.client.classname) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
339 self.filter_section(search_text, filter, columns, group, |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
340 displayable_props, sort, filterspec, pagesize, startwith, simple_search) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
341 finally: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
342 self.cl = self.properties = self.client = None |
|
902
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
343 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
344 def _optimize(self, tmplt): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
345 columns = self.columns |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
346 t = [] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
347 for entry in tmplt: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
348 if isinstance(entry, Property): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
349 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
|
350 t.extend(entry.ok) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
351 else: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
352 t.append(entry) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
353 return t |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
354 |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
355 def buildurl(self, filterspec, search_text, filter, columns, sort, group, pagesize): |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
356 d = {'pagesize':pagesize, 'pagesize':pagesize, 'classname':self.classname} |
|
926
3216c4f06ec4
Fixes to the search form and saving queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
915
diff
changeset
|
357 if search_text: |
|
3216c4f06ec4
Fixes to the search form and saving queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
915
diff
changeset
|
358 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
|
359 else: |
|
3216c4f06ec4
Fixes to the search form and saving queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
915
diff
changeset
|
360 d['searchtext'] = '' |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
361 d['filter'] = ','.join(map(urllib.quote,filter)) |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
362 d['columns'] = ','.join(map(urllib.quote,columns)) |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
363 d['sort'] = ','.join(map(urllib.quote,sort)) |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
364 d['group'] = ','.join(map(urllib.quote,group)) |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
365 tmp = [] |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
366 for col, vals in filterspec.items(): |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
367 vals = ','.join(map(urllib.quote,vals)) |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
368 tmp.append('%s=%s' % (col, vals)) |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
369 d['filters'] = '&'.join(tmp) |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
370 return ('%(classname)s?%(searchtext)s%(filters)s&:sort=%(sort)s&:filter=%(filter)s' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
371 '&:group=%(group)s&:columns=%(columns)s&:pagesize=%(pagesize)s' % d ) |
|
749
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
372 def node_matches(self, match, colspan): |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
373 ''' 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
|
374 full text search |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
375 ''' |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
376 w = self.client.write |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
377 db = self.client.db |
|
749
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
378 message_links = [] |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
379 file_links = [] |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
380 if match.has_key('messages'): |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
381 for msgid in match['messages']: |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
382 k = db.msg.labelprop(1) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
383 lab = db.msg.get(msgid, k) |
|
749
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
384 msgpath = 'msg%s'%msgid |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
385 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
|
386 %locals()) |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
387 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
|
388 ' Matched messages: %s</td></tr>\n')%( |
|
749
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
389 colspan, ', '.join(message_links))) |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
390 |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
391 if match.has_key('files'): |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
392 for fileid in match['files']: |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
393 filename = db.file.get(fileid, 'name') |
|
749
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
394 filepath = 'file%s/%s'%(fileid, filename) |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
395 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
|
396 %locals()) |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
397 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
|
398 ' Matched files: %s</td></tr>\n')%( |
|
749
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
399 colspan, ', '.join(file_links))) |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
400 |
|
902
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
401 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
|
402 sort, filterspec, pagesize): |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
403 sortspec = {} |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
404 for i in range(len(sort)): |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
405 mod = '' |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
406 colnm = sort[i] |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
407 if colnm[0] == '-': |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
408 mod = '-' |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
409 colnm = colnm[1:] |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
410 sortspec[colnm] = '%d%s' % (i+1, mod) |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
411 |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
412 startwith = 0 |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
413 rslt = [] |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
414 w = rslt.append |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
415 |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
416 # display the filter section |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
417 w( '<br>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
418 w( '<table border=0 cellspacing=0 cellpadding=1>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
419 w( '<tr class="list-header">') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
420 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
|
421 w( '</tr>') |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
422 # 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
|
423 if self.client.classname in self.client.db.config.HEADER_SEARCH_LINKS: |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
424 #if self.properties.has_key('messages') or self.properties.has_key('files'): |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
425 w( '<tr class="location-bar">') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
426 w( ' <td align="right" class="form-label"><b>Search Terms</b></td>') |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
427 w( ' <td colspan=6 class="form-text"> <input type="text"' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
428 'name="search_text" value="%s" size="50"></td>' % search_text) |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
429 w( '</tr>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
430 w( '<tr class="location-bar">') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
431 w( ' <th align="center" width="20%"> </th>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
432 w(_(' <th align="center" width="10%">Show</th>')) |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
433 w(_(' <th align="center" width="10%">Group</th>')) |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
434 w(_(' <th align="center" width="10%">Sort</th>')) |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
435 w(_(' <th colspan="3" align="center">Condition</th>')) |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
436 w( '</tr>') |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
437 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
438 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
|
439 all_columns = properties.keys() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
440 all_columns.sort() |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
441 for nm in all_columns: |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
442 propdescr = properties.get(nm, None) |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
443 if not propdescr: |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
444 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
|
445 continue |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
446 w( '<tr class="location-bar">') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
447 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
|
448 # show column - can't show multilinks |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
449 if isinstance(propdescr, hyperdb.Multilink): |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
450 w(' <td></td>') |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
451 else: |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
452 checked = columns and nm in columns or 0 |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
453 checked = ('', 'checked')[checked] |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
454 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
|
455 'value="%s" %s></td>' % (nm, checked) ) |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
456 # can only group on Link |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
457 if isinstance(propdescr, hyperdb.Link): |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
458 checked = group and nm in group or 0 |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
459 checked = ('', 'checked')[checked] |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
460 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
|
461 'value="%s" %s></td>' % (nm, checked) ) |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
462 else: |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
463 w(' <td></td>') |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
464 # sort - no sort on Multilinks |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
465 if isinstance(propdescr, hyperdb.Multilink): |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
466 w('<td></td>') |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
467 else: |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
468 val = sortspec.get(nm, '') |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
469 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
|
470 'value="%s"></td>' % (nm,val)) |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
471 # condition |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
472 val = '' |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
473 if isinstance(propdescr, hyperdb.Link): |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
474 op = "is in " |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
475 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
|
476 % (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
|
477 val = ','.join(filterspec.get(nm, '')) |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
478 elif isinstance(propdescr, hyperdb.Multilink): |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
479 op = "contains " |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
480 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
|
481 % (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
|
482 val = ','.join(filterspec.get(nm, '')) |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
483 elif isinstance(propdescr, hyperdb.String) and nm != 'id': |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
484 op = "equals " |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
485 xtra = "" |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
486 val = filterspec.get(nm, '') |
|
880
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
487 elif isinstance(propdescr, hyperdb.Boolean): |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
488 op = "is " |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
489 xtra = "" |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
490 val = filterspec.get(nm, None) |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
491 if val is not None: |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
492 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
|
493 else: |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
494 val = '' |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
495 elif isinstance(propdescr, hyperdb.Number): |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
496 op = "equals " |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
497 xtra = "" |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
498 val = str(filterspec.get(nm, '')) |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
499 else: |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
500 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
|
501 continue |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
502 checked = filter and nm in filter or 0 |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
503 checked = ('', 'checked')[checked] |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
504 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
|
505 % (nm, checked)) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
506 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
|
507 '<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
|
508 w( '</tr>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
509 w('<tr class="location-bar">') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
510 w(' <td colspan=7><hr></td>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
511 w('</tr>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
512 w('<tr class="location-bar">') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
513 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
|
514 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
|
515 'size="3" value="%s"></td>' % pagesize) |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
516 w(' <td colspan=4></td>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
517 w('</tr>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
518 w('<tr class="location-bar">') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
519 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
|
520 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
|
521 'size="3" value="%s"></td>' % startwith) |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
522 w(' <td colspan=3></td>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
523 w(' <td></td>') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
524 w('</tr>') |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
525 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
|
526 |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
527 return '\n'.join(rslt) |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
528 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
529 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
|
530 sort, filterspec, pagesize): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
531 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
532 startwith = 0 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
533 rslt = [] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
534 w = rslt.append |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
535 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
536 # display the filter section |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
537 w( '<br>') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
538 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
|
539 w( '<tr class="list-header">') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
540 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
|
541 w( '</tr>') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
542 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
543 if group: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
544 selectedgroup = group[0] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
545 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
|
546 else: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
547 selectedgroup = None |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
548 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
|
549 descending = 0 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
550 if sort: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
551 selectedsort = sort[0] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
552 if selectedsort[0] == '-': |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
553 selectedsort = selectedsort[1:] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
554 descending = 1 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
555 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
|
556 else: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
557 selectedsort = None |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
558 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
|
559 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
560 for nm in all_columns: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
561 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
|
562 if not propdescr: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
563 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
|
564 continue |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
565 if isinstance(propdescr, hyperdb.Link): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
566 selected = '' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
567 if nm == selectedgroup: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
568 selected = 'selected' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
569 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
|
570 selected = '' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
571 if nm == selectedsort: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
572 selected = 'selected' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
573 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
|
574 if len(groupopts) > 2: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
575 groupopts.append('</select>') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
576 groupopts = '\n'.join(groupopts) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
577 w('<tr class="location-bar">') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
578 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
|
579 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
|
580 w('</tr>') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
581 if len(sortopts) > 2: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
582 sortopts.append('</select>') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
583 sortopts = '\n'.join(sortopts) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
584 w('<tr class="location-bar">') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
585 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
|
586 checked = descending and 'checked' or '' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
587 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
|
588 '<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
|
589 w('</tr>') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
590 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
|
591 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
|
592 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
|
593 for nm in filterspec.keys(): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
594 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
|
595 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
|
596 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
597 return '\n'.join(rslt) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
598 |
|
902
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
599 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
|
600 sort, filterspec, pagesize, startwith, simpleform=1): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
601 w = self.client.write |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
602 if simpleform: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
603 w(self.simple_filter_form(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
|
604 sort, filterspec, pagesize)) |
|
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 w(self.filter_form(search_text, filter, columns, group, all_columns, |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
607 sort, filterspec, pagesize)) |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
608 w(' <tr class="location-bar">\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
609 w(' <td colspan=7><hr></td>\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
610 w(' </tr>\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
611 w(' <tr class="location-bar">\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
612 w(' <td> </td>\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
613 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
|
614 w(' </tr>\n') |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
615 if (not simpleform |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
616 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
|
617 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
|
618 w(' <tr class="location-bar">\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
619 w(' <td colspan=7><hr></td>\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
620 w(' </tr>\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
621 w(' <tr class="location-bar">\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
622 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
|
623 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
|
624 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
|
625 '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
|
626 '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
|
627 w(' </tr>\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
628 w(' <tr class="location-bar">\n') |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
629 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
|
630 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
|
631 w(' </tr>\n') |
|
351
6932067a8f31
More HTML compliance fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
350
diff
changeset
|
632 w('</table>\n') |
|
307
dac78e092228
CGI interface view customisation section may now be hidden
Richard Jones <richard@users.sourceforge.net>
parents:
306
diff
changeset
|
633 |
|
926
3216c4f06ec4
Fixes to the search form and saving queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
915
diff
changeset
|
634 def sortby(self, sort_name, search_text, filterspec, columns, filter, group, sort, |
|
3216c4f06ec4
Fixes to the search form and saving queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
915
diff
changeset
|
635 pagesize): |
|
913
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
636 ''' 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
|
637 column |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
638 ''' |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
639 l = [] |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
640 w = l.append |
|
926
3216c4f06ec4
Fixes to the search form and saving queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
915
diff
changeset
|
641 if search_text: |
|
3216c4f06ec4
Fixes to the search form and saving queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
915
diff
changeset
|
642 w('search_text=%s' % search_text) |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
643 for k, v in filterspec.items(): |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
644 k = urllib.quote(k) |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
645 if type(v) == type([]): |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
646 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
|
647 else: |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
648 w('%s=%s'%(k, urllib.quote(v))) |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
649 if columns: |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
650 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
|
651 if filter: |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
652 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
|
653 if group: |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
654 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
|
655 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
|
656 w(':startwith=0') |
|
913
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
657 |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
658 # 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
|
659 # 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
|
660 # column only |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
661 sorting = None |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
662 if len(sort) == 1: |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
663 name = sort[0] |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
664 dir = name[0] |
|
913
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
665 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
|
666 sorting = ':sort=%s'%sort_name |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
667 elif name == sort_name: |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
668 sorting = ':sort=-%s'%sort_name |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
669 if sorting is None: |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
670 sorting = ':sort=%s'%sort_name |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
671 w(sorting) |
|
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
672 |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
673 return '&'.join(l) |
|
307
dac78e092228
CGI interface view customisation section may now be hidden
Richard Jones <richard@users.sourceforge.net>
parents:
306
diff
changeset
|
674 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
675 class ItemTemplate(Template): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
676 ''' show one node as a form ''' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
677 extension = '.item' |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
678 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
|
679 Template.__init__(self, client, templates, classname) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
680 self.nodeid = client.nodeid |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
681 def render(self, nodeid): |
|
915
930b57864dc8
nicer error messages, and a bugfix
Richard Jones <richard@users.sourceforge.net>
parents:
913
diff
changeset
|
682 try: |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
683 cl = self.cl |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
684 properties = self.properties |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
685 if (properties.has_key('type') and |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
686 properties.has_key('content')): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
687 pass |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
688 # 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
|
689 # 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
|
690 # designators... |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
691 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
692 w = self.client.write |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
693 w('<form onSubmit="return submit_once()" action="%s%s" method="POST" enctype="multipart/form-data">'%( |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
694 self.classname, nodeid)) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
695 try: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
696 self._render() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
697 except: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
698 etype = sys.exc_type |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
699 if type(etype) is types.ClassType: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
700 etype = etype.__name__ |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
701 w('<p class="system-msg">%s: %s</p>'%(etype, sys.exc_value)) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
702 # 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
|
703 self.client.db.rollback() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
704 w('</form>') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
705 finally: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
706 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
|
707 |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
708 |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
709 class NewItemTemplate(Template): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
710 ''' 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
|
711 extension = '.newitem' |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
712 fallbackextension = '.item' |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
713 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
|
714 Template.__init__(self, client, templates, classname) |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
715 def render(self, form): |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
716 try: |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
717 self.form = form |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
718 w = self.client.write |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
719 c = self.client.classname |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
720 w('<form onSubmit="return submit_once()" action="new%s" method="POST" enctype="multipart/form-data">'%c) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
721 for key in form.keys(): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
722 if key[0] == ':': |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
723 value = form[key].value |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
724 if type(value) != type([]): value = [value] |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
725 for value in value: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
726 w('<input type="hidden" name="%s" value="%s">'%(key, value)) |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
727 self._render() |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
728 w('</form>') |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
729 finally: |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
730 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
|
731 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
732 def splitargs(*args, **kws): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
733 return args, kws |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
734 # [('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
|
735 |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
736 templatefuncs = {} |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
737 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
|
738 if nm.startswith('do_'): |
|
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
739 templatefuncs[nm[3:]] = getattr(template_funcs, nm) |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
740 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
741 # |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
742 # $Log: not supported by cvs2svn $ |
|
934
fdcf16b444a9
Use a real parser for templates.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
930
diff
changeset
|
743 # 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
|
744 # 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
|
745 # 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
|
746 # 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
|
747 # 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
|
748 # |
|
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
|
749 # 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
|
750 # 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
|
751 # 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
|
752 # |
|
926
3216c4f06ec4
Fixes to the search form and saving queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
915
diff
changeset
|
753 # 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
|
754 # 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
|
755 # |
|
915
930b57864dc8
nicer error messages, and a bugfix
Richard Jones <richard@users.sourceforge.net>
parents:
913
diff
changeset
|
756 # 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
|
757 # 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
|
758 # 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
|
759 # |
|
913
50363eaed280
Removed the confusing, ugly two-column sorting stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
905
diff
changeset
|
760 # 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
|
761 # 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
|
762 # 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
|
763 # 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
|
764 # |
|
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
|
765 # 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
|
766 # 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
|
767 # 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
|
768 # . 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
|
769 # . 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
|
770 # 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
|
771 # ... 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
|
772 # |
|
902
b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Richard Jones <richard@users.sourceforge.net>
parents:
893
diff
changeset
|
773 # 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
|
774 # 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
|
775 # |
|
893
897425e40859
Fixes/improvements to the search form & saved queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
890
diff
changeset
|
776 # 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
|
777 # 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
|
778 # |
|
890
a568596dbea7
Unit tests and a few fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
880
diff
changeset
|
779 # 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
|
780 # Add Number and Boolean types to hyperdb. |
|
a568596dbea7
Unit tests and a few fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
880
diff
changeset
|
781 # 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
|
782 # 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
|
783 # |
|
880
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
784 # 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
|
785 # minor bugfix |
|
de3da99a7c02
Add Number and Boolean types to hyperdb.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
878
diff
changeset
|
786 # |
| 878 | 787 # Revision 1.99 2002/07/17 12:39:10 gmcm |
| 788 # Saving, running & editing queries. | |
| 789 # | |
|
872
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
790 # 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
|
791 # . added sorting of checklist HTML display |
|
bd6211d39328
Saving, running & editing queries.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
835
diff
changeset
|
792 # |
|
835
255bdcf39e8c
added sorting of checklist HTML display
Richard Jones <richard@users.sourceforge.net>
parents:
829
diff
changeset
|
793 # 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
|
794 # . 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
|
795 # scraped from the web |
|
255bdcf39e8c
added sorting of checklist HTML display
Richard Jones <richard@users.sourceforge.net>
parents:
829
diff
changeset
|
796 # |
|
829
37ce3f2e05b2
added email display function
Richard Jones <richard@users.sourceforge.net>
parents:
826
diff
changeset
|
797 # 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
|
798 # Added reindex command to roundup-admin. |
|
37ce3f2e05b2
added email display function
Richard Jones <richard@users.sourceforge.net>
parents:
826
diff
changeset
|
799 # Fixed reindex on first access. |
|
37ce3f2e05b2
added email display function
Richard Jones <richard@users.sourceforge.net>
parents:
826
diff
changeset
|
800 # Also fixed reindexing of entries that change. |
|
37ce3f2e05b2
added email display function
Richard Jones <richard@users.sourceforge.net>
parents:
826
diff
changeset
|
801 # |
|
826
6d7a45c8464a
Added reindex command to roundup-admin.
Richard Jones <richard@users.sourceforge.net>
parents:
821
diff
changeset
|
802 # 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
|
803 # Pagination of index pages. |
|
6d7a45c8464a
Added reindex command to roundup-admin.
Richard Jones <richard@users.sourceforge.net>
parents:
821
diff
changeset
|
804 # New search form. |
|
6d7a45c8464a
Added reindex command to roundup-admin.
Richard Jones <richard@users.sourceforge.net>
parents:
821
diff
changeset
|
805 # |
|
821
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
806 # 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
|
807 # 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
|
808 # the bound methods from the globals dict). |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
809 # 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
|
810 # 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
|
811 # 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
|
812 # have 600+ users. |
|
fda182844206
Pagination of index pages.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
806
diff
changeset
|
813 # |
|
806
83becf3faa2f
Fix the cycles (a clear method, called after render...
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
804
diff
changeset
|
814 # 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
|
815 # 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
|
816 # 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
|
817 # 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
|
818 # 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
|
819 # |
|
804
af4826d8773d
Default labelprops to id.
Gordon B. McMillan <gmcm@users.sourceforge.net>
parents:
757
diff
changeset
|
820 # 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
|
821 # 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
|
822 # |
|
757
00d360a4978a
Added optional additional property to display in a Multilink form menu.
Richard Jones <richard@users.sourceforge.net>
parents:
755
diff
changeset
|
823 # 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
|
824 # 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
|
825 # |
|
755
49c9522675b9
can now just display a link/multilink id - useful for stylesheet stuff
Richard Jones <richard@users.sourceforge.net>
parents:
749
diff
changeset
|
826 # 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
|
827 # 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
|
828 # |
|
749
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
829 # 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
|
830 # 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
|
831 # |
|
721
c63b71a949a8
forgot to fix the templating for last change
Richard Jones <richard@users.sourceforge.net>
parents:
696
diff
changeset
|
832 # 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
|
833 # 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
|
834 # 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
|
835 # 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
|
836 # 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
|
837 # |
|
696
709f8f1d5661
Sorting was applied to all nodes of the MultiLink class...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
678
diff
changeset
|
838 # 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
|
839 # 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
|
840 # |
|
678
9fe50036e8df
Fix for date properties as labels.
Richard Jones <richard@users.sourceforge.net>
parents:
676
diff
changeset
|
841 # 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
|
842 # 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
|
843 # 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
|
844 # |
|
9fe50036e8df
Fix for date properties as labels.
Richard Jones <richard@users.sourceforge.net>
parents:
676
diff
changeset
|
845 # 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
|
846 # |
|
9fe50036e8df
Fix for date properties as labels.
Richard Jones <richard@users.sourceforge.net>
parents:
676
diff
changeset
|
847 # 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
|
848 # |
|
676
bc46480e2a2b
Fixed serialisation problem...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
849 # Revision 1.85 2002/04/02 01:40:58 richard |
|
bc46480e2a2b
Fixed serialisation problem...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
850 # . 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
|
851 # 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
|
852 # 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
|
853 # attribute. |
|
bc46480e2a2b
Fixed serialisation problem...
Richard Jones <richard@users.sourceforge.net>
parents:
673
diff
changeset
|
854 # |
|
749
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
855 # 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
|
856 # 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
|
857 # 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
|
858 # index links. |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
859 # |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
860 # 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
|
861 # cgi_client.py |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
862 # removed search link for the time being |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
863 # moved rendering of matches to htmltemplate |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
864 # hyperdb.py |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
865 # 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
|
866 # roundupdb.py |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
867 # added paramater to call of filter method |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
868 # roundup_indexer.py |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
869 # added search method to RoundupIndexer class |
|
51c425129b35
Merged search_indexing-branch with HEAD
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
721
diff
changeset
|
870 # |
|
673
604c84696461
link() htmltemplate function now has a "showid" option for links & multilinks.
Richard Jones <richard@users.sourceforge.net>
parents:
672
diff
changeset
|
871 # 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
|
872 # . 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
|
873 # 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
|
874 # |
|
672
d92e06a3a56e
Fixed display of mutlilink properties...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
651
diff
changeset
|
875 # 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
|
876 # Ran it through pychecker, made fixes |
|
d92e06a3a56e
Fixed display of mutlilink properties...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
651
diff
changeset
|
877 # |
|
651
6257d4e49d2a
Ran it through pychecker, made fixes
Richard Jones <richard@users.sourceforge.net>
parents:
640
diff
changeset
|
878 # 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
|
879 # . 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
|
880 # 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
|
881 # 99 each. |
|
6257d4e49d2a
Ran it through pychecker, made fixes
Richard Jones <richard@users.sourceforge.net>
parents:
640
diff
changeset
|
882 # |
|
640
7dd13fd5d8ea
fixed some problems in date calculations
Richard Jones <richard@users.sourceforge.net>
parents:
639
diff
changeset
|
883 # 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
|
884 # docco |
|
7dd13fd5d8ea
fixed some problems in date calculations
Richard Jones <richard@users.sourceforge.net>
parents:
639
diff
changeset
|
885 # |
| 639 | 886 # Revision 1.80 2002/02/21 07:19:08 richard |
| 887 # ... and label, width and height control for extra flavour! | |
| 888 # | |
|
638
21b3cfa7d99a
... and label, width and height control for extra flavour!
Richard Jones <richard@users.sourceforge.net>
parents:
635
diff
changeset
|
889 # 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
|
890 # . 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
|
891 # - 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
|
892 # 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
|
893 # 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
|
894 # 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
|
895 # default templates. |
|
21b3cfa7d99a
... and label, width and height control for extra flavour!
Richard Jones <richard@users.sourceforge.net>
parents:
635
diff
changeset
|
896 # |
|
635
3d61b5d2243e
Added popup help for classes using the classhelp html template function.
Richard Jones <richard@users.sourceforge.net>
parents:
634
diff
changeset
|
897 # 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
|
898 # *** 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
|
899 # |
|
634
53549c6a7b33
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
627
diff
changeset
|
900 # Revision 1.77 2002/02/20 05:05:29 richard |
|
53549c6a7b33
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
627
diff
changeset
|
901 # . 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
|
902 # - access using the admin "class list" interface |
|
53549c6a7b33
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
627
diff
changeset
|
903 # - limited to admin-only |
|
53549c6a7b33
*** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
627
diff
changeset
|
904 # - 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
|
905 # |
|
627
952679be9e2c
Added simple editing for classes that don't define a templated interface.
Richard Jones <richard@users.sourceforge.net>
parents:
623
diff
changeset
|
906 # 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
|
907 # oops |
|
952679be9e2c
Added simple editing for classes that don't define a templated interface.
Richard Jones <richard@users.sourceforge.net>
parents:
623
diff
changeset
|
908 # |
| 623 | 909 # Revision 1.75 2002/02/16 08:43:23 richard |
| 910 # . #517906 ] Attribute order in "View customisation" | |
| 911 # | |
|
622
1b16ddd69f31
[SF#517906] Attribute order in "View customisation"
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
912 # 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
|
913 # . #516854 ] "My Issues" and redisplay |
|
1b16ddd69f31
[SF#517906] Attribute order in "View customisation"
Richard Jones <richard@users.sourceforge.net>
parents:
621
diff
changeset
|
914 # |
|
621
f333f6decdc2
[SF#516854] "My Issues" and redisplay
Richard Jones <richard@users.sourceforge.net>
parents:
617
diff
changeset
|
915 # 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
|
916 # . 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
|
917 # 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
|
918 # |
|
617
edd210915e64
Alternate email addresses are now available for users.
Richard Jones <richard@users.sourceforge.net>
parents:
614
diff
changeset
|
919 # 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
|
920 # . 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
|
921 # on the client-side. |
|
edd210915e64
Alternate email addresses are now available for users.
Richard Jones <richard@users.sourceforge.net>
parents:
614
diff
changeset
|
922 # |
|
614
5fdf95e6c20a
. All forms now have "double-submit" protection...
Richard Jones <richard@users.sourceforge.net>
parents:
581
diff
changeset
|
923 # 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
|
924 # 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
|
925 # |
|
581
137d7fc5234d
real (non-string, duh) sorting of lists by node id
Richard Jones <richard@users.sourceforge.net>
parents:
577
diff
changeset
|
926 # 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
|
927 # 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
|
928 # |
|
577
334ae707ebfc
more HTML template cleanup and unit tests
Richard Jones <richard@users.sourceforge.net>
parents:
576
diff
changeset
|
929 # 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
|
930 # 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
|
931 # - 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
|
932 # 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
|
933 # |
|
576
f98f37697f4c
More HTML template cleanup and unit tests.
Richard Jones <richard@users.sourceforge.net>
parents:
575
diff
changeset
|
934 # 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
|
935 # . htmltemplate list() wasn't sorting... |
|
f98f37697f4c
More HTML template cleanup and unit tests.
Richard Jones <richard@users.sourceforge.net>
parents:
575
diff
changeset
|
936 # |
|
575
2df17627528d
htmltemplate list() wasn't sorting...
Richard Jones <richard@users.sourceforge.net>
parents:
574
diff
changeset
|
937 # 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
|
938 # more htmltemplate cleanups and unit tests |
|
2df17627528d
htmltemplate list() wasn't sorting...
Richard Jones <richard@users.sourceforge.net>
parents:
574
diff
changeset
|
939 # |
|
574
d41d94511170
more htmltemplate cleanups and unit tests
Richard Jones <richard@users.sourceforge.net>
parents:
568
diff
changeset
|
940 # 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
|
941 # more htmltemplate tests and cleanup |
|
d41d94511170
more htmltemplate cleanups and unit tests
Richard Jones <richard@users.sourceforge.net>
parents:
568
diff
changeset
|
942 # |
|
568
c7ead967db85
more htmltemplate tests and cleanup
Richard Jones <richard@users.sourceforge.net>
parents:
563
diff
changeset
|
943 # 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
|
944 # 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
|
945 # 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
|
946 # |
|
563
0f58d6a35a8b
Wrote more unit tests for htmltemplate...
Richard Jones <richard@users.sourceforge.net>
parents:
558
diff
changeset
|
947 # 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
|
948 # oops |
|
0f58d6a35a8b
Wrote more unit tests for htmltemplate...
Richard Jones <richard@users.sourceforge.net>
parents:
558
diff
changeset
|
949 # |
| 558 | 950 # Revision 1.63 2002/01/21 02:59:10 richard |
| 951 # Fixed up the HTML display of history so valid links are actually displayed. | |
| 952 # Oh for some unit tests! :( | |
| 953 # | |
|
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
|
954 # 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
|
955 # . 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
|
956 # |
|
554
7e7b4183a8bd
add nowrap to history table date cell i.e. <td nowrap ...
Engelbert Gruber <grubert@users.sourceforge.net>
parents:
552
diff
changeset
|
957 # 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
|
958 # . 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
|
959 # |
|
552
0f8734a5a004
much nicer history display (actualy real handling of property types etc)
Richard Jones <richard@users.sourceforge.net>
parents:
548
diff
changeset
|
960 # 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
|
961 # . 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
|
962 # |
|
548
3f25182ed425
display superseder as html link in history.
Engelbert Gruber <grubert@users.sourceforge.net>
parents:
547
diff
changeset
|
963 # 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
|
964 # . 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
|
965 # |
|
547
e4ef6df2345c
display links a html link in history.
Engelbert Gruber <grubert@users.sourceforge.net>
parents:
538
diff
changeset
|
966 # 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
|
967 # #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
|
968 # |
|
538
67379bcc5da4
[SF#502949] index view for non-issues and redisplay
Richard Jones <richard@users.sourceforge.net>
parents:
535
diff
changeset
|
969 # 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
|
970 # 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
|
971 # 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
|
972 # |
|
535
78711b29c746
reverted the change that had plain() hyperlinking the link displays
Richard Jones <richard@users.sourceforge.net>
parents:
531
diff
changeset
|
973 # 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
|
974 # . 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
|
975 # 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
|
976 # ... 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
|
977 # 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
|
978 # |
|
531
32c1dd156605
plain rendering of links in the htmltemplate now generate a hyperlink...
Richard Jones <richard@users.sourceforge.net>
parents:
528
diff
changeset
|
979 # 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
|
980 # . #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
|
981 # ... 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
|
982 # 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
|
983 # |
|
528
72fe808ff5b8
[SF#502953] nosy-like treatment of other multilinks
Richard Jones <richard@users.sourceforge.net>
parents:
526
diff
changeset
|
984 # 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
|
985 # 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
|
986 # 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
|
987 # |
|
526
523b22a2c021
The submit buttons need a name attribute...
Richard Jones <richard@users.sourceforge.net>
parents:
525
diff
changeset
|
988 # 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
|
989 # 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
|
990 # |
|
525
d046cc4ba7d3
How about that ... date fields have never worked ...
Richard Jones <richard@users.sourceforge.net>
parents:
524
diff
changeset
|
991 # 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
|
992 # . 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
|
993 # 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
|
994 # 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
|
995 # 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
|
996 # |
|
d046cc4ba7d3
How about that ... date fields have never worked ...
Richard Jones <richard@users.sourceforge.net>
parents:
524
diff
changeset
|
997 # 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
|
998 # 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
|
999 # |
|
524
dce4c75bef5a
changed all config accesses...
Richard Jones <richard@users.sourceforge.net>
parents:
515
diff
changeset
|
1000 # 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
|
1001 # 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
|
1002 # Should this be done in date's string converter ? |
|
dce4c75bef5a
changed all config accesses...
Richard Jones <richard@users.sourceforge.net>
parents:
515
diff
changeset
|
1003 # |
|
515
59e721a72a30
In do_history: replace "." in date by " " so html wraps more sensible.
Engelbert Gruber <grubert@users.sourceforge.net>
parents:
488
diff
changeset
|
1004 # 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
|
1005 # 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
|
1006 # |
|
488
ab9e236cd524
I18N'ification
Richard Jones <richard@users.sourceforge.net>
parents:
467
diff
changeset
|
1007 # Revision 1.49 2001/12/20 15:43:01 rochecompaan |
|
ab9e236cd524
I18N'ification
Richard Jones <richard@users.sourceforge.net>
parents:
467
diff
changeset
|
1008 # Features added: |
|
ab9e236cd524
I18N'ification
Richard Jones <richard@users.sourceforge.net>
parents:
467
diff
changeset
|
1009 # . Multilink properties are now displayed as comma separated values in |
|
ab9e236cd524
I18N'ification
Richard Jones <richard@users.sourceforge.net>
parents:
467
diff
changeset
|
1010 # a textbox |
|
ab9e236cd524
I18N'ification
Richard Jones <richard@users.sourceforge.net>
parents:
467
diff
changeset
|
1011 # . 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
|
1012 # . Modified the mail gateway to reject submissions from unknown |
|
ab9e236cd524
I18N'ification
Richard Jones <richard@users.sourceforge.net>
parents:
467
diff
changeset
|
1013 # addresses if ANONYMOUS_ACCESS is denied |
|
ab9e236cd524
I18N'ification
Richard Jones <richard@users.sourceforge.net>
parents:
467
diff
changeset
|
1014 # |
|
467
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1015 # Revision 1.48 2001/12/20 06:13:24 rochecompaan |
|
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1016 # Bugs fixed: |
|
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1017 # . Exception handling in hyperdb for strings-that-look-like numbers got |
|
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1018 # lost somewhere |
|
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1019 # . Internet Explorer submits full path for filename - we now strip away |
|
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1020 # the path |
|
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1021 # Features added: |
|
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1022 # . Link and multilink properties are now displayed sorted in the cgi |
|
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1023 # interface |
|
103f521810f7
Features added:
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
466
diff
changeset
|
1024 # |
|
466
a3548136f7bb
Two bug fixes and a feature.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
411
diff
changeset
|
1025 # 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
|
1026 # Feature: |
|
a3548136f7bb
Two bug fixes and a feature.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
411
diff
changeset
|
1027 # . 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
|
1028 # the instance. |
|
a3548136f7bb
Two bug fixes and a feature.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
411
diff
changeset
|
1029 # . 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
|
1030 # signature info in e-mails. |
|
a3548136f7bb
Two bug fixes and a feature.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
411
diff
changeset
|
1031 # . 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
|
1032 # . 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
|
1033 # |
|
a3548136f7bb
Two bug fixes and a feature.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
411
diff
changeset
|
1034 # Fixed: |
|
a3548136f7bb
Two bug fixes and a feature.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
411
diff
changeset
|
1035 # . 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
|
1036 # |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
408
diff
changeset
|
1037 # Revision 1.46 2001/11/24 00:53:12 jhermann |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
408
diff
changeset
|
1038 # "except:" is bad, bad , bad! |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
408
diff
changeset
|
1039 # |
|
408
424bfccd4118
"except:" is bad, bad , bad!
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
406
diff
changeset
|
1040 # 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
|
1041 # Added module docstrings to all modules. |
|
424bfccd4118
"except:" is bad, bad , bad!
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
406
diff
changeset
|
1042 # |
|
406
bdc2ea127ae9
Added module docstrings to all modules.
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
401
diff
changeset
|
1043 # 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
|
1044 # 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
|
1045 # |
|
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
|
1046 # 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
|
1047 # *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
|
1048 # |
|
398
bbbcdee47762
*sigh* more missing value handling
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
1049 # 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
|
1050 # more new property handling |
|
bbbcdee47762
*sigh* more missing value handling
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
1051 # |
|
397
d47818b09265
more new property handling
Richard Jones <richard@users.sourceforge.net>
parents:
392
diff
changeset
|
1052 # 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
|
1053 # . missing "return" in filter_section (thanks Roch'e Compaan) |
|
d47818b09265
more new property handling
Richard Jones <richard@users.sourceforge.net>
parents:
392
diff
changeset
|
1054 # |
|
392
a9edec536e0a
missing "return" in filter_section (thanks Roch'e Compaan)
Richard Jones <richard@users.sourceforge.net>
parents:
351
diff
changeset
|
1055 # 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
|
1056 # 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
|
1057 # too. |
|
a9edec536e0a
missing "return" in filter_section (thanks Roch'e Compaan)
Richard Jones <richard@users.sourceforge.net>
parents:
351
diff
changeset
|
1058 # |
|
351
6932067a8f31
More HTML compliance fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
350
diff
changeset
|
1059 # 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
|
1060 # 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
|
1061 # |
|
350
e8d244a98ffd
Ahah! Fixed the lynx problem - there was a hidden input field misplaced.
Richard Jones <richard@users.sourceforge.net>
parents:
342
diff
changeset
|
1062 # 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
|
1063 # 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
|
1064 # 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
|
1065 # |
|
342
0b7d62e414b6
Added the wrap="hard" attribute to the textarea of the note field...
Richard Jones <richard@users.sourceforge.net>
parents:
340
diff
changeset
|
1066 # 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
|
1067 # 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
|
1068 # |
|
340
9311fa91f478
Added do_stext to htmltemplate, thanks Brad Clements.
Richard Jones <richard@users.sourceforge.net>
parents:
332
diff
changeset
|
1069 # 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
|
1070 # 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
|
1071 # |
|
332
1fe356fc3d3e
Fixed ENOENT/WindowsError thing, thanks Juergen Hermann
Richard Jones <richard@users.sourceforge.net>
parents:
327
diff
changeset
|
1072 # 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
|
1073 # 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
|
1074 # |
|
327
ee8882029150
Removed the "infinite authentication loop", thanks Roch'e
Richard Jones <richard@users.sourceforge.net>
parents:
320
diff
changeset
|
1075 # 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
|
1076 # 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
|
1077 # |
|
320
61c42790c3f1
Bugfix in filter "widget" placement, thanks Roch'e
Richard Jones <richard@users.sourceforge.net>
parents:
318
diff
changeset
|
1078 # 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
|
1079 # 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
|
1080 # disabling access for anonymous users. |
|
61c42790c3f1
Bugfix in filter "widget" placement, thanks Roch'e
Richard Jones <richard@users.sourceforge.net>
parents:
318
diff
changeset
|
1081 # 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
|
1082 # 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
|
1083 # 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
|
1084 # |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
1085 # 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
|
1086 # Added configuration for: |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
1087 # . anonymous user access and registration (deny/allow) |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
1088 # . 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
|
1089 # Updated some documentation. |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
316
diff
changeset
|
1090 # |
|
316
c0ca7f35e0c5
Added configuration for:
Richard Jones <richard@users.sourceforge.net>
parents:
313
diff
changeset
|
1091 # Revision 1.31 2001/10/21 07:26:35 richard |
|
c0ca7f35e0c5
Added configuration for:
Richard Jones <richard@users.sourceforge.net>
parents:
313
diff
changeset
|
1092 # feature #473127: Filenames. I modified the file.index and htmltemplate |
|
c0ca7f35e0c5
Added configuration for:
Richard Jones <richard@users.sourceforge.net>
parents:
313
diff
changeset
|
1093 # 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
|
1094 # information is displayed. |
|
c0ca7f35e0c5
Added configuration for:
Richard Jones <richard@users.sourceforge.net>
parents:
313
diff
changeset
|
1095 # |
|
313
489b70c37f32
feature [SF#473127]: Filenames.
Richard Jones <richard@users.sourceforge.net>
parents:
312
diff
changeset
|
1096 # 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
|
1097 # bug #473124: UI inconsistency with Link fields. |
|
489b70c37f32
feature [SF#473127]: Filenames.
Richard Jones <richard@users.sourceforge.net>
parents:
312
diff
changeset
|
1098 # 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
|
1099 # that of being able to turn off certain filters. |
|
489b70c37f32
feature [SF#473127]: Filenames.
Richard Jones <richard@users.sourceforge.net>
parents:
312
diff
changeset
|
1100 # |
|
312
5a2c43891c20
[SF#473124]: UI inconsistency with Link fields.
Richard Jones <richard@users.sourceforge.net>
parents:
307
diff
changeset
|
1101 # 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
|
1102 # 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
|
1103 # Roch'e Compaan.) |
|
5a2c43891c20
[SF#473124]: UI inconsistency with Link fields.
Richard Jones <richard@users.sourceforge.net>
parents:
307
diff
changeset
|
1104 # |
|
307
dac78e092228
CGI interface view customisation section may now be hidden
Richard Jones <richard@users.sourceforge.net>
parents:
306
diff
changeset
|
1105 # 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
|
1106 # 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
|
1107 # |
|
306
36ae7ffb8a42
Fixed Checklist function - wasn't always working on a list.
Richard Jones <richard@users.sourceforge.net>
parents:
303
diff
changeset
|
1108 # 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
|
1109 # 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
|
1110 # |
|
303
3d5031f834f0
Fixed grouping of non-str properties (thanks Roch'e Compaan)
Richard Jones <richard@users.sourceforge.net>
parents:
292
diff
changeset
|
1111 # 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
|
1112 # 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
|
1113 # |
|
292
4340cdc694d4
Handle empty strings in HTML template Link function
Richard Jones <richard@users.sourceforge.net>
parents:
270
diff
changeset
|
1114 # 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
|
1115 # 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
|
1116 # 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
|
1117 # |
|
270
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
250
diff
changeset
|
1118 # 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
|
1119 # *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
|
1120 # 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
|
1121 # |
|
250
1d428068485c
*gak* ... xmp is Old Skool apparently.
Richard Jones <richard@users.sourceforge.net>
parents:
245
diff
changeset
|
1122 # 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
|
1123 # 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
|
1124 # (thanks Hubert Hoegl) |
|
1d428068485c
*gak* ... xmp is Old Skool apparently.
Richard Jones <richard@users.sourceforge.net>
parents:
245
diff
changeset
|
1125 # 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
|
1126 # |
|
245
8a0d548c07a1
Fixed bug in the generation of links to Link/Multilink in indexes.
Richard Jones <richard@users.sourceforge.net>
parents:
244
diff
changeset
|
1127 # 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
|
1128 # 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
|
1129 # |
|
244
6bf584784e31
Fixed missing import in mailgw :(
Richard Jones <richard@users.sourceforge.net>
parents:
231
diff
changeset
|
1130 # 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
|
1131 # 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
|
1132 # |
|
231
afd428ba6523
better CGI text searching - but hidden filter fields are disappearing...
Richard Jones <richard@users.sourceforge.net>
parents:
228
diff
changeset
|
1133 # 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
|
1134 # 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
|
1135 # 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
|
1136 # |
|
228
1d1848c99abe
Fixed some isFooTypes that I missed.
Richard Jones <richard@users.sourceforge.net>
parents:
224
diff
changeset
|
1137 # 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
|
1138 # 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
|
1139 # |
|
224
ad2c98faec97
using isinstance(blah, Foo) now instead of isFooType
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
1140 # 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
|
1141 # stupid typo |
|
ad2c98faec97
using isinstance(blah, Foo) now instead of isFooType
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
1142 # |
| 214 | 1143 # Revision 1.17 2001/08/07 00:15:51 richard |
| 1144 # Added the copyright/license notice to (nearly) all files at request of | |
| 1145 # Bizar Software. | |
| 1146 # | |
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
171
diff
changeset
|
1147 # 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
|
1148 # 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
|
1149 # |
|
171
3c19bc818711
Checklist was using wrong name.
Richard Jones <richard@users.sourceforge.net>
parents:
167
diff
changeset
|
1150 # 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
|
1151 # 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
|
1152 # |
|
167
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
162
diff
changeset
|
1153 # 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
|
1154 # Features: |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
162
diff
changeset
|
1155 # . 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
|
1156 # should be linked somewhere. |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
162
diff
changeset
|
1157 # Fixed: |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
162
diff
changeset
|
1158 # . 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
|
1159 # . 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
|
1160 # . 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
|
1161 # |
|
162
717f12e6ccf2
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
155
diff
changeset
|
1162 # Revision 1.13 2001/07/30 02:37:53 richard |
|
717f12e6ccf2
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
155
diff
changeset
|
1163 # Temporary measure until we have decent schema migration. |
|
717f12e6ccf2
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
155
diff
changeset
|
1164 # |
|
155
03bdef2d645b
Temporary measure until we have decent schema migration.
Richard Jones <richard@users.sourceforge.net>
parents:
141
diff
changeset
|
1165 # 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
|
1166 # Handles new node display now. |
|
03bdef2d645b
Temporary measure until we have decent schema migration.
Richard Jones <richard@users.sourceforge.net>
parents:
141
diff
changeset
|
1167 # |
|
141
5e8da9d010bd
Handles new node display now.
Richard Jones <richard@users.sourceforge.net>
parents:
131
diff
changeset
|
1168 # 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
|
1169 # oops |
|
5e8da9d010bd
Handles new node display now.
Richard Jones <richard@users.sourceforge.net>
parents:
131
diff
changeset
|
1170 # |
| 131 | 1171 # Revision 1.10 2001/07/29 09:28:23 richard |
| 1172 # Fixed sorting by clicking on column headings. | |
| 1173 # | |
|
130
204f99944de0
Fixed sorting by clicking on column headings.
Richard Jones <richard@users.sourceforge.net>
parents:
128
diff
changeset
|
1174 # 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
|
1175 # 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
|
1176 # drill-down) |
|
204f99944de0
Fixed sorting by clicking on column headings.
Richard Jones <richard@users.sourceforge.net>
parents:
128
diff
changeset
|
1177 # |
|
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
|
1178 # 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
|
1179 # 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
|
1180 # |
|
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
|
1181 # 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
|
1182 # 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
|
1183 # |
|
123
51cce9671db0
Cleanup of the link label generation.
Richard Jones <richard@users.sourceforge.net>
parents:
119
diff
changeset
|
1184 # 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
|
1185 # 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
|
1186 # |
|
119
ad64dade1769
Fixed problem in link display when Link value is None.
Richard Jones <richard@users.sourceforge.net>
parents:
116
diff
changeset
|
1187 # 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
|
1188 # 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
|
1189 # |
|
116
c73f727208b0
fixed use of stylesheet
Richard Jones <richard@users.sourceforge.net>
parents:
113
diff
changeset
|
1190 # 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
|
1191 # Replaced errno integers with their module values. |
|
c73f727208b0
fixed use of stylesheet
Richard Jones <richard@users.sourceforge.net>
parents:
113
diff
changeset
|
1192 # De-tabbed templatebuilder.py |
|
c73f727208b0
fixed use of stylesheet
Richard Jones <richard@users.sourceforge.net>
parents:
113
diff
changeset
|
1193 # |
|
113
2ab86442799a
Replaced errno integers with their module values.
Richard Jones <richard@users.sourceforge.net>
parents:
72
diff
changeset
|
1194 # 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
|
1195 # 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
|
1196 # 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
|
1197 # one returned by getprops().keys(). |
|
2ab86442799a
Replaced errno integers with their module values.
Richard Jones <richard@users.sourceforge.net>
parents:
72
diff
changeset
|
1198 # 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
|
1199 # |
|
72
c186b637fee0
Hrm - displaying links to classes that don't specify a key property.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
1200 # 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
|
1201 # 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
|
1202 # |
|
26
c7c14960f413
Final commit of Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
25
diff
changeset
|
1203 # 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
|
1204 # More Grande Splite |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1205 # |
|
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
|
1206 # |
|
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
|
1207 # 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
|
1208 |
