changeset 1113:a95428868bf4

Added the missing keyword/topic interface to classic template (blush) Cleaned up the classhelp API Fixed some stuff in the customisation doc example.
author Richard Jones <richard@users.sourceforge.net>
date Wed, 11 Sep 2002 02:49:56 +0000
parents 70f187da3cf2
children 153c6087d38b
files TODO.txt doc/customizing.txt roundup/cgi/templating.py roundup/templates/classic/dbinit.py roundup/templates/classic/html/home roundup/templates/classic/html/issue.index roundup/templates/classic/html/issue.item roundup/templates/classic/html/issue.search roundup/templates/classic/html/page
diffstat 9 files changed, 63 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/TODO.txt	Wed Sep 11 02:20:35 2002 +0000
+++ b/TODO.txt	Wed Sep 11 02:49:56 2002 +0000
@@ -45,8 +45,6 @@
 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: 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)
 
--- a/doc/customizing.txt	Wed Sep 11 02:20:35 2002 +0000
+++ b/doc/customizing.txt	Wed Sep 11 02:49:56 2002 +0000
@@ -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 @@
   <th nowrap>Superseder</th>
   <td>
    <span tal:replace="structure python:context.superseder.field(showid=1, size=20)" />
-   <span tal:replace="structure python:db.issue.classhelp('id,title', label='list', width=500)" />
+   <span tal:replace="structure python:db.issue.classhelp('id,title')" />
    <span tal:condition="context/superseder">
     <br>View: <span tal:replace="structure python:context.superseder.link(showid=1)" />
    </span>
@@ -982,7 +982,7 @@
   <th nowrap>Nosy List</th>
   <td>
    <span tal:replace="structure context/nosy/field" />
-   <span tal:replace="structure python:db.user.classhelp('username,realname,address,phone', label='list', width=500)" />
+   <span tal:replace="structure python:db.user.classhelp('username,realname,address,phone')" />
   </td>
  </tr>
  
@@ -1293,7 +1293,7 @@
 and put a nice big header on it so the user has an idea what is happening::
 
     <table class="form">
-     <tr class="strong-header"><td colspan=2>Category</td></tr>
+     <tr><th class="header" colspan=2>Category</th></tr>
 
 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 @@
 will be created with that name::
 
     <tr>
-     <td nowrap>Name</td>
+     <th nowrap>Name</th>
      <td tal:content="structure python:context.name.field(size=60)">name</td>
     </tr>
 
@@ -1326,10 +1326,10 @@
   <input type="hidden" name=":required" value="name">
 
   <table class="form">
-   <tr class="strong-header"><td colspan=2>Category</td></tr>
+   <tr><th class="header" colspan=2>Category</th></tr>
 
    <tr>
-    <td nowrap>Name</td>
+    <th nowrap>Name</th>
     <td tal:content="structure python:context.name.field(size=60)">name</td>
    </tr>
 
@@ -1362,8 +1362,7 @@
 
    <th nowrap>Category</th>
    <td><span tal:replace="structure context/category/field" />
-       <span tal:replace="structure python:db.category.classhelp('name',
-             label='list', width=500)" />
+       <span tal:replace="structure db/category/classhelp" />
    </td>
 
 First we define a nice header so that the user knows what the next section
--- a/roundup/cgi/templating.py	Wed Sep 11 02:20:35 2002 +0000
+++ b/roundup/cgi/templating.py	Wed Sep 11 02:49:56 2002 +0000
@@ -348,17 +348,24 @@
              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
+    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').
+            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.
+            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 '<a href="javascript:help_window(\'%s?:template=help&' \
             ':contentonly=1&properties=%s\', \'%s\', \'%s\')"><b>'\
             '(%s)</b></a>'%(self.classname, properties, width, height, label)
--- a/roundup/templates/classic/dbinit.py	Wed Sep 11 02:20:35 2002 +0000
+++ b/roundup/templates/classic/dbinit.py	Wed Sep 11 02:49:56 2002 +0000
@@ -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 @@
     # 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 @@
 
     # 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)
--- a/roundup/templates/classic/html/home	Wed Sep 11 02:20:35 2002 +0000
+++ b/roundup/templates/classic/html/home	Wed Sep 11 02:49:56 2002 +0000
@@ -6,6 +6,6 @@
 -->
 <span tal:replace="structure python:db.issue.renderWith('index',
     sort=('-', 'activity'), group=('+', 'priority'), filter=['status'],
-    columns=['id','activity','title','creator','assignedto', 'status'],
+    columns=['id','activity','topic','title','creator','assignedto', 'status'],
     filterspec={'status':['-1','1','2','3','4','5','6','7']})" />
 
--- a/roundup/templates/classic/html/issue.index	Wed Sep 11 02:20:35 2002 +0000
+++ b/roundup/templates/classic/html/issue.index	Wed Sep 11 02:49:56 2002 +0000
@@ -5,6 +5,7 @@
    <th tal:condition="request/show/priority">Priority</th>
    <th tal:condition="request/show/id">ID</th>
    <th tal:condition="request/show/activity">Activity</th>
+   <th tal:condition="request/show/topic">Topic</th>
    <th tal:condition="request/show/title">Title</th>
    <th tal:condition="request/show/status">Status</th>
    <th tal:condition="request/show/creator">Created&nbsp;By</th>
@@ -22,6 +23,7 @@
    <td tal:condition="request/show/id" tal:content="i/id"></td>
    <td tal:condition="request/show/activity"
        tal:content="i/activity/reldate"></td>
