Skip to content

Commit d488fcd

Browse files
author
Richard Jones
committed
Allow a page request to include a :contentonly variable.
If it exists, we only render the content of the page, and not the surrounding "page" template.
1 parent 6de476a commit d488fcd

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

TODO.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ pending hyperdb: range searching of values (dates in particular)
1414
[value, value, ...] implies "in"
1515
pending hyperdb: make creator, creation and activity available pre-commit
1616
pending hyperdb: migrate "id" property to be Number type
17-
pending instance: including much simpler upgrade path and the use of
18-
non-Python configuration files (ConfigParser)
1917
pending instance: split instance.open() into open() and login()
2018
pending instance: rename to "instance" to "tracker"
2119
pending mailgw: allow commands (feature request #556996)
@@ -32,6 +30,7 @@ pending project: switch to a Roundup instance for Roundup bug/feature tracking
3230
pending project: have the demo allow anonymous login
3331
pending security: at least an LDAP user database implementation
3432
pending security: authenticate over a secure connection
33+
pending security: optionally auth with Basic HTTP auth instead of cookies
3534
pending security: use digital signatures in mailgw
3635
pending security: submission protection
3736
pending web: I18N
@@ -47,6 +46,7 @@ pending web: search "refinement"
4746
- add a drop-down with all queries which fills form with selected
4847
query values
4948
pending web: have roundup.cgi pick up instance config from the environment
49+
pending web: UNIX init.d script for roundup-server
5050

5151
New templating TODO:
5252
. rewritten documentation (can come after the beta though so stuff is settled)
@@ -55,10 +55,10 @@ New templating TODO:
5555
active web: title is stoopid
5656
active hyperdb: full-text searching doesn't appear to match stuff in titles,
5757
even though they're supposed to be indexed...
58-
active web: UNIX init.d script for roundup-server
5958

6059
ongoing: any bugs
6160

61+
rejected instance: the use of non-Python configuration files (ConfigParser)
6262
done web: Re-enable link backrefs from messages (feature request #568714) (RJ)
6363
done web: have the page layout (header/footer) be templatable (RJ)
6464
done web: fixing the templating so it works (RJ)
@@ -82,4 +82,3 @@ done web: saving of named queries (GM)
8282
done web: handle "not found", access and item page render errors better (RJ)
8383
done web: fix double-submit by having new-item-submit redirect at end (RJ)
8484
done web: daemonify roundup-server (fork, logfile, pidfile)
85-

doc/upgrading.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ it must now contain::
8686
# WARNING: DO NOT EDIT THIS FILE!!!
8787
from roundup.backends.back_anydbm import Database, Class, FileClass, IssueClass
8888

89+
Yes, I realise the irony of the "DO NOT EDIT THIS FILE" statement :)
8990
Note the addition of the Class, FileClass, IssueClass imports. These are very
9091
important, as they're going to make the next change work too. You now need to
9192
modify the top of the dbinit module in your instance from::

roundup/cgi/client.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.11 2002-09-04 04:31:51 richard Exp $
1+
# $Id: client.py,v 1.12 2002-09-05 01:27:42 richard Exp $
22

33
__doc__ = """
44
WWW request handler (also used in the stand-alone server).
@@ -114,8 +114,14 @@ def main(self):
114114
# self.classname and self.template)
115115
self.handle_action()
116116
# now render the page
117-
self.write(self.renderTemplate('page', '', ok_message=self.ok_message,
118-
error_message=self.error_message))
117+
if self.form.has_key(':contentonly'):
118+
# just the content
119+
self.write(self.content())
120+
else:
121+
# render the content inside the page template
122+
self.write(self.renderTemplate('page', '',
123+
ok_message=self.ok_message,
124+
error_message=self.error_message))
119125
except Redirect, url:
120126
# let's redirect - if the url isn't None, then we need to do
121127
# the headers, otherwise the headers have been set before the

roundup/cgi/templating.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,8 @@ def classhelp(self, properties, label='?', width='400', height='400'):
323323
height. The popup window will be resizable and scrollable.
324324
'''
325325
return '<a href="javascript:help_window(\'%s?:template=help&' \
326-
'properties=%s\', \'%s\', \'%s\')"><b>(%s)</b></a>'%(self.classname,
327-
properties, width, height, label)
326+
':contentonly=1&properties=%s\', \'%s\', \'%s\')"><b>'\
327+
'(%s)</b></a>'%(self.classname, properties, width, height, label)
328328

329329
def submit(self, label="Submit New Entry"):
330330
''' Generate a submit button (and action hidden element)

0 commit comments

Comments
 (0)