Code

much nicer error messages when there's a templating error
[roundup.git] / roundup / cgi / templating.py
index d7afb83a559c1e3a929fc898827aa552e07fd538..d29f31d6600aac87eae1d8eae92f55a511c90a2b 100644 (file)
@@ -98,7 +98,7 @@ def getTemplate(dir, name, extension, classname=None, request=None):
     # compile the template
     templates[key] = pt = RoundupPageTemplate()
     pt.write(open(src).read())
-    pt.id = name
+    pt.id = filename
     pt.mtime = time.time()
     return pt
 
@@ -323,8 +323,8 @@ class HTMLClass:
            height. The popup window will be resizable and scrollable.
         '''
         return '<a href="javascript:help_window(\'%s?:template=help&' \
-            'properties=%s\', \'%s\', \'%s\')"><b>(%s)</b></a>'%(self.classname,
-            properties, width, height, label)
+            ':contentonly=1&properties=%s\', \'%s\', \'%s\')"><b>'\
+            '(%s)</b></a>'%(self.classname, properties, width, height, label)
 
     def submit(self, label="Submit New Entry"):
         ''' Generate a submit button (and action hidden element)
@@ -1075,6 +1075,19 @@ class HTMLRequest:
         if kwargs.has_key('columns'):
             self.show = ShowDict(self.columns)
 
+    def description(self):
+        ''' Return a description of the request - handle for the page title.
+        '''
+        s = [self.client.db.config.INSTANCE_NAME]
+        if self.classname:
+            if self.client.nodeid:
+                s.append('- %s%s'%(self.classname, self.client.nodeid))
+            else:
+                s.append('- index of '+self.classname)
+        else:
+            s.append('- home')
+        return ' '.join(s)
+
     def __str__(self):
         d = {}
         d.update(self.__dict__)