summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7ab09e2)
raw | patch | inline | side by side (parent: 7ab09e2)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 13 Jan 2003 23:30:44 +0000 (23:30 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 13 Jan 2003 23:30:44 +0000 (23:30 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1450 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
doc/customizing.txt | patch | blob | history | |
roundup/cgi/templating.py | patch | blob | history | |
roundup/templates/classic/html/issue.item | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 5474e7b67ad6c59b96c4580aa735050927130a05..ab49ca577758a2d1822ed5af7b432ecd37a7c7dd 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
- cleaning old unused sessions only once per hour, not on every cgi
request. It is greatly improves web interface performance, especially
on trackers under high load
+- fix StringHTMLProperty hyperlinking
2003-??-?? 0.5.5
- fixed rdbms searching by ID (sf bug 666615)
- detect corrupted index and raise semi-useful exception (sf bug 666767)
- open server logfile unbuffered
+- revert StringHTMLProperty to not hyperlink text by default
2003-01-10 0.5.4
diff --git a/doc/customizing.txt b/doc/customizing.txt
index 122b87223635527cf3414295ba5a857db77aa391..886e37a7f747da8b2f6a77a7612ec29da2e5d7dd 100644 (file)
--- a/doc/customizing.txt
+++ b/doc/customizing.txt
Customising Roundup
===================
-:Version: $Revision: 1.70 $
+:Version: $Revision: 1.71 $
.. This document borrows from the ZopeBook section on ZPT. The original is at:
http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
There are several methods available on these wrapper objects:
-=========== =================================================================
-Method Description
-=========== =================================================================
-plain render a "plain" representation of the property
-field render an appropriate form edit field for the property - for most
- types this is a text entry box, but for Booleans it's a tri-state
- yes/no/neither selection.
-stext only on String properties - render the value of the
- property as StructuredText (requires the StructureText module
- to be installed separately)
-multiline only on String properties - render a multiline form edit
- field for the property
-email only on String properties - render the value of the
- property as an obscured email address
-confirm only on Password properties - render a second form edit field for
- the property, used for confirmation that the user typed the
- password correctly. Generates a field with name "name:confirm".
-reldate only on Date properties - render the interval between the
- date and now
-pretty only on Interval properties - render the interval in a
- pretty format (eg. "yesterday")
-menu only on Link and Multilink properties - render a form select
- list for this property
-reverse only on Multilink properties - produce a list of the linked
- items in reverse order
-=========== =================================================================
+========= =====================================================================
+Method Description
+========= =====================================================================
+plain render a "plain" representation of the property. This method may
+ take two arguments:
+
+ escape
+ If true, escape the text so it is HTML safe (default: no). The
+ reason this defaults to off is that text is usually escaped
+ at a later stage by the TAL commands, unless the "structure"
+ option is used in the template. The following are all equivalent::
+
+ <p tal:content="structure python:msg.content.plain(escape=1)" />
+ <p tal:content="python:msg.content.plain()" />
+ <p tal:content="msg/content/plain" />
+ <p tal:content="msg/content" />
+
+ Usually you'll only want to use the escape option in a complex
+ expression.
+
+ hyperlink
+ If true, turn URLs, email addresses and hyperdb item designators
+ in the text into hyperlinks (default: no). Note that you'll need
+ to use the "structure" TAL option if you want to use this::
+
+ <p tal:content="structure python:msg.content.plain(hyperlink=1)" />
+
+ Note also that the text is automatically HTML-escape before the
+ hyperlinking transformation.
+
+field render an appropriate form edit field for the property - for most
+ types this is a text entry box, but for Booleans it's a tri-state
+ yes/no/neither selection.
+stext only on String properties - render the value of the
+ property as StructuredText (requires the StructureText module
+ to be installed separately)
+multiline only on String properties - render a multiline form edit
+ field for the property
+email only on String properties - render the value of the
+ property as an obscured email address
+confirm only on Password properties - render a second form edit field for
+ the property, used for confirmation that the user typed the
+ password correctly. Generates a field with name "name:confirm".
+reldate only on Date properties - render the interval between the
+ date and now
+pretty only on Interval properties - render the interval in a
+ pretty format (eg. "yesterday")
+menu only on Link and Multilink properties - render a form select
+ list for this property
+reverse only on Multilink properties - produce a list of the linked
+ items in reverse order
+========= =====================================================================
The request variable
~~~~~~~~~~~~~~~~~~~~
index 701770176013ed2eeed78bf20b5dde19c9d73319..bf2552eac27a515f5445567007d35a96df478fa7 100644 (file)
except KeyError:
return '%s%s'%(s1, s2)
- def plain(self, escape=0, hyperlink=1):
+ def plain(self, escape=0, hyperlink=0):
''' Render a "plain" representation of the property
"escape" turns on/off HTML quoting
if escape:
s = cgi.escape(str(self._value))
else:
- s = self._value
+ s = str(self._value)
if hyperlink:
+ if not escape:
+ s = cgi.escape(s)
s = self.url_re.sub(self._url_repl, s)
s = self.email_re.sub(self._email_repl, s)
s = self.designator_re.sub(self._designator_repl, s)
index abe2ce75a7233d9444ee9a9944da87ad7a1a4a5c..dcba3e0646f5620d834c412188a52b63f598b228 100644 (file)
</tr>
<tr>
<td colspan="4" class="content">
- <pre tal:content="structure msg/content">content</pre>
+ <pre tal:content="msg/content">content</pre>
</td>
</tr>
</tal:block>