Author: croberts
Date: 2012-07-25 17:48:53 +0000 (Wed, 25 Jul 2012)
New Revision: 5435
Modified:
trunk/cumin/python/cumin/formats.py
trunk/cumin/python/cumin/widgets.py
Log:
For BZ:800611 we are now producing valid XHTML when displaying a long queue name on the
add binding form. This is being done by omitting the span tag that was causing the
problem when it was added to the value attribute.
Modified: trunk/cumin/python/cumin/formats.py
===================================================================
--- trunk/cumin/python/cumin/formats.py 2012-07-16 13:50:47 UTC (rev 5434)
+++ trunk/cumin/python/cumin/formats.py 2012-07-25 17:48:53 UTC (rev 5435)
@@ -111,13 +111,18 @@
def fmt_none_brief():
return "<span class=\"none\">–</span>"
-def fmt_shorten(string, pre=16, post=4):
+def fmt_shorten(string, pre=16, post=4, spanify=True):
if len(string) > pre + post:
if post:
- string = "<span title=\"%s\">%s</span>" %
(string, string[:pre] + "…" + string[-post:])
+ if spanify:
+ string = "<span title=\"%s\">%s</span>" %
(string, string[:pre] + "…" + string[-post:])
+ else:
+ string = "%s" % string[:pre] + "…" +
string[-post:]
else:
- string = "<span title=\"%s\">%s</span>" %
(string, string[:pre] + "…")
-
+ if spanify:
+ string = "<span title=\"%s\">%s</span>" %
(string, string[:pre] + "…")
+ else:
+ string = "%s" % string[:pre] + "…"
return string
def fmt_link(href, content, class_="", id="",
link_title="", bm="", click="", attribs={}):
Modified: trunk/cumin/python/cumin/widgets.py
===================================================================
--- trunk/cumin/python/cumin/widgets.py 2012-07-16 13:50:47 UTC (rev 5434)
+++ trunk/cumin/python/cumin/widgets.py 2012-07-25 17:48:53 UTC (rev 5435)
@@ -1533,7 +1533,7 @@
if self.disabled:
field = self.form.object.get(session)
return fmt_shorten(field.get_formatted_value("name", escape=True),
- pre=36, post=4)
+ pre=36, post=4, spanify=False)
else:
input_value = self.param.get(session)
return input_value and xml_escape(input_value) or ""
Show replies by date