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