[CMF-checkins] CVS: CMF/CMFDefault/skins/zpt_generic - discussion_reply_form.pt:1.4 discussion_reply_preview.pt:1.4
Florent Guillaume
fg@nuxeo.com
Sat, 29 Jun 2002 17:00:39 -0400
Update of /cvs-repository/CMF/CMFDefault/skins/zpt_generic
In directory cvs.zope.org:/tmp/cvs-serv654/CMFDefault/skins/zpt_generic
Modified Files:
discussion_reply_form.pt discussion_reply_preview.pt
Log Message:
Made discussion replies work correctly when hitting Enter in the title
field (Tracker #515), and corrected discussion Preview followed by an
Edit that lost body information (Tracker #516).
Put Creator computation in discussion_reply.py, no need to get it from
the forms. The Creator can still be spoofed though by using a URL like
doc/talkback/createReply?title=foo&text=bar&Creator=mickeymouse but this
is less obvious to script kiddies. But createReply should really compute
the creator itself.
Simplified a bit the page templates.
Fixed dtml to html_quote everything.
Removed spurious "This is evaluated." text.
=== CMF/CMFDefault/skins/zpt_generic/discussion_reply_form.pt 1.3 => 1.4 ===
<body>
<div metal:fill-slot="main">
-<div tal:define="dummy python:here.portal_discussion.getDiscussionFor(here)">This is evaluated.</div>
+<tal:block define="dummy python:here.portal_discussion.getDiscussionFor(here)" />
<form method="POST" action="talkback"
- tal:attributes="action string:${here/absolute_url}/talkback"
->
+ tal:attributes="action string:${here/absolute_url}/talkback">
+<input type="hidden" name=":default_method" value="discussion_reply">
+
<input type="hidden" name="Creator" value=""
- tal:attributes="value python: here.portal_membership.getAuthenticatedMember()">
+ tal:attributes="value here/portal_membership/getAuthenticatedMember">
<table class="FormLayout">
<tr>
<th align="left">Subject (Title)</th>
<td><input name="title" value=""
- tal:attributes="value here/title_override|here/title">
+ tal:attributes="value request/form/title|here/title">
</td>
</tr>
<tr>
<td colspan="2">
<b>Reply body</b><br>
<textarea name="text" cols="70" rows="10" wrap="soft" style="width: 100%"
- tal:content="here/text_override | nothing"></textarea>
+ tal:content="request/form/text|nothing"></textarea>
</td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" value="Preview" name=""
- tal:define="hId here/getId"
- tal:attributes="name python: hId + '/discussion_reply_preview:method'">
+ tal:attributes="name string:${here/getId}/discussion_reply_preview:method">
<input type="submit" value="Reply" name=""
tal:attributes="name string:discussion_reply:method">
</td>
=== CMF/CMFDefault/skins/zpt_generic/discussion_reply_preview.pt 1.3 => 1.4 ===
<div metal:fill-slot="main">
-<h3 tal:content="python: request.form['title']"></h3>
+<h3 tal:content="request/form/title"></h3>
<div tal:define="pss modules/Products.PythonScripts.standard"
tal:replace="structure python: pss.structured_text(request.form['text'])">Text Body</div>
<form method="POST" action="talkback"
- tal:attributes="action python: here.absolute_url() + '/talkback'">
+ tal:attributes="action string:${here/absolute_url}/talkback">
<input type="hidden" name="title" value=""
- tal:attributes="value python: request.form['title']">
+ tal:attributes="value request/form/title">
<input type="hidden" name="text" value=""
- tal:attributes="value python: request.form['text']">
- <input type="hidden" name="title_override" value=""
- tal:attributes="value python: request.form['title']">
- <input type="hidden" name="text_override" value=""
- tal:attributes="value python: request.form['text']">
+ tal:attributes="value request/form/text">
<input type="hidden" name="Creator" value=""
- tal:attributes="value python: here.portal_membership.getAuthenticatedMember()">
+ tal:attributes="value here/portal_membership/getAuthenticatedMember">
<table><tr>
<td width="15%"></td>
<td>
<input type="submit" value="Edit" name=""
- tal:define="hId here/getId"
- tal:attributes="name python: hId + '/discussion_reply_form:method'">
+ tal:attributes="name string:${here/getId}/discussion_reply_form:method">
<input type="submit" value="Reply" name="discussion_reply:method">
</td>
</tr></table>