+   <td tal:condition="request/show/topic" tal:content="i/topic"></td>
    <td tal:condition="request/show/title">
     <a tal:attributes="href string:issue${i/id}"
        tal:content="python:str(i.title) or '[no title]'">title</a>
--- a/roundup/templates/classic/html/issue.item	Wed Sep 11 02:20:35 2002 +0000
+++ b/roundup/templates/classic/html/issue.item	Wed Sep 11 02:49:56 2002 +0000
@@ -22,7 +22,7 @@
  <th nowrap>Superseder</th>
  <td>
   <span tal:replace="structure python:context.superseder.field(showid=1, size=20)" />
-  <span tal:replace="structure python:db.issue.classhelp('id,title', label='list', width=500)" />
+  <span tal:replace="structure python:db.issue.classhelp('id,title')" />
   <span tal:condition="context/superseder" tal:repeat="sup context/superseder">
    <br>View: <a tal:attributes="href string:issue${sup/id}"
                 tal:content="sup/id"></a>
@@ -31,15 +31,18 @@
  <th nowrap>Nosy List</th>
  <td>
   <span tal:replace="structure context/nosy/field" />
-  <span tal:replace="structure python:db.user.classhelp('username,realname,address,phone', label='list', width=500)" />
+  <span tal:replace="structure python:db.user.classhelp('username,realname,address,phone')" />
  </td>
 </tr>
 
 <tr>
  <th nowrap>Assigned To</th>
  <td tal:content="structure context/assignedto/menu">assignedto menu</td>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
+ <th nowrap>Topics</th>
+ <td>
+  <span tal:replace="structure context/topic/field" />
+  <span tal:replace="structure db/keyword/classhelp" />
+ </td>
 </tr>
 
 <tr>
--- a/roundup/templates/classic/html/issue.search	Wed Sep 11 02:20:35 2002 +0000
+++ b/roundup/templates/classic/html/issue.search	Wed Sep 11 02:49:56 2002 +0000
@@ -35,6 +35,21 @@
 </tr>
 
 <tr>
+ <th>Topic:</th>
+ <td>
+  <select name="topic">
+   <option value="">don't care</option>
+   <option value="">------------</option>
+   <option tal:repeat="s db/keyword/list" tal:attributes="value s/name"
+           tal:content="s/name">topic to filter on</option>
+  </select>
+ </td>
+ <td><input type="checkbox" name=":columns" value="topic" checked></td>
+ <td><input type="radio" name=":sort" value="topic"></td>
+ <td><input type="radio" name=":group" value="topic"></td>
+</tr>
+
+<tr>
  <th>Created:</th>
  <td><input name="activity"></td>
  <td><input type="checkbox" name=":columns" value="created"></td>
--- a/roundup/templates/classic/html/page	Wed Sep 11 02:20:35 2002 +0000
+++ b/roundup/templates/classic/html/page	Wed Sep 11 02:49:56 2002 +0000
@@ -34,12 +34,19 @@
    <b>Issues</b><br>
    <a tal:condition="python:request.user.hasPermission('Edit', 'issue')"
       href="issue?:template=item">New Issue<br></a>
-   <a href="issue?:sort=-activity&:group=priority&:filter=status,assignedto&:columns=id,activity,title,creator,status&status=-1,1,2,3,4,5,6,7&assignedto=-1">Unassigned Issues</a><br>
-   <a href="issue?:sort=-activity&:group=priority&:filter=status&:columns=id,activity,title,creator,assignedto,status&status=-1,1,2,3,4,5,6,7">All Issues</a><br>
+   <a href="issue?:sort=-activity&:group=priority&:filter=status,assignedto&:columns=id,activity,topic,title,creator,status&status=-1,1,2,3,4,5,6,7&assignedto=-1">Unassigned Issues</a><br>
+   <a href="issue?:sort=-activity&:group=priority&:filter=status&:columns=id,activity,topic,title,creator,assignedto,status&status=-1,1,2,3,4,5,6,7">All Issues</a><br>
    <a href="issue?:template=search">Search Issues</a>
   </p>
 
   <p class="classblock"
+     tal:condition="python:request.user.hasPermission('View', 'keyword')">
+   <b>Keywords</b><br>
+   <a tal:condition="python:request.user.hasPermission('Edit', 'keyword')"
+      href="keyword?:template=item">New Keyword<br></a>
+  </p>
+
+  <p class="classblock"
        tal:condition="python:request.user.hasPermission('Edit', None)">
    <b>Admin</b><br>
    <a href="home?:template=classlist">Class List</a><br>
@@ -59,7 +66,7 @@
    
   <p class="userblock" tal:condition="python:request.user.username != 'anonymous'">
    <b>Hello,</b><br><b tal:content="request/user/username">username</b><br>
-   <a tal:attributes="href string:issue?:sort=-activity&:group=priority&:filter=status,assignedto&:columns=id,activity,title,creator,status&status=-1,1,2,3,4,5,6,7&assignedto=${request/user/id}">My Issues</a><br>
+   <a tal:attributes="href string:issue?:sort=-activity&:group=priority&:filter=status,assignedto&:columns=id,topic,activity,title,creator,status&status=-1,1,2,3,4,5,6,7&assignedto=${request/user/id}">My Issues</a><br>
    <a tal:attributes="href string:user${request/user/id}">My Details</a><br>
    <a tal:attributes="href python:request.indexargs_href('',
        {':action':'logout'})">Logout</a>

Roundup Issue Tracker: http://roundup-tracker.org/