From 563ea130d94641aa25eae4b1f0fb79cb74c7519a Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 5 Sep 2002 01:27:42 +0000 Subject: [PATCH] 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. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1070 57a73879-2fb5-44c3-a270-3262357dd7e2 --- TODO.txt | 7 +++---- doc/upgrading.txt | 1 + roundup/cgi/client.py | 12 +++++++++--- roundup/cgi/templating.py | 4 ++-- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/TODO.txt b/TODO.txt index 53ae244..05405ce 100644 --- a/TODO.txt +++ b/TODO.txt @@ -14,8 +14,6 @@ pending hyperdb: range searching of values (dates in particular) [value, value, ...] implies "in" pending hyperdb: make creator, creation and activity available pre-commit pending hyperdb: migrate "id" property to be Number type -pending instance: including much simpler upgrade path and the use of - non-Python configuration files (ConfigParser) pending instance: split instance.open() into open() and login() pending instance: rename to "instance" to "tracker" pending mailgw: allow commands (feature request #556996) @@ -32,6 +30,7 @@ pending project: switch to a Roundup instance for Roundup bug/feature tracking pending project: have the demo allow anonymous login pending security: at least an LDAP user database implementation pending security: authenticate over a secure connection +pending security: optionally auth with Basic HTTP auth instead of cookies pending security: use digital signatures in mailgw pending security: submission protection pending web: I18N @@ -47,6 +46,7 @@ pending web: search "refinement" - add a drop-down with all queries which fills form with selected query values pending web: have roundup.cgi pick up instance config from the environment +pending web: UNIX init.d script for roundup-server New templating TODO: . rewritten documentation (can come after the beta though so stuff is settled) @@ -55,10 +55,10 @@ New templating TODO: active web: title is stoopid active hyperdb: full-text searching doesn't appear to match stuff in titles, even though they're supposed to be indexed... -active web: UNIX init.d script for roundup-server ongoing: any bugs +rejected instance: the use of non-Python configuration files (ConfigParser) done web: Re-enable link backrefs from messages (feature request #568714) (RJ) done web: have the page layout (header/footer) be templatable (RJ) done web: fixing the templating so it works (RJ) @@ -82,4 +82,3 @@ done web: saving of named queries (GM) done web: handle "not found", access and item page render errors better (RJ) done web: fix double-submit by having new-item-submit redirect at end (RJ) done web: daemonify roundup-server (fork, logfile, pidfile) - diff --git a/doc/upgrading.txt b/doc/upgrading.txt index 562f54b..6620e6a 100644 --- a/doc/upgrading.txt +++ b/doc/upgrading.txt @@ -86,6 +86,7 @@ it must now contain:: # WARNING: DO NOT EDIT THIS FILE!!! from roundup.backends.back_anydbm import Database, Class, FileClass, IssueClass +Yes, I realise the irony of the "DO NOT EDIT THIS FILE" statement :) Note the addition of the Class, FileClass, IssueClass imports. These are very important, as they're going to make the next change work too. You now need to modify the top of the dbinit module in your instance from:: diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py index a944376..a486d27 100644 --- a/roundup/cgi/client.py +++ b/roundup/cgi/client.py @@ -1,4 +1,4 @@ -# $Id: client.py,v 1.11 2002-09-04 04:31:51 richard Exp $ +# $Id: client.py,v 1.12 2002-09-05 01:27:42 richard Exp $ __doc__ = """ WWW request handler (also used in the stand-alone server). @@ -114,8 +114,14 @@ class Client: # self.classname and self.template) self.handle_action() # now render the page - self.write(self.renderTemplate('page', '', ok_message=self.ok_message, - error_message=self.error_message)) + if self.form.has_key(':contentonly'): + # just the content + self.write(self.content()) + else: + # render the content inside the page template + self.write(self.renderTemplate('page', '', + ok_message=self.ok_message, + error_message=self.error_message)) except Redirect, url: # let's redirect - if the url isn't None, then we need to do # the headers, otherwise the headers have been set before the diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index d7afb83..1d9bedf 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -323,8 +323,8 @@ class HTMLClass: height. The popup window will be resizable and scrollable. ''' return '(%s)'%(self.classname, - properties, width, height, label) + ':contentonly=1&properties=%s\', \'%s\', \'%s\')">'\ + '(%s)'%(self.classname, properties, width, height, label) def submit(self, label="Submit New Entry"): ''' Generate a submit button (and action hidden element) -- 2.30.2