From 5b02534bebaddf9353e060cc44799953ca9638fe Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 26 Feb 2003 04:08:04 +0000 Subject: [PATCH] Better form name mangling, doesn't confuse other things like generic editing. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1545 57a73879-2fb5-44c3-a270-3262357dd7e2 --- TODO.txt | 2 ++ roundup/cgi/client.py | 5 +++-- roundup/cgi/templating.py | 37 +++++++++++++++++++------------------ 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/TODO.txt b/TODO.txt index 3b995f2..6f64a41 100644 --- a/TODO.txt +++ b/TODO.txt @@ -28,6 +28,8 @@ pending mailgw Identification of users should have a configurable degree of pending mailgw Use in-reply-to for determining message lineage when subject line lets us down pending mailgw Allow different brackets delimiting [issueNNN] in Subject +pending mailgw Have mailgw detect reply email with rego OTKs and complete + the rego. pending email email sig could use a "remove me from this list" /?:remove:nosy=me pending project switch to a Roundup instance for Roundup bug/feature tracking diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py index 435f733..10848f0 100644 --- a/roundup/cgi/client.py +++ b/roundup/cgi/client.py @@ -1,4 +1,4 @@ -# $Id: client.py,v 1.97 2003-02-25 10:19:32 richard Exp $ +# $Id: client.py,v 1.98 2003-02-26 04:08:04 richard Exp $ __doc__ = """ WWW request handler (also used in the stand-alone server). @@ -452,7 +452,7 @@ class Client: # these are the actions that are available actions = ( ('edit', 'editItemAction'), - ('editCSV', 'editCSVAction'), + ('editcsv', 'editCSVAction'), ('new', 'newItemAction'), ('register', 'registerAction'), ('confrego', 'confRegoAction'), @@ -469,6 +469,7 @@ class Client: identifies the method on this object to call. The four basic actions are defined in the "actions" sequence on this class: "edit" -> self.editItemAction + "editcsv" -> self.editCSVAction "new" -> self.newItemAction "register" -> self.registerAction "confrego" -> self.confRegoAction diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index dff1bbc..288b6f6 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -784,12 +784,13 @@ class HTMLProperty: self._prop = prop self._value = value self._anonymous = anonymous + self._name = name if not anonymous: - self._name = '%s%s@%s'%(classname, nodeid, name) + self._formname = '%s%s@%s'%(classname, nodeid, name) else: - self._name = name + self._formname = name def __repr__(self): - return ''%(id(self), self._name, + return ''%(id(self), self._formname, self._prop, self._value) def __str__(self): return self.plain() @@ -857,7 +858,7 @@ class StringHTMLProperty(HTMLProperty): else: value = cgi.escape(str(self._value)) value = '"'.join(value.split('"')) - return ''%(self._name, value, size) + return ''%(self._formname, value, size) def multiline(self, escape=0, rows=5, cols=40): ''' Render a multiline form edit field for the property @@ -868,7 +869,7 @@ class StringHTMLProperty(HTMLProperty): value = cgi.escape(str(self._value)) value = '"'.join(value.split('"')) return ''%( - self._name, rows, cols, value) + self._formname, rows, cols, value) def email(self, escape=1): ''' Render the value of the property as an obscured email address @@ -897,7 +898,7 @@ class PasswordHTMLProperty(HTMLProperty): def field(self, size = 30): ''' Render a form edit field for the property. ''' - return ''%(self._name, size) + return ''%(self._formname, size) def confirm(self, size = 30): ''' Render a second form edit field for the property, used for @@ -905,7 +906,7 @@ class PasswordHTMLProperty(HTMLProperty): a field with name ":confirm:name". ''' return ''%( - self._name, size) + self._formname, size) class NumberHTMLProperty(HTMLProperty): def plain(self): @@ -921,7 +922,7 @@ class NumberHTMLProperty(HTMLProperty): else: value = cgi.escape(str(self._value)) value = '"'.join(value.split('"')) - return ''%(self._name, value, size) + return ''%(self._formname, value, size) class BooleanHTMLProperty(HTMLProperty): def plain(self): @@ -935,13 +936,13 @@ class BooleanHTMLProperty(HTMLProperty): ''' Render a form edit field for the property ''' checked = self._value and "checked" or "" - s = 'Yes'%(self._name, + s = 'Yes'%(self._formname, checked) if checked: checked = "" else: checked = "checked" - s += 'No'%(self._name, + s += 'No'%(self._formname, checked) return s @@ -960,7 +961,7 @@ class DateHTMLProperty(HTMLProperty): DateHTMLProperty. ''' return DateHTMLProperty(self._client, self._nodeid, self._prop, - self._name, date.Date('.')) + self._formname, date.Date('.')) def field(self, size = 30): ''' Render a form edit field for the property @@ -970,7 +971,7 @@ class DateHTMLProperty(HTMLProperty): else: value = cgi.escape(str(self._value.local(self._db.getUserTimezone()))) value = '"'.join(value.split('"')) - return ''%(self._name, value, size) + return ''%(self._formname, value, size) def reldate(self, pretty=1): ''' Render the interval between the date and now. @@ -1004,7 +1005,7 @@ class DateHTMLProperty(HTMLProperty): ''' Return the date/time as a local (timezone offset) date/time. ''' return DateHTMLProperty(self._client, self._nodeid, self._prop, - self._name, self._value.local(offset)) + self._formname, self._value.local(offset)) class IntervalHTMLProperty(HTMLProperty): def plain(self): @@ -1027,7 +1028,7 @@ class IntervalHTMLProperty(HTMLProperty): else: value = cgi.escape(str(self._value)) value = '"'.join(value.split('"')) - return ''%(self._name, value, size) + return ''%(self._formname, value, size) class LinkHTMLProperty(HTMLProperty): ''' Link HTMLProperty @@ -1080,7 +1081,7 @@ class LinkHTMLProperty(HTMLProperty): sort_on = linkcl.labelprop() options = linkcl.filter(None, {}, ('+', sort_on), (None, None)) # TODO: make this a field display, not a menu one! - l = [''%self._formname] k = linkcl.labelprop(1) if self._value is None: s = 'selected ' @@ -1127,7 +1128,7 @@ class LinkHTMLProperty(HTMLProperty): sortfunc = make_sort_function(self._db, self._prop.classname) linkcl = self._db.getclass(self._prop.classname) - l = [''%self._formname] k = linkcl.labelprop(1) s = '' if value is None: @@ -1244,7 +1245,7 @@ class MultilinkHTMLProperty(HTMLProperty): k = linkcl.labelprop(1) value = [linkcl.get(v, k) for v in value] value = cgi.escape(','.join(value)) - return ''%(self._name, size, value) + return ''%(self._formname, size, value) def menu(self, size=None, height=None, showid=0, additional=[], **conditions): @@ -1262,7 +1263,7 @@ class MultilinkHTMLProperty(HTMLProperty): sort_on = ('+', linkcl.labelprop()) options = linkcl.filter(None, conditions, sort_on, (None,None)) height = height or min(len(options), 7) - l = [''%(self._formname, height)] k = linkcl.labelprop(1) # make sure we list the current values if they're retired -- 2.30.2