From 0dabb2d572d1d298a2a94d81ae549c478e42a410 Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 11 Sep 2002 02:49:56 +0000 Subject: [PATCH] Added the missing keyword/topic interface to classic template (blush) Cleaned up the classhelp API Fixed some stuff in the customisation doc example. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1134 57a73879-2fb5-44c3-a270-3262357dd7e2 --- TODO.txt | 4 +-- doc/customizing.txt | 17 ++++++------- roundup/cgi/templating.py | 27 +++++++++++++-------- roundup/templates/classic/dbinit.py | 6 ++--- roundup/templates/classic/html/home | 2 +- roundup/templates/classic/html/issue.index | 2 ++ roundup/templates/classic/html/issue.item | 11 ++++++--- roundup/templates/classic/html/issue.search | 15 ++++++++++++ roundup/templates/classic/html/page | 13 +++++++--- 9 files changed, 65 insertions(+), 32 deletions(-) diff --git a/TODO.txt b/TODO.txt index 8670986..5280c6e 100644 --- a/TODO.txt +++ b/TODO.txt @@ -45,8 +45,6 @@ pending web: search "refinement" pending web: UNIX init.d script for roundup-server pending web: rewritten documentation (can come after the beta though so stuff is settled) ... including relevant file names in customisation doc -pending admin: have "set" command be applicable to all items in a class -pending admin: add "unset" command pending dist: include the HTML in docs bug web: request.url is incorrect in cgi-bin environments @@ -78,6 +76,8 @@ done web: fix double-submit by having new-item-submit redirect at end done web: daemonify roundup-server (fork, logfile, pidfile) done web: modify cgitb to display PageTemplate errors better done web: have roundup.cgi pick up instance config from the environment +done admin: have "set" command be applicable to all items in a class, and also + be able to unset properties (ie. set to None) rejected instance: the use of non-Python configuration files (ConfigParser) diff --git a/doc/customizing.txt b/doc/customizing.txt index acc555d..223f04a 100644 --- a/doc/customizing.txt +++ b/doc/customizing.txt @@ -2,7 +2,7 @@ Customising Roundup =================== -:Version: $Revision: 1.27 $ +:Version: $Revision: 1.28 $ .. This document borrows from the ZopeBook section on ZPT. The original is at: http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx @@ -974,7 +974,7 @@ template issue item edit form - from the "issue.item" template):: Superseder - +
View: @@ -982,7 +982,7 @@ template issue item edit form - from the "issue.item" template):: Nosy List - + @@ -1293,7 +1293,7 @@ To get everything to line up properly we will put everything in a table, and put a nice big header on it so the user has an idea what is happening:: - + Next we need the actual field that the user is going to enter the new category. The "context.name.field(size=60)" bit tells roundup to generate a @@ -1303,7 +1303,7 @@ this is that when the user types something in to the form, a new category will be created with that name:: - + @@ -1326,10 +1326,10 @@ So putting it all together, and closing the table and form we get::
Category
Category
NameName name
- + - + @@ -1362,8 +1362,7 @@ it is entirely up to your sense of aesthetics:: First we define a nice header so that the user knows what the next section diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index b458c6c..f1b78b4 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -348,17 +348,24 @@ class HTMLClass: for x in self._klass.filter(None, filterspec, sort, group)] return l - def classhelp(self, properties, label='?', width='400', height='400'): - '''pop up a javascript window with class help - - This generates a link to a popup window which displays the - properties indicated by "properties" of the class named by - "classname". The "properties" should be a comma-separated list - (eg. 'id,name,description'). - - You may optionally override the label displayed, the width and - height. The popup window will be resizable and scrollable. + def classhelp(self, properties=None, label='list', width='500', + height='400'): + ''' Pop up a javascript window with class help + + This generates a link to a popup window which displays the + properties indicated by "properties" of the class named by + "classname". The "properties" should be a comma-separated list + (eg. 'id,name,description'). Properties defaults to all the + properties of a class (excluding id, creator, created and + activity). + + You may optionally override the label displayed, the width and + height. The popup window will be resizable and scrollable. ''' + if properties is None: + properties = self._klass.getprops(protected=0).keys() + properties.sort() + properties = ','.join(properties) return ''\ '(%s)'%(self.classname, properties, width, height, label) diff --git a/roundup/templates/classic/dbinit.py b/roundup/templates/classic/dbinit.py index 0cb944d..9ed49bd 100644 --- a/roundup/templates/classic/dbinit.py +++ b/roundup/templates/classic/dbinit.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: dbinit.py,v 1.27 2002-09-11 01:18:24 richard Exp $ +# $Id: dbinit.py,v 1.28 2002-09-11 02:49:56 richard Exp $ import os @@ -93,7 +93,7 @@ def open(name=None): # SECURITY SETTINGS # # new permissions for this schema - for cl in 'issue', 'file', 'msg', 'user': + for cl in 'issue', 'file', 'msg', 'user', 'keyword': db.security.addPermission(name="Edit", klass=cl, description="User is allowed to edit "+cl) db.security.addPermission(name="View", klass=cl, @@ -101,7 +101,7 @@ def open(name=None): # Assign the access and edit permissions for issue, file and message # to regular users now - for cl in 'issue', 'file', 'msg': + for cl in 'issue', 'file', 'msg', 'keyword': p = db.security.getPermission('View', cl) db.security.addPermissionToRole('User', p) p = db.security.getPermission('Edit', cl) diff --git a/roundup/templates/classic/html/home b/roundup/templates/classic/html/home index 03fe21b..d64492a 100644 --- a/roundup/templates/classic/html/home +++ b/roundup/templates/classic/html/home @@ -6,6 +6,6 @@ --> diff --git a/roundup/templates/classic/html/issue.index b/roundup/templates/classic/html/issue.index index 4b1e3af..8edd88d 100644 --- a/roundup/templates/classic/html/issue.index +++ b/roundup/templates/classic/html/issue.index @@ -5,6 +5,7 @@ + @@ -22,6 +23,7 @@ + - - + + diff --git a/roundup/templates/classic/html/issue.search b/roundup/templates/classic/html/issue.search index c589990..3bc6025 100644 --- a/roundup/templates/classic/html/issue.search +++ b/roundup/templates/classic/html/issue.search @@ -34,6 +34,21 @@ + + + + + + + + diff --git a/roundup/templates/classic/html/page b/roundup/templates/classic/html/page index ff11246..e5c0f34 100644 --- a/roundup/templates/classic/html/page +++ b/roundup/templates/classic/html/page @@ -34,11 +34,18 @@ Issues
New Issue
- Unassigned Issues
- All Issues
+ Unassigned Issues
+ All Issues
Search Issues

+

+ Keywords
+ New Keyword
+

+

Admin
@@ -59,7 +66,7 @@

Hello,
username
- My Issues
+ My Issues
My Details
Logout -- 2.30.2

Category
Category
NameName name
Category - + Priority ID ActivityTopic Title Status Created By title diff --git a/roundup/templates/classic/html/issue.item b/roundup/templates/classic/html/issue.item index 8c653f6..50eca43 100644 --- a/roundup/templates/classic/html/issue.item +++ b/roundup/templates/classic/html/issue.item @@ -22,7 +22,7 @@ Superseder - +
View: @@ -31,15 +31,18 @@
Nosy List - +
Assigned To assignedto menu  Topics + + +
 
Topic: + +
Created: