[CMF-checkins] CVS: CMF - discussion_reply.dtml:1.1 discussion_reply_form.dtml:1.3.6.1 discussion_reply_preview.dtml:1.3.6.1 showThreads.dtml:1.4.6.1 viewThreadsAtBottom.dtml:1.1.8.1
tseaver@digicool.com
tseaver@digicool.com
Thu, 14 Jun 2001 16:27:49 -0400 (EDT)
Update of /cvs-repository/CMF/CMFDefault/skins/generic
In directory korak.digicool.com:/tmp/cvs-serv30518/skins/generic
Modified Files:
Tag: discussiongeddon_1_1-branch
discussion_reply_form.dtml discussion_reply_preview.dtml
showThreads.dtml viewThreadsAtBottom.dtml
Added Files:
discussion_reply.dtml
Log Message:
- Adds a set of baseline unit tests for the discussions
machinery, including tests for:
o policy checks (whether discussions are allowable)
o nested replies
o cataloguing of replies
o propagation of 'manage_beforeDelete' from the host content
object, and correct un-cataloguing.
- Cleans up a lot of cruft, including fossilized inheritance,
old-style security declarations, etc., in
CMFDefault.DiscussionItem. In particular, DiscussionItem
now implements the DiscussionResponse interface directly,
instead of mixing in the older implementation.
- Replaces the current "path-based" 'in_reply_to' with a simpler,
more robust scheme.
o The old version was a legacy of the much older usage, which
had discussion items in users' "Correspondence" folders, and
assembled them into threads using catalog queries; it was
fragile in the face of moves or renames of the "host"
content object.
o The new scheme stores 'None' in the 'in_reply_to' field to
indicate that the item is a "top-level" reply to the host
content object, or the simple ID of the sibling, for
threaded replies.
- Refactors the skins for discussions a bit, moving the "above
in thread" logic into a separate method, and adding a special
view for DiscussionItems which uses it.
- Adds an 'upgrade_discussion' ExternalMethod to CMFDefault;
this method:
1. Installs (if one isn't already there) a
FactoryTypeInformation object for DiscussionItems. This
FTI is "crippled" for adding objects (no factory/product),
but provides a hook on which to hang the custom view, and
set other type-specific policies.
2. Removes the "(default)" workflow for DiscussionItems, so
as not to present the "Retract", etc. actions; later, we
might add a special workflow, to permit sufficiently
privileged users to delete replies.
3. Updates existing DiscussionItems to conform to the new
scheme.
--- Added File discussion_reply.dtml in package CMF ---
<dtml-var standard_html_header>
<dtml-let replyID="createReply( title=REQUEST[ 'title' ]
, text=REQUEST[ 'text' ]
, Creator=REQUEST[ 'Creator' ]
)">
<dtml-call expr="RESPONSE.redirect( '%s/%s' % ( absolute_url(), replyID ) )">
</dtml-let>
<dtml-var standard_html_footer>
--- Updated File discussion_reply_form.dtml in package CMF --
--- discussion_reply_form.dtml 2001/04/08 19:18:20 1.3
+++ discussion_reply_form.dtml 2001/06/14 20:27:46 1.3.6.1
@@ -27,7 +27,7 @@
<td></td>
<td>
<input type="submit" value="Preview" name="&dtml-getId;/discussion_reply_preview:method">
- <input type="submit" value="Reply" name="createReply:method">
+ <input type="submit" value="Reply" name="discussion_reply:method">
</td>
</tr>
</table>
--- Updated File discussion_reply_preview.dtml in package CMF --
--- discussion_reply_preview.dtml 2001/04/08 19:18:20 1.3
+++ discussion_reply_preview.dtml 2001/06/14 20:27:46 1.3.6.1
@@ -21,7 +21,7 @@
<td>
<input type="submit" value="Edit"
name="&dtml-getId;/discussion_reply_form:method">
- <input type="submit" value="Reply" name="createReply:method">
+ <input type="submit" value="Reply" name="discussion_reply:method">
</td>
</tr></table>
</form>
--- Updated File showThreads.dtml in package CMF --
--- showThreads.dtml 2001/05/25 17:46:04 1.4
+++ showThreads.dtml 2001/06/14 20:27:46 1.4.6.1
@@ -2,33 +2,18 @@
showThreads.dtml
Generate a simple tree view of message threads to include on a page.
</dtml-comment>
+<!-- showThreads -->
-<dtml-if "_.hasattr(this().talkback, 'parentsInThread') and talkback.parentsInThread(1)">
- Above in thread:
- <dtml-if "_.len(this().talkback.parentsInThread()) > 5">... :</dtml-if>
- <dtml-in "talkback.parentsInThread(5)">
- <a href="&dtml-absolute_url;">&dtml-title;</a>
- <dtml-unless sequence-end>:</dtml-unless>
- </dtml-in>
- <p>
-</dtml-if>
-
+<dtml-comment>
+ The following lamosity brought to you courtesy of the tree tag,
+ which has to use the 'URL' value from the MD.
+</dtml-comment>
<dtml-let URL=absolute_url>
-<dtml-if expr="PARENTS[0].meta_type == 'Discussion Item'">
- Replies:
- <dtml-tree branches="getReplies">
- <a href="&dtml-absolute_url;"><img border=0 src="<dtml-var SCRIPT_NAME><dtml-var getIcon>"></a>
- <a href="&dtml-absolute_url;">&dtml-title;</a>,
- by <dtml-var Creator>
- on <dtml-var Date>
- </dtml-tree>
-<dtml-else>
- <dtml-tree name="talkback" branches="getReplies">
- <a href="&dtml-absolute_url;"><img border=0 src="<dtml-var SCRIPT_NAME><dtml-var getIcon>"></a>
- <a href="&dtml-absolute_url;">&dtml-title;</a>,
- by <dtml-var Creator>
- on <dtml-var Date>
- </dtml-tree>
-</dtml-if>
+<dtml-tree branches_expr="talkback.getReplies()">
+ <a href="&dtml-absolute_url;"
+ ><img border=0 src="&dtml-portal_url;/&dtml-getIcon;"></a>
+ <a href="&dtml-absolute_url;">&dtml-Title;</a>,
+ by <dtml-var Creator>
+ on <dtml-var CreationDate>
+</dtml-tree>
</dtml-let>
-
--- Updated File viewThreadsAtBottom.dtml in package CMF --
--- viewThreadsAtBottom.dtml 2001/02/23 14:24:10 1.1
+++ viewThreadsAtBottom.dtml 2001/06/14 20:27:46 1.1.8.1
@@ -4,10 +4,13 @@
really should be defined by an acquired property or some such...
</dtml-comment>
-<dtml-if expr="_.hasattr(this(), 'talkback')">
- <dtml-if expr="talkback.hasReplies()">
- <h4>Comments:</h4>
+<!-- viewThreadsAtBottom -->
+
+<dtml-if talkback>
+ <dtml-if expr="talkback.hasReplies()">
+ <h4>Comments:</h4>
<dtml-var showThreads>
- </dtml-if>
+ </dtml-if>
+
</dtml-if>