summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 06dae4d)
raw | patch | inline | side by side (parent: 06dae4d)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 25 Sep 2002 02:10:25 +0000 (02:10 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 25 Sep 2002 02:10:25 +0000 (02:10 +0000) |
- changed the default CSS style to be less offensive to some ;)
- better handling of Page Template compilation errors
- removed dependency on ComputedAttribute
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1228 57a73879-2fb5-44c3-a270-3262357dd7e2
- better handling of Page Template compilation errors
- removed dependency on ComputedAttribute
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1228 57a73879-2fb5-44c3-a270-3262357dd7e2
25 files changed:
diff --git a/CHANGES.txt b/CHANGES.txt
index 733150dfca90e892972820e6bbb2903587fa1c5e..bc296387ef7b7330e207a019f36fed565335eec2 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
- 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
diff --git a/roundup/cgi/ComputedAttribute.py b/roundup/cgi/ComputedAttribute.py
+++ /dev/null
@@ -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)
-
index 948d7a88449c796dce79ea764c981dc1b39602cd..91d66d76297d14c794c62b34ed635cd8125015d2 100755 (executable)
"""
-__version__='$Revision: 1.2 $'[11:-2]
+__version__='$Revision: 1.3 $'[11:-2]
import sys
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"
_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)
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.
diff --git a/roundup/cgi/cgitb.py b/roundup/cgi/cgitb.py
index 630121b7d65c5518677782feba285c90da780503..fab248483a2e3cd1808340f339249aab531e2276 100644 (file)
--- a/roundup/cgi/cgitb.py
+++ b/roundup/cgi/cgitb.py
#
# 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>.
'<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__']
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('''
diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py
index dcefb3aa55208a5300be1282362f1626e781470e..a2e1e1ee03e7c49937ddadc23ae04a047dca56bf 100644 (file)
--- a/roundup/cgi/client.py
+++ b/roundup/cgi/client.py
-# $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).
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
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
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'),
index cd0e615b36ee70adc03a6d1821d85142c4d4492e..a9757fa35bba8716ded4b9cc4b0f9420b3151911 100644 (file)
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.
+ 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)
- "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 get(self, name, extension):
+ ''' Interface to get a template, possibly loading a compiled template.
- 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'
+ "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
-
- # try for a generic template
- generic = '_generic.%s'%extension
- src = os.path.join(dir, generic)
+ 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'
+
+ # 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
-
- key = (dir, filename)
- if templates.has_key(key) and stime < templates[key].mtime:
- # compiled template is up to date
- return templates[key]
-
- # compile the template
- templates[key] = pt = RoundupPageTemplate()
- pt.write(open(src).read())
- pt.id = filename
- pt.mtime = time.time()
- return pt
+ 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
+
+ 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
+ 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.
- 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.
'''
'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:
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
# 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()
# 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)
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)
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)
}
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
diff --git a/roundup/mailgw.py b/roundup/mailgw.py
index 2d08df58c1503e1f059df75772ecd9d12de2c451..9f339e7a078bb96ad2ac0f5d114a3ec92a790f01 100644 (file)
--- a/roundup/mailgw.py
+++ b/roundup/mailgw.py
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
# 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
diff --git a/roundup/templates/classic/html/_generic.index b/roundup/templates/classic/html/_generic.index
index 16ca747c01510a487bb3b2f8bda390a33d63e4cf..c9f7f189c39483f3da2d92154497b0139f609572 100644 (file)
<!-- 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>
view ok
</tal:block>
+</td>
+
+</tal:block>
diff --git a/roundup/templates/classic/html/_generic.item b/roundup/templates/classic/html/_generic.item
index 8fcf6721978f31c409725afd01cb1fb611d30051..ac52bdbfbfd1a828180ec9a394a160b706149825 100644 (file)
+<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>
</tr>
</table>
+</form>
<table class="form" tal:condition="context/is_only_view_ok">
<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>
index 689e207fcbdd7b755908d9bc6d0d2a928d6bdcff..11ef20ca29d41a15a61ac6a6e75cb451affd56ea 100644 (file)
<!-- 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>
index 6b5f0fed925057a69c945d1a5dbf4e3fcb0f5832..e540f8ae9bc6267d21092c67092e9538d6bcdeb2 100644 (file)
+<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>
<tal:block tal:condition="python:context.id and context.is_view_ok()"
tal:replace="structure context/history" />
+</td>
+</tal:block>
index 03fe21bbaf55ffadab473eb2a04d541a8cddf08f..fafdb2e5615986279c2b33dc0f96e4436e146689 100644 (file)
sort=('-', 'activity'), group=('+', 'priority'), filter=['status'],
columns=['id','activity','title','creator','assignedto', 'status'],
filterspec={'status':['-1','1','2','3','4','5','6','7']})" />
-
diff --git a/roundup/templates/classic/html/home.classlist b/roundup/templates/classic/html/home.classlist
index 6be69de2e30b9f7a37ae5cd12ff0d88333615974..32583bf16ceb73df87ba72188f58a61d16e004fa 100644 (file)
+<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">
</tal:block>
</table>
+</td>
+
+</tal:block>
diff --git a/roundup/templates/classic/html/issue.index b/roundup/templates/classic/html/issue.index
index dda9b9f78125274f34861fb29a28bdffd2d5af1d..7c058dbd4d70a7c7433675961e78a04e622352d3 100644 (file)
<!-- 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>
</tal:block>
+</td>
+</tal:block>
+
index 1838c2923db100fca556daeed14f514301408faf..46f3cb6d71d41b0fa642e3852dae198c70cbe222 100644 (file)
+<!-- 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">
</tal:block>
+</td>
+
+</tal:block>
diff --git a/roundup/templates/classic/html/issue.search b/roundup/templates/classic/html/issue.search
index 3bc602583fa2f627a1d4d868f7ca90b5b7533ea6..eeaf5c9d17206bf95105ff20b69eeb243044a23e 100644 (file)
+<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">
</table>
</form>
+</td>
+
+</tal:block>
diff --git a/roundup/templates/classic/html/keyword.item b/roundup/templates/classic/html/keyword.item
index fe56700fc18846cd789af923bf8e60a851ad0c2e..64d519c8522e51bb648e1132b99de84dfb429b86 100644 (file)
<!-- 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">
</tr>
</table>
</form>
+</td>
+
+</tal:block>
index f2a834852f6c28beb04a5893b8dbe1b58af0c991..b45f66a3a924c6cb609c49810e2413e35af23b92 100644 (file)
+<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">
</tr>
</tal:block>
</table>
+</td>
+
+</tal:block>
index 06d22006d226dc5ef7d8a624c27f5ed4309d76cb..bfce4edcae5d3167a83d9eb05f05eef76f75c712 100644 (file)
<!-- 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>
</table>
<tal:block tal:replace="structure context/history" />
+</td>
+
+</tal:block>
index 9ce95e2734f928097613151197d672f5d1128a72..bfa0aedf21d3df312e24e60cf5fda6a7a360385f 100644 (file)
-<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">
<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>
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"
</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>
index 9e4f2fed83ffd1f7de04857878d4216f74000e4d..88b0a6e5a630ea984dac8f8c8ae5e409ac6a7e98 100755 (executable)
+<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>
<span tal:condition="context/is_edit_ok"
tal:content="structure context/renderQueryForm" />
+</td>
+
+</tal:block>
index ad8fa1d3df15163ea3b3892e3f5917289fd9f34c..1a1574e889f26c61cea0e306aa2a404ed37bb739 100644 (file)
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;
}
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;
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;
}
table.messages td {
- text-align: left;
- empty-cells: show;
-}
-
-table.messages td.content {
font-family: monospace;
background-color: #efefef;
border-top: 1px solid #afafaf;
index 0bb7d13498e38aba8f4877113c3339f5cb767d79..8f5e0a54e51b3726aba44d784d457b1e643615de 100644 (file)
<!-- 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.
<td tal:content="user/phone">phone</td>
</tr>
</table>
+</td>
+
+</tal:block>
index 8dd12df4faecb483eb3a32aaa8ed7fdf481f0898..5685fa0845ff44a38f2cb40300698e1dad8530e1 100644 (file)
<!-- 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>
<tal:block tal:condition="python:context.id and context.is_view_ok()"
tal:replace="structure context/history" />
+</td>
+
+</tal:block>
diff --git a/roundup/templates/classic/html/user.register b/roundup/templates/classic/html/user.register
index ba9a7d4ce3b95821e19da00048dd63258c5a50d1..9b366df9c2ab803f8b45ca860b5ab4d795a97230 100644 (file)
<!-- 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')">
</tal:block>
+</td>
+
+</tal:block>