summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8b3bc96)
raw | patch | inline | side by side (parent: 8b3bc96)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sat, 5 Jan 2002 02:35:10 +0000 (02:35 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sat, 5 Jan 2002 02:35:10 +0000 (02:35 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@500 57a73879-2fb5-44c3-a270-3262357dd7e2
I18N_PROGRESS.txt | patch | blob | history | |
roundup/htmltemplate.py | patch | blob | history |
diff --git a/I18N_PROGRESS.txt b/I18N_PROGRESS.txt
index dad31c0bb25e078c74130287a985a8a5f206e967..9b2b97219b880dcf2c9b0107a2c6c97d9567d519 100644 (file)
--- a/I18N_PROGRESS.txt
+++ b/I18N_PROGRESS.txt
THESE FILES DO NOT USE _()
==========================
-roundup/htmltemplate.py
roundup/hyperdb.py
roundup/i18n.py
roundup/init.py
roundup/admin.py
roundup/cgitb.py
roundup/date.py
+roundup/htmltemplate.py
WE DON'T CARE ABOUT THESE FILES
index f0d12d492b5afe7f80b3207b0f8454d347914c33..28f4f40040ff7b1da352887f8e3b6ea4d4298e60 100644 (file)
--- a/roundup/htmltemplate.py
+++ b/roundup/htmltemplate.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: htmltemplate.py,v 1.49 2001-12-20 15:43:01 rochecompaan Exp $
+# $Id: htmltemplate.py,v 1.50 2002-01-05 02:35:10 richard Exp $
__doc__ = """
Template engine.
import os, re, StringIO, urllib, cgi, errno
import hyperdb, date, password
+from i18n import _
# This imports the StructureText functionality for the do_stext function
# get it from http://dev.zope.org/Members/jim/StructuredTextWiki/NGReleases
linked nodes (or the ids if the linked class has no key property)
'''
if not self.nodeid and self.form is None:
- return '[Field: not called from item]'
+ return _('[Field: not called from item]')
propclass = self.properties[property]
if self.nodeid:
# make sure the property is a valid one
else: value = str(value)
elif isinstance(propclass, hyperdb.Password):
if value is None: value = ''
- else: value = '*encrypted*'
+ else: value = _('*encrypted*')
elif isinstance(propclass, hyperdb.Date):
value = str(value)
elif isinstance(propclass, hyperdb.Interval):
linkcl = self.db.classes[propclass.classname]
k = linkcl.labelprop()
if value: value = str(linkcl.get(value, k))
- else: value = '[unselected]'
+ else: value = _('[unselected]')
elif isinstance(propclass, hyperdb.Multilink):
linkcl = self.db.classes[propclass.classname]
k = linkcl.labelprop()
s = 'selected '
else:
s = ''
- l.append('<option %svalue="-1">- no selection -</option>'%s)
+ l.append(_('<option %svalue="-1">- no selection -</option>')%s)
options = linkcl.list()
options.sort(sortfunc)
for optionid in options:
size, ','.join(input_value)))
s = "<br>\n".join(l)
else:
- s = 'Plain: bad propclass "%s"'%propclass
+ s = _('Plain: bad propclass "%(propclass)s"')%locals()
return s
def do_menu(self, property, size=None, height=None, showid=0):
s = ''
if value is None:
s = 'selected '
- l.append('<option %svalue="-1">- no selection -</option>'%s)
+ l.append(_('<option %svalue="-1">- no selection -</option>')%s)
for optionid in linkcl.list():
option = linkcl.get(optionid, k)
s = ''
l.append('<option %svalue="%s">%s</option>'%(s, optionid, option))
l.append('</select>')
return '\n'.join(l)
- return '[Menu: not a link]'
+ return _('[Menu: not a link]')
#XXX deviates from spec
def do_link(self, property=None, is_download=0):
downloaded file name is correct.
'''
if not self.nodeid and self.form is None:
- return '[Link: not called from item]'
+ return _('[Link: not called from item]')
propclass = self.properties[property]
if self.nodeid:
value = self.cl.get(self.nodeid, property)
linkname = propclass.classname
linkcl = self.db.classes[linkname]
k = linkcl.labelprop()
- if not value : return '[no %s]'%property.capitalize()
+ if not value:
+ return _('[no %(propname)s]')%{'propname': property.capitalize()}
l = []
for value in value:
linkvalue = linkcl.get(value, k)
l.append('<a href="%s%s">%s</a>'%(linkname, value,
linkvalue))
return ', '.join(l)
- if isinstance(propclass, hyperdb.String):
- if value == '': value = '[no %s]'%property.capitalize()
+ if isinstance(propclass, hyperdb.String) and value == '':
+ return _('[no %(propname)s]')%{'propname': property.capitalize()}
if is_download:
return '<a href="%s%s/%s">%s</a>'%(self.classname, self.nodeid,
value, value)
the list
'''
if not self.nodeid:
- return '[Count: not called from item]'
+ return _('[Count: not called from item]')
propclass = self.properties[property]
value = self.cl.get(self.nodeid, property)
if isinstance(propclass, hyperdb.Multilink):
return str(len(value))
- return '[Count: not a Multilink]'
+ return _('[Count: not a Multilink]')
# XXX pretty is definitely new ;)
def do_reldate(self, property, pretty=0):
with the 'pretty' flag, make it pretty
'''
if not self.nodeid and self.form is None:
- return '[Reldate: not called from item]'
+ return _('[Reldate: not called from item]')
propclass = self.properties[property]
if isinstance(not propclass, hyperdb.Date):
- return '[Reldate: not a Date]'
+ return _('[Reldate: not a Date]')
if self.nodeid:
value = self.cl.get(self.nodeid, property)
else:
interval = value - date.Date('.')
if pretty:
if not self.nodeid:
- return 'now'
+ return _('now')
pretty = interval.pretty()
if pretty is None:
pretty = value.pretty()
allow you to download files
'''
if not self.nodeid:
- return '[Download: not called from item]'
+ return _('[Download: not called from item]')
propclass = self.properties[property]
value = self.cl.get(self.nodeid, property)
if isinstance(propclass, hyperdb.Link):
linkvalue = linkcl.get(value, k)
l.append('<a href="%s%s">%s</a>'%(linkcl, value, linkvalue))
return ', '.join(l)
- return '[Download: not a link]'
+ return _('[Download: not a link]')
def do_checklist(self, property, **args):
propclass = self.properties[property]
if (not isinstance(propclass, hyperdb.Link) and not
isinstance(propclass, hyperdb.Multilink)):
- return '[Checklist: not a link]'
+ return _('[Checklist: not a link]')
# get our current checkbox state
if self.nodeid:
checked = 'checked'
else:
checked = ''
- l.append('[unselected]:<input type="checkbox" %s name="%s" '
- 'value="-1">'%(checked, property))
+ l.append(_('[unselected]:<input type="checkbox" %s name="%s" '
+ 'value="-1">')%(checked, property))
return '\n'.join(l)
def do_note(self, rows=5, cols=80):
'''
propcl = self.properties[property]
if not isinstance(propcl, hyperdb.Multilink):
- return '[List: not a Multilink]'
+ return _('[List: not a Multilink]')
value = self.cl.get(self.nodeid, property)
if reverse:
value.reverse()
''' list the history of the item
'''
if self.nodeid is None:
- return "[History: node doesn't exist]"
+ return _("[History: node doesn't exist]")
l = ['<table width=100% border=0 cellspacing=0 cellpadding=2>',
'<tr class="list-header">',
- '<td><span class="list-item"><strong>Date</strong></span></td>',
- '<td><span class="list-item"><strong>User</strong></span></td>',
- '<td><span class="list-item"><strong>Action</strong></span></td>',
- '<td><span class="list-item"><strong>Args</strong></span></td>']
+ _('<td><span class="list-item"><strong>Date</strong></span></td>'),
+ _('<td><span class="list-item"><strong>User</strong></span></td>'),
+ _('<td><span class="list-item"><strong>Action</strong></span></td>'),
+ _('<td><span class="list-item"><strong>Args</strong></span></td>')]
for id, date, user, action, args in self.cl.history(self.nodeid):
l.append('<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>'%(
''' add a submit button for the item
'''
if self.nodeid:
- return '<input type="submit" value="Submit Changes">'
+ return _('<input type="submit" value="Submit Changes">')
elif self.form is not None:
- return '<input type="submit" value="Submit New Entry">'
+ return _('<input type="submit" value="Submit New Entry">')
else:
- return '[Submit: not called from item]'
+ return _('[Submit: not called from item]')
#
for nodeid in nodeids:
# check for a group heading
if group_names:
- this_group = [self.cl.get(nodeid, name, '[no value]') for name in group_names]
+ this_group = [self.cl.get(nodeid, name, _('[no value]')) for name in group_names]
if this_group != old_group:
l = []
for name in group_names:
key = group_cl.getkey()
value = self.cl.get(nodeid, name)
if value is None:
- l.append('[unselected %s]'%prop.classname)
+ l.append(_('[unselected %(classname)s]')%{
+ 'classname': prop.classname})
else:
l.append(group_cl.get(self.cl.get(nodeid,
name), key))
for value in self.cl.get(nodeid, name):
l.append(group_cl.get(value, key))
else:
- value = self.cl.get(nodeid, name, '[no value]')
+ value = self.cl.get(nodeid, name, _('[no value]'))
if value is None:
- value = '[empty %s]'%name
+ value = _('[empty %(name)s]')%locals()
else:
value = str(value)
l.append(value)
# display the filter section
w('<table width=100% border=0 cellspacing=0 cellpadding=2>')
w('<tr class="location-bar">')
- w(' <th align="left" colspan="2">Filter specification...</th>')
+ w(_(' <th align="left" colspan="2">Filter specification...</th>'))
w('</tr>')
replace = IndexTemplateReplace(self.globals, locals(), filter)
w(replace.go(template))
w('<tr class="location-bar"><td width="1%%"> </td>')
- w('<td><input type="submit" name="action" value="Redisplay"></td></tr>')
+ w(_('<td><input type="submit" name="action" value="Redisplay"></td></tr>'))
w('</table>')
# now add in the filter/columns/group/etc config table form
w('<input type="hidden" name=":group" value="%s">' % name)
# TODO: The widget style can go into the stylesheet
- w('<th align="left" colspan=%s>'
+ w(_('<th align="left" colspan=%s>'
'<input style="height : 1em; width : 1em; font-size: 12pt" type="submit" name="action" value="%s"> View '
- 'customisation...</th></tr>\n'%(len(names)+1, action))
+ 'customisation...</th></tr>\n')%(len(names)+1, action))
if not show_customization:
w('</table>\n')
# Filter
if all_filters:
- w('<tr><th width="1%" align=right class="location-bar">'
- 'Filters</th>\n')
+ w(_('<tr><th width="1%" align=right class="location-bar">Filters</th>\n'))
for name in names:
if name not in all_filters:
w('<td> </td>')
# Columns
if all_columns:
- w('<tr><th width="1%" align=right class="location-bar">'
- 'Columns</th>\n')
+ w(_('<tr><th width="1%" align=right class="location-bar">Columns</th>\n'))
for name in names:
if name not in all_columns:
w('<td> </td>')
w('</tr>\n')
# Grouping
- w('<tr><th width="1%" align=right class="location-bar">'
- 'Grouping</th>\n')
+ w(_('<tr><th width="1%" align=right class="location-bar">Grouping</th>\n'))
for name in names:
prop = self.properties[name]
if name not in all_columns:
w('<tr class="location-bar"><td width="1%"> </td>')
w('<td colspan="%s">'%len(names))
- w('<input type="submit" name="action" value="Redisplay"></td>')
+ w(_('<input type="submit" name="action" value="Redisplay"></td>'))
w('</tr>\n')
w('</table>\n')
#
# $Log: not supported by cvs2svn $
+# Revision 1.49 2001/12/20 15:43:01 rochecompaan
+# Features added:
+# . Multilink properties are now displayed as comma separated values in
+# a textbox
+# . The add user link is now only visible to the admin user
+# . Modified the mail gateway to reject submissions from unknown
+# addresses if ANONYMOUS_ACCESS is denied
+#
# Revision 1.48 2001/12/20 06:13:24 rochecompaan
# Bugs fixed:
# . Exception handling in hyperdb for strings-that-look-like numbers got