Mercurial > p > roundup > code
changeset 1204:b862bbf2067a
Replaced the content() callback ickiness with Page Template macro usage
changed the default CSS style to be less offensive to some ;)
better handling of Page Template compilation errors
removed dependency on ComputedAttribute
line wrap: on
line diff
--- a/CHANGES.txt Tue Sep 24 07:39:52 2002 +0000 +++ b/CHANGES.txt Wed Sep 25 02:10:25 2002 +0000 @@ -26,6 +26,9 @@ - import wasn't setting the ID to maxid+1 - added getItem to HTMLClass so you can access arbitrary items in templates - index filtering form values may now be key values too +- replaced the content() callback ickiness with Page Template macro usage +- changed the default CSS style to be less offensive to some ;) +- better handling of Page Template compilation errors 2002-09-13 0.5.0 beta2
--- a/roundup/cgi/ComputedAttribute.py Tue Sep 24 07:39:52 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -class ComputedAttribute: - def __init__(self, callable, level): - self.callable = callable - self.level = level - def __of__(self, *args): - if self.level > 0: - return self.callable - if isinstance(self.callable, type('')): - return getattr(args[0], self.callable) - return self.callable(*args) -
--- a/roundup/cgi/PageTemplates/PageTemplate.py Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/cgi/PageTemplates/PageTemplate.py Wed Sep 25 02:10:25 2002 +0000 @@ -21,7 +21,7 @@ """ -__version__='$Revision: 1.2 $'[11:-2] +__version__='$Revision: 1.3 $'[11:-2] import sys @@ -32,7 +32,6 @@ from Expressions import getEngine from string import join, strip, rstrip, split, replace, lower, find from cStringIO import StringIO -from ComputedAttribute import ComputedAttribute class PageTemplate: "Page Templates using TAL, TALES, and METAL" @@ -48,10 +47,6 @@ _text = '' _error_start = '<!-- Page Template Diagnostics' - def macros(self): - return self.pt_macros() - macros = ComputedAttribute(macros, 1) - def pt_edit(self, text, content_type): if content_type: self.content_type = str(content_type) @@ -120,11 +115,16 @@ def pt_macros(self): if not self._v_cooked: self._cook() + __traceback_supplement__ = (PageTemplateTracebackSupplement, self) if self._v_errors: - __traceback_supplement__ = (PageTemplateTracebackSupplement, self) raise PTRuntimeError, 'Page Template %s has errors.' % self.id return self._v_macros + def __getattr__(self, name): + if name == 'macros': + return self.pt_macros() + raise AttributeError, name + def pt_source_file(self): return None # Unknown.
--- a/roundup/cgi/cgitb.py Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/cgi/cgitb.py Wed Sep 25 02:10:25 2002 +0000 @@ -1,7 +1,7 @@ # # This module was written by Ka-Ping Yee, <ping@lfw.org>. # -# $Id: cgitb.py,v 1.6 2002-09-13 03:31:18 richard Exp $ +# $Id: cgitb.py,v 1.7 2002-09-25 02:10:25 richard Exp $ __doc__ = """ Extended CGI traceback handler by Ka-Ping Yee, <ping@lfw.org>. @@ -29,7 +29,9 @@ '<p class="help">Debugging information follows</p>' '<ol>'] from roundup.cgi.PageTemplates.Expressions import TraversalError - for frame, file, lnum, func, lines, index in inspect.trace(context): + t = inspect.trace(context) + t.reverse() + for frame, file, lnum, func, lines, index in t: args, varargs, varkw, locals = inspect.getargvalues(frame) if locals.has_key('__traceback_info__'): ti = locals['__traceback_info__'] @@ -46,8 +48,11 @@ ts = locals['__traceback_supplement__'] if len(ts) == 2: supp, context = ts - l.append('<li>A problem occurred in your template "%s"</li>'% - str(context.id)) + s = 'A problem occurred in your template "%s".'%str(context.id) + if context._v_errors: + s = s + '<br>' + '<br>'.join( + [cgi.escape(x) for x in context._v_errors]) + l.append('<li>%s</li>'%s) elif len(ts) == 3: supp, context, info = ts l.append('''
--- a/roundup/cgi/client.py Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/cgi/client.py Wed Sep 25 02:10:25 2002 +0000 @@ -1,4 +1,4 @@ -# $Id: client.py,v 1.41 2002-09-24 02:00:09 richard Exp $ +# $Id: client.py,v 1.42 2002-09-25 02:10:25 richard Exp $ __doc__ = """ WWW request handler (also used in the stand-alone server). @@ -10,7 +10,7 @@ from roundup import roundupdb, date, hyperdb, password from roundup.i18n import _ -from roundup.cgi.templating import getTemplate, HTMLRequest, NoTemplate +from roundup.cgi.templating import Templates, HTMLRequest, NoTemplate from roundup.cgi import cgitb from roundup.cgi.PageTemplates import PageTemplate @@ -152,14 +152,8 @@ self.additional_headers['Pragma'] = 'no-cache' self.additional_headers['Expires'] = 'Thu, 1 Jan 1970 00:00:00 GMT' - 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)) + # render the content + self.write(self.renderContext()) 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 @@ -333,39 +327,27 @@ self.write(open(os.path.join(self.instance.config.TEMPLATES, file)).read()) - def renderTemplate(self, name, extension, **kwargs): + def renderContext(self): ''' Return a PageTemplate for the named page ''' - pt = getTemplate(self.instance.config.TEMPLATES, name, extension) + name = self.classname + extension = self.template + pt = Templates(self.instance.config.TEMPLATES).get(name, extension) + # catch errors so we can handle PT rendering errors more nicely + args = { + 'ok_message': self.ok_message, + 'error_message': self.error_message + } try: # let the template render figure stuff out - return pt.render(self, None, None, **kwargs) - except PageTemplate.PTRuntimeError, message: - return '<strong>%s</strong><ol><li>%s</ol>'%(message, - '<li>'.join([cgi.escape(x) for x in pt._v_errors])) + return pt.render(self, None, None, **args) except NoTemplate, message: return '<strong>%s</strong>'%message except: # everything else return cgitb.pt_html() - def content(self): - ''' Callback used by the page template to render the content of - the page. - - If we don't have a specific class to display, that is none was - determined in determine_context(), then we display a "home" - template. - ''' - # now render the page content using the template we determined in - # determine_context - if self.classname is None: - name = 'home' - else: - name = self.classname - return self.renderTemplate(self.classname, self.template) - # these are the actions that are available actions = ( ('edit', 'editItemAction'),
--- a/roundup/cgi/templating.py Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/cgi/templating.py Wed Sep 25 02:10:25 2002 +0000 @@ -22,111 +22,88 @@ from roundup.cgi.TAL.TALInterpreter import TALInterpreter from roundup.cgi import ZTUtils -# XXX WAH pagetemplates aren't pickleable :( -#def getTemplate(dir, name, classname=None, request=None): -# ''' Interface to get a template, possibly loading a compiled template. -# ''' -# # source -# src = os.path.join(dir, name) -# -# # see if we can get a compile from the template"c" directory (most -# # likely is "htmlc" -# split = list(os.path.split(dir)) -# split[-1] = split[-1] + 'c' -# cdir = os.path.join(*split) -# split.append(name) -# cpl = os.path.join(*split) -# -# # ok, now see if the source is newer than the compiled (or if the -# # compiled even exists) -# MTIME = os.path.stat.ST_MTIME -# if (not os.path.exists(cpl) or os.stat(cpl)[MTIME] < os.stat(src)[MTIME]): -# # nope, we need to compile -# pt = RoundupPageTemplate() -# pt.write(open(src).read()) -# pt.id = name -# -# # save off the compiled template -# if not os.path.exists(cdir): -# os.makedirs(cdir) -# f = open(cpl, 'wb') -# pickle.dump(pt, f) -# f.close() -# else: -# # yay, use the compiled template -# f = open(cpl, 'rb') -# pt = pickle.load(f) -# return pt - -templates = {} - class NoTemplate(Exception): pass -def precompileTemplates(dir): - ''' Go through a directory and precompile all the templates therein - ''' - for filename in os.listdir(dir): - if os.path.isdir(filename): continue - if '.' in filename: - name, extension = filename.split('.') - getTemplate(dir, name, extension) - else: - getTemplate(dir, filename, None) +class Templates: + templates = {} + + def __init__(self, dir): + self.dir = dir -def getTemplate(dir, name, extension, classname=None, request=None): - ''' Interface to get a template, possibly loading a compiled template. - - "name" and "extension" indicate the template we're after, which in - most cases will be "name.extension". If "extension" is None, then - we look for a template just called "name" with no extension. + def precompileTemplates(self): + ''' Go through a directory and precompile all the templates therein + ''' + for filename in os.listdir(self.dir): + if os.path.isdir(filename): continue + if '.' in filename: + name, extension = filename.split('.') + self.getTemplate(name, extension) + else: + self.getTemplate(filename, None) - If the file "name.extension" doesn't exist, we look for - "_generic.extension" as a fallback. - ''' - # default the name to "home" - if name is None: - name = 'home' + def get(self, name, extension): + ''' Interface to get a template, possibly loading a compiled template. + + "name" and "extension" indicate the template we're after, which in + most cases will be "name.extension". If "extension" is None, then + we look for a template just called "name" with no extension. - # find the source, figure the time it was last modified - if extension: - filename = '%s.%s'%(name, extension) - else: - filename = name - src = os.path.join(dir, filename) - try: - stime = os.stat(src)[os.path.stat.ST_MTIME] - except os.error, error: - if error.errno != errno.ENOENT: - raise - if not extension: - raise NoTemplate, 'Template file "%s" doesn\'t exist'%name + If the file "name.extension" doesn't exist, we look for + "_generic.extension" as a fallback. + ''' + # default the name to "home" + if name is None: + name = 'home' - # try for a generic template - generic = '_generic.%s'%extension - src = os.path.join(dir, generic) + # find the source, figure the time it was last modified + if extension: + filename = '%s.%s'%(name, extension) + else: + filename = name + src = os.path.join(self.dir, filename) try: stime = os.stat(src)[os.path.stat.ST_MTIME] except os.error, error: if error.errno != errno.ENOENT: raise - # nicer error - raise NoTemplate, 'No template file exists for templating '\ - '"%s" with template "%s" (neither "%s" nor "%s")'%(name, - extension, filename, generic) - filename = generic + if not extension: + raise NoTemplate, 'Template file "%s" doesn\'t exist'%name + + # try for a generic template + generic = '_generic.%s'%extension + src = os.path.join(self.dir, generic) + try: + stime = os.stat(src)[os.path.stat.ST_MTIME] + except os.error, error: + if error.errno != errno.ENOENT: + raise + # nicer error + raise NoTemplate, 'No template file exists for templating '\ + '"%s" with template "%s" (neither "%s" nor "%s")'%(name, + extension, filename, generic) + filename = generic - key = (dir, filename) - if templates.has_key(key) and stime < templates[key].mtime: - # compiled template is up to date - return templates[key] + if self.templates.has_key(filename) and \ + stime < self.templates[filename].mtime: + # compiled template is up to date + return self.templates[filename] - # compile the template - templates[key] = pt = RoundupPageTemplate() - pt.write(open(src).read()) - pt.id = filename - pt.mtime = time.time() - return pt + # compile the template + self.templates[filename] = pt = RoundupPageTemplate() + pt.write(open(src).read()) + pt.id = filename + pt.mtime = time.time() + return pt + + def __getitem__(self, name): + name, extension = os.path.splitext(name) + if extension: + extension = extension[1:] + try: + return self.get(name, extension) + except NoTemplate, message: + raise KeyError, message class RoundupPageTemplate(PageTemplate.PageTemplate): ''' A Roundup-specific PageTemplate. @@ -149,8 +126,8 @@ - methods for easy filterspec link generation - *user*, the current user node as an HTMLItem instance - *form*, the current CGI form information as a FieldStorage - *instance* - The current instance + *tracker* + The current tracker *db* The current database, through which db.config may be reached. ''' @@ -159,10 +136,10 @@ 'options': {}, 'nothing': None, 'request': request, - 'content': client.content, 'db': HTMLDatabase(client), - 'instance': client.instance, + 'tracker': client.instance, 'utils': TemplatingUtils(client), + 'templates': Templates(client.instance.config.TEMPLATES), } # add in the item if there is one if client.nodeid: @@ -170,7 +147,7 @@ c['context'] = HTMLUser(client, classname, client.nodeid) else: c['context'] = HTMLItem(client, classname, client.nodeid) - else: + elif client.db.classes.has_key(classname): c['context'] = HTMLClass(client, classname) return c @@ -194,7 +171,7 @@ # and go output = StringIO.StringIO() - TALInterpreter(self._v_program, self._v_macros, + TALInterpreter(self._v_program, self.macros, getEngine().getContext(c), output, tal=1, strictinsert=0)() return output.getvalue() @@ -260,9 +237,8 @@ # we want classname to be exposed, but _classname gives a # consistent API for extending Class/Item self._classname = self.classname = classname - if classname is not None: - self._klass = self._db.getclass(self.classname) - self._props = self._klass.getprops() + self._klass = self._db.getclass(self.classname) + self._props = self._klass.getprops() def __repr__(self): return '<HTMLClass(0x%x) %s>'%(id(self), self.classname) @@ -426,8 +402,8 @@ 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) + '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) @@ -447,7 +423,7 @@ req.update(kwargs) # new template, using the specified classname and request - pt = getTemplate(self._db.config.TEMPLATES, self.classname, name) + pt = Templates(self._db.config.TEMPLATES).get(self.classname, name) # use our fabricated request return pt.render(self._client, self.classname, req) @@ -1440,7 +1416,7 @@ } function help_window(helpurl, width, height) { - HelpWin = window.open('%s/' + helpurl, 'RoundupHelpWindow', 'scrollbars=yes,resizable=yes,toolbar=no,height='+height+',width='+width); + HelpWin = window.open('%s' + helpurl, 'RoundupHelpWindow', 'scrollbars=yes,resizable=yes,toolbar=no,height='+height+',width='+width); } </script> '''%self.base
--- a/roundup/mailgw.py Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/mailgw.py Wed Sep 25 02:10:25 2002 +0000 @@ -73,7 +73,7 @@ an exception, the original message is bounced back to the sender with the explanatory message given in the exception. -$Id: mailgw.py,v 1.88 2002-09-20 23:20:57 richard Exp $ +$Id: mailgw.py,v 1.89 2002-09-25 02:10:24 richard Exp $ ''' import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri @@ -500,6 +500,7 @@ # reopen the database as the author username = self.db.user.get(author, 'username') + self.db.close() self.db = self.instance.open(username) # re-get the class with the new database connection
--- a/roundup/templates/classic/html/_generic.index Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/templates/classic/html/_generic.index Wed Sep 25 02:10:25 2002 +0000 @@ -1,4 +1,13 @@ <!-- dollarId: issue.index,v 1.2 2001/07/29 04:07:37 richard Exp dollar--> + +<tal:block metal:use-macro="templates/page/macros/page"> +<title metal:fill-slot="head_title" + tal:content="python:context._classname.capitalize()+' editing'"></title> +<td class="page-header-top" metal:fill-slot="body_title"> + <h2 tal:content="python:context._classname.capitalize()+' editing'"></h2> +</td> +<td class="content" metal:fill-slot="content"> + <span tal:condition="python:not (context.is_view_ok() or context.is_edit_ok())"> You are not allowed to view this page. </span> @@ -34,3 +43,6 @@ view ok </tal:block> +</td> + +</tal:block>
--- a/roundup/templates/classic/html/_generic.item Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/templates/classic/html/_generic.item Wed Sep 25 02:10:25 2002 +0000 @@ -1,3 +1,11 @@ +<tal:block metal:use-macro="templates/page/macros/page"> +<title metal:fill-slot="head_title" + tal:content="python:context._classname.capitalize()+' editing'"></title> +<td class="page-header-top" metal:fill-slot="body_title"> + <h2 tal:content="python:context._classname.capitalize()+' editing'"></h2> +</td> +<td class="content" metal:fill-slot="content"> + <span tal:condition="python:not (context.is_view_ok() or context.is_edit_ok())"> You are not allowed to view this page. </span> @@ -25,6 +33,7 @@ </tr> </table> +</form> <table class="form" tal:condition="context/is_only_view_ok"> @@ -35,15 +44,13 @@ <td tal:content="structure python:context[prop._name].field()"></td> </tal:block> </tr> -<tr> - <td> </td> - <td colspan=3 tal:content="structure context/submit"> - submit button will go here - </td> -</tr> </table> <tal:block tal:condition="python:context.id and context.is_view_ok()"> <tal:block tal:replace="structure context/history" /> </tal:block> + +</td> + +</tal:block>
--- a/roundup/templates/classic/html/file.index Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/templates/classic/html/file.index Wed Sep 25 02:10:25 2002 +0000 @@ -1,10 +1,28 @@ <!-- dollarId: file.index,v 1.4 2002/01/23 05:10:27 richard Exp dollar--> +<tal:block metal:use-macro="templates/page/macros/page"> +<title metal:fill-slot="head_title">List of files</title> +<td class="page-header-top" metal:fill-slot="body_title"> + <h2>List of files</h2> +</td> +<td class="content" metal:fill-slot="content"> + +<table class="otherinfo"> +<tr><th style="padding-right: 10">Download</th> + <th style="padding-right: 10">Content Type</th> + <th style="padding-right: 10">Uploaded By</th> + <th style="padding-right: 10">Date</th> +</tr> <tr tal:repeat="file context/list"> - <td tal:condition="display/properties/name"> - <a href="" tal:attributes="href string:file${file/id}/${file/name}">dld link</a> + <td> + <a tal:attributes="href string:file${file/id}/${file/name}" + tal:content="file/name">dld link</a> </td> - <td tal:condition="request/properties/type" tal:content="file/type">content type</td> - <td tal:condition="request/properties/creator" tal:content="file/creator/name">creator's name</td> - <td tal:condition="request/properties/creation" tal:content="file/creation">creation date</td> + <td tal:content="file/type">content type</td> + <td tal:content="file/creator">creator's name</td> + <td tal:content="file/creation">creation date</td> </tr> +</table> +</td> + +</tal:block>
--- a/roundup/templates/classic/html/file.item Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/templates/classic/html/file.item Wed Sep 25 02:10:25 2002 +0000 @@ -1,3 +1,11 @@ +<tal:block metal:use-macro="templates/page/macros/page"> +<title metal:fill-slot="head_title">File display</title> +<td class="page-header-top" metal:fill-slot="body_title"> + <h2>File display</h2> +</td> + +<td class="content" metal:fill-slot="content"> + <span tal:condition="python:not (context.is_view_ok() or context.is_edit_ok())"> You are not allowed to view this page. </span> @@ -49,4 +57,6 @@ <tal:block tal:condition="python:context.id and context.is_view_ok()" tal:replace="structure context/history" /> +</td> +</tal:block>
--- a/roundup/templates/classic/html/home Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/templates/classic/html/home Wed Sep 25 02:10:25 2002 +0000 @@ -8,4 +8,3 @@ sort=('-', 'activity'), group=('+', 'priority'), filter=['status'], columns=['id','activity','title','creator','assignedto', 'status'], filterspec={'status':['-1','1','2','3','4','5','6','7']})" /> -
--- a/roundup/templates/classic/html/home.classlist Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/templates/classic/html/home.classlist Wed Sep 25 02:10:25 2002 +0000 @@ -1,3 +1,9 @@ +<tal:block metal:use-macro="templates/page/macros/page"> +<title metal:fill-slot="head_title">List of classes</title> +<td class="page-header-top" metal:fill-slot="body_title"> + <h2>List of classes</h2> +</td> +<td class="content" metal:fill-slot="content"> <table class="classlist"> <tal:block tal:repeat="cl db/classes"> @@ -14,3 +20,6 @@ </tal:block> </table> +</td> + +</tal:block>
--- a/roundup/templates/classic/html/issue.index Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/templates/classic/html/issue.index Wed Sep 25 02:10:25 2002 +0000 @@ -1,4 +1,11 @@ <!-- dollarId: issue.index,v 1.2 2001/07/29 04:07:37 richard Exp dollar--> +<tal:block metal:use-macro="templates/page/macros/page"> +<title metal:fill-slot="head_title">List of issues</title> +<td class="page-header-top" metal:fill-slot="body_title"> + <h2>List of issues</h2> +</td> +<td class="content" metal:fill-slot="content"> + <tal:block tal:condition="not:context/is_view_ok"> You are not allowed to view this page. </tal:block> @@ -98,3 +105,6 @@ </tal:block> +</td> +</tal:block> +
--- a/roundup/templates/classic/html/issue.item Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/templates/classic/html/issue.item Wed Sep 25 02:10:25 2002 +0000 @@ -1,8 +1,15 @@ +<!-- dollarId: issue.item,v 1.4 2001/08/03 01:19:43 richard Exp dollar--> +<tal:block metal:use-macro="templates/page/macros/page"> +<title metal:fill-slot="head_title">Issue editing</title> +<td class="page-header-top" metal:fill-slot="body_title"><h2>Issue Editing</h2> +</td> + +<td class="content" metal:fill-slot="content"> + <span tal:condition="python:not (context.is_view_ok() or context.is_edit_ok())"> You are not allowed to view this page. </span> -<!-- dollarId: issue.item,v 1.4 2001/08/03 01:19:43 richard Exp dollar--> <form method="POST" onSubmit="return submit_once()" enctype="multipart/form-data" tal:condition="context/is_edit_ok"> @@ -136,3 +143,6 @@ </tal:block> +</td> + +</tal:block>
--- a/roundup/templates/classic/html/issue.search Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/templates/classic/html/issue.search Wed Sep 25 02:10:25 2002 +0000 @@ -1,3 +1,9 @@ +<tal:block metal:use-macro="templates/page/macros/page"> +<title metal:fill-slot="head_title">Issue searching</title> +<td class="page-header-top" metal:fill-slot="body_title"> + <h2>Issue searching</h2> +</td> +<td class="content" metal:fill-slot="content"> <form method="GET" tal:attributes="action request/classname"> <input type="hidden" name=":action" value="search"> @@ -173,3 +179,6 @@ </table> </form> +</td> + +</tal:block>
--- a/roundup/templates/classic/html/keyword.item Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/templates/classic/html/keyword.item Wed Sep 25 02:10:25 2002 +0000 @@ -1,4 +1,10 @@ <!-- dollarId: keyword.item,v 1.3 2002/05/22 00:32:34 richard Exp dollar--> +<tal:block metal:use-macro="templates/page/macros/page"> +<title metal:fill-slot="head_title">Keyword editing</title> +<td class="page-header-top" metal:fill-slot="body_title"> + <h2>Keyword editing</h2> +</td> +<td class="content" metal:fill-slot="content"> <table class="otherinfo" tal:define="keywords db/keyword/list" tal:condition="keywords"> @@ -41,3 +47,6 @@ </tr> </table> </form> +</td> + +</tal:block>
--- a/roundup/templates/classic/html/msg.index Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/templates/classic/html/msg.index Wed Sep 25 02:10:25 2002 +0000 @@ -1,3 +1,9 @@ +<tal:block metal:use-macro="templates/page/macros/page"> +<title metal:fill-slot="head_title">Message listing</title> +<td class="page-header-top" metal:fill-slot="body_title"> + <h2>Message listing</h2> +</td> +<td class="content" metal:fill-slot="content"> <table class="messages" tal:condition="request/filter"> <tr><th colspan=2 class="header">Messages</th></tr> <tal:block tal:repeat="msg context/list"> @@ -10,3 +16,6 @@ </tr> </tal:block> </table> +</td> + +</tal:block>
--- a/roundup/templates/classic/html/msg.item Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/templates/classic/html/msg.item Wed Sep 25 02:10:25 2002 +0000 @@ -1,4 +1,10 @@ <!-- dollarId: msg.item,v 1.3 2002/05/22 00:32:34 richard Exp dollar--> +<tal:block metal:use-macro="templates/page/macros/page"> +<title metal:fill-slot="head_title">Message editing</title> +<td class="page-header-top" metal:fill-slot="body_title"> + <h2>Message editing</h2> +</td> +<td class="content" metal:fill-slot="content"> <table class="form"> <tr> @@ -40,3 +46,6 @@ </table> <tal:block tal:replace="structure context/history" /> +</td> + +</tal:block>
--- a/roundup/templates/classic/html/page Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/templates/classic/html/page Wed Sep 25 02:10:25 2002 +0000 @@ -1,6 +1,6 @@ -<html tal:define="title request/description"> +<html metal:define-macro="page"> <head> -<title tal:content="title">title goes here</title> +<title metal:define-slot="head_title">title goes here</title> <link rel="stylesheet" type="text/css" href="_file/style.css"> @@ -14,9 +14,7 @@ <tr> <td class="page-header-left"> </td> - <td class="page-header-top"> - <h2 tal:content="title">name</h2> - </td> + <td class="page-header-top" metal:define-slot="body_title"><h2>name</h2></td> </tr> <tr> @@ -36,14 +34,17 @@ href="issue?:template=item">Create New<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">Show Unassigned</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">Show All</a><br> - <a href="issue?:template=search">Search Issues</a> + <a href="issue?:template=search">Search</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> + href="keyword?:template=item">Create New<br></a> + <a tal:condition="python:request.user.hasPermission('Edit', 'keyword') and + len(db.keyword.list())" + href="keyword?:template=item">Edit Existing<br></a> </p> <p class="classblock" @@ -80,9 +81,7 @@ </td> </tr> <tr> - <td width="100%" valign="top" tal:content="structure content" class="content"> - The page content goes here. - </td> + <td class="content" metal:define-slot="content">Page content goes here</td> </tr> </table>
--- a/roundup/templates/classic/html/query.item Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/templates/classic/html/query.item Wed Sep 25 02:10:25 2002 +0000 @@ -1,3 +1,9 @@ +<tal:block metal:use-macro="templates/page/macros/page"> +<title metal:fill-slot="head_title">Query editing</title> +<td class="page-header-top" metal:fill-slot="body_title"> + <h2>Query editing</h2> +</td> +<td class="content" metal:fill-slot="content"> <span tal:condition="not:context/is_edit_ok"> You are not allowed to view this page. </span> @@ -5,3 +11,6 @@ <span tal:condition="context/is_edit_ok" tal:content="structure context/renderQueryForm" /> +</td> + +</tal:block>
--- a/roundup/templates/classic/html/style.css Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/templates/classic/html/style.css Wed Sep 25 02:10:25 2002 +0000 @@ -3,22 +3,10 @@ font-family: sans-serif, Arial, Helvetica; color: #333333; } +a[href]:hover { color:blue; text-decoration: underline; } +a[href]:link { color:blue; text-decoration: none; } +a[href] { color:blue; text-decoration: none; } -/* generic hyperlink style */ -a[href]:hover { - text-decoration: underline; - color: blue; -} -a[href]:link { - text-decoration: none; - color: blue; -} -a[href] { - text-decoration: none; - color: blue; -} - -/* main page body container */ table.body { border: 0; padding: 0; @@ -27,41 +15,38 @@ } td.page-header-left { - background-color: #cccc88; padding: 5px; + border-bottom: 1px solid #444444; } td.page-header-top { - background-color: #cccc88; - border-bottom: 1px solid #dddd99; + border-bottom: 1px solid #444444; padding: 5px; } td.sidebar { - background-color: #cccc88; - border-right: 1px solid #dddd99; - border-bottom: 1px solid #dddd99; - padding: 0px; + padding: 1 0 0 1; } td.sidebar p.classblock { padding: 0 5 0 5; - border-top: 1px solid #dddd99; - border-bottom: 1px solid #dddd99; + margin: 1 1 1 1; + border: 1px solid #444444; + background-color: #eeeeee; } td.sidebar p.userblock { padding: 0 5 0 5; - background-color: #dddd99; - border-top: 1px solid #ffffbb; - border-bottom: 1px solid #ffffbb; + margin: 1 1 1 1; + border: 1px solid #444444; + background-color: #eeeeff; } td.content { - padding: 1px; + padding: 1 5 1 5; + vertical-align: top; } -/* feedback - ok and error messages */ p.ok-message { background-color: #22bb22; padding: 5 5 5 5; @@ -127,11 +112,12 @@ background-color: #eeeeff; border-right: 1px solid #404070; border-top: 1px solid #404070; + border-bottom: 1px solid #404070; vertical-align: top; } -table.list th a:hover { color: #404070 } -table.list th a:link { color: #404070 } -table.list th a { color: #404070 } +table.list th a[href]:hover { color: #404070 } +table.list th a[href]:link { color: #404070 } +table.list th a[href] { color: #404070 } table.list th.group { background-color: #f4f4ff; text-align: center; @@ -190,11 +176,6 @@ } table.messages td { - text-align: left; - empty-cells: show; -} - -table.messages td.content { font-family: monospace; background-color: #efefef; border-top: 1px solid #afafaf;
--- a/roundup/templates/classic/html/user.index Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/templates/classic/html/user.index Wed Sep 25 02:10:25 2002 +0000 @@ -1,4 +1,10 @@ <!-- dollarId: user.index,v 1.3 2002/07/09 05:29:51 richard Exp dollar--> +<tal:block metal:use-macro="templates/page/macros/page"> +<title metal:fill-slot="head_title">User listing</title> +<td class="page-header-top" metal:fill-slot="body_title"> + <h2>User listing</h2> +</td> +<td class="content" metal:fill-slot="content"> <span tal:condition="not:context/is_view_ok"> You are not allowed to view this page. @@ -24,3 +30,6 @@ <td tal:content="user/phone">phone</td> </tr> </table> +</td> + +</tal:block>
--- a/roundup/templates/classic/html/user.item Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/templates/classic/html/user.item Wed Sep 25 02:10:25 2002 +0000 @@ -1,4 +1,10 @@ <!-- dollarId: user.item,v 1.7 2002/08/16 04:29:04 richard Exp dollar--> +<tal:block metal:use-macro="templates/page/macros/page"> +<title metal:fill-slot="head_title">User editing</title> +<td class="page-header-top" metal:fill-slot="body_title"> + <h2>User editing</h2> +</td> +<td class="content" metal:fill-slot="content"> <span tal:condition="python:not (context.is_view_ok() or context.is_edit_ok())"> You are not allowed to view this page. </span> @@ -94,3 +100,6 @@ <tal:block tal:condition="python:context.id and context.is_view_ok()" tal:replace="structure context/history" /> +</td> + +</tal:block>
--- a/roundup/templates/classic/html/user.register Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/templates/classic/html/user.register Wed Sep 25 02:10:25 2002 +0000 @@ -1,4 +1,12 @@ <!-- dollarId: user.item,v 1.7 2002/08/16 04:29:04 richard Exp dollar--> +<tal:block metal:use-macro="templates/page/macros/page"> +<title metal:fill-slot="head_title" + tal:content="string:Registering with ${db/config/TRACKER_NAME}"></title> +<td class="page-header-top" metal:fill-slot="body_title"> + <h2 tal:content="string:Registering with ${db/config/TRACKER_NAME}"></h2> +</td> +<td class="content" metal:fill-slot="content"> + <tal:block tal:define=" editok python:request.user.username=='anonymous' and request.user.hasPermission('Web Registration')"> @@ -69,3 +77,6 @@ </tal:block> +</td> + +</tal:block>
