2011-01-07 16:27:17 +01:00
|
|
|
<tal:block tal:define="userHasReplyPermission view/can_reply;
|
|
|
|
isDiscussionAllowed view/is_discussion_allowed;
|
|
|
|
isAnonymousDiscussionAllowed view/anonymous_discussion_allowed;
|
2013-09-17 14:03:46 +02:00
|
|
|
isEditCommentAllowed view/edit_comment_allowed;
|
2014-09-20 16:02:48 +02:00
|
|
|
isDeleteOwnCommentAllowed view/delete_own_comment_allowed;
|
2011-01-07 16:27:17 +01:00
|
|
|
isAnon view/is_anonymous;
|
|
|
|
canReview view/can_review;
|
|
|
|
replies python:view.get_replies(canReview);
|
|
|
|
has_replies python:view.has_replies(canReview);
|
|
|
|
showCommenterImage view/show_commenter_image;
|
|
|
|
errors options/state/getErrors|nothing;
|
2015-05-30 22:20:32 +02:00
|
|
|
wtool context/@@plone_tools/workflow;
|
|
|
|
auth_token context/@@authenticator/token|nothing"
|
2011-01-07 16:27:17 +01:00
|
|
|
tal:condition="python:isDiscussionAllowed or has_replies"
|
2010-01-27 18:00:58 +01:00
|
|
|
i18n:domain="plone">
|
2009-08-14 11:02:42 +02:00
|
|
|
|
2009-05-28 13:39:36 +02:00
|
|
|
<div class="reply"
|
2009-06-08 10:00:15 +02:00
|
|
|
tal:condition="python:isAnon and not isAnonymousDiscussionAllowed">
|
2009-05-28 13:39:36 +02:00
|
|
|
<form tal:attributes="action view/login_action">
|
2012-10-22 09:53:09 +02:00
|
|
|
<input class="standalone loginbutton"
|
2009-05-28 13:39:36 +02:00
|
|
|
type="submit"
|
|
|
|
value="Log in to add comments"
|
|
|
|
i18n:attributes="value label_login_to_add_comments;"
|
|
|
|
/>
|
|
|
|
</form>
|
|
|
|
</div>
|
2010-08-28 21:31:17 +02:00
|
|
|
|
2009-05-28 08:35:47 +02:00
|
|
|
<div class="discussion"
|
2009-08-28 23:21:54 +02:00
|
|
|
tal:attributes="class python: showCommenterImage and 'discussion showCommenterImage' or 'discussion';"
|
2010-08-24 13:25:17 +02:00
|
|
|
tal:condition="has_replies">
|
2009-05-28 08:35:47 +02:00
|
|
|
<tal:getreplies repeat="reply_dict replies">
|
2009-05-25 21:24:21 +02:00
|
|
|
|
|
|
|
<div class="comment"
|
2009-05-27 08:58:00 +02:00
|
|
|
tal:define="reply reply_dict/comment;
|
2009-05-28 08:08:55 +02:00
|
|
|
depth reply_dict/depth|python:0;
|
2012-10-22 09:53:09 +02:00
|
|
|
depth python: depth > 10 and '10' or depth;
|
2009-06-14 13:10:45 +02:00
|
|
|
author_home_url python:view.get_commenter_home_url(username=reply.author_username);
|
2010-01-27 15:54:07 +01:00
|
|
|
has_author_link python:author_home_url and not isAnon;
|
2009-06-14 13:10:45 +02:00
|
|
|
portrait_url python:view.get_commenter_portrait(reply.author_username);
|
2013-09-17 14:03:46 +02:00
|
|
|
review_state python:wtool.getInfoFor(reply, 'review_state', 'none');
|
2013-09-19 10:39:52 +02:00
|
|
|
canEdit python:view.can_edit(reply);
|
|
|
|
canDelete python:view.can_delete(reply)"
|
2009-12-19 15:04:49 +01:00
|
|
|
tal:attributes="class python:'comment replyTreeLevel'+str(depth)+' state-'+str(review_state);
|
2009-08-20 04:17:02 +02:00
|
|
|
id string:${reply/getId}"
|
2010-10-06 15:55:57 +02:00
|
|
|
tal:condition="python:canReview or review_state == 'published'">
|
2009-05-25 21:24:21 +02:00
|
|
|
|
2009-06-08 10:23:18 +02:00
|
|
|
<div class="commentImage" tal:condition="showCommenterImage">
|
2009-12-19 14:35:49 +01:00
|
|
|
<a href="" tal:condition="has_author_link"
|
2009-06-08 09:28:59 +02:00
|
|
|
tal:attributes="href author_home_url">
|
2013-11-13 15:53:12 +01:00
|
|
|
<img src="defaultUser.png"
|
2009-05-29 09:12:20 +02:00
|
|
|
alt=""
|
2012-11-01 08:31:02 +01:00
|
|
|
class="defaultuserimg"
|
2010-09-29 10:13:54 +02:00
|
|
|
height="32"
|
2009-06-14 13:10:45 +02:00
|
|
|
tal:attributes="src portrait_url;
|
2012-01-30 13:30:46 +01:00
|
|
|
alt reply/author_name" />
|
2009-05-28 08:08:55 +02:00
|
|
|
</a>
|
2013-11-13 15:53:12 +01:00
|
|
|
<img src="defaultUser.png"
|
2009-05-31 12:43:35 +02:00
|
|
|
alt=""
|
2012-11-01 08:31:02 +01:00
|
|
|
class="defaultuserimg"
|
2010-09-29 10:13:54 +02:00
|
|
|
height="32"
|
2009-12-19 14:35:49 +01:00
|
|
|
tal:condition="not: has_author_link"
|
2009-06-14 13:10:45 +02:00
|
|
|
tal:attributes="src portrait_url;
|
2012-01-30 13:30:46 +01:00
|
|
|
alt reply/author_name" />
|
2009-05-28 09:00:40 +02:00
|
|
|
</div>
|
2010-12-16 00:52:56 +01:00
|
|
|
|
2015-11-05 00:26:49 +01:00
|
|
|
<div class="documentByLine">
|
2010-09-29 10:13:54 +02:00
|
|
|
<tal:name>
|
|
|
|
<a href=""
|
|
|
|
tal:condition="has_author_link"
|
2012-01-30 13:30:46 +01:00
|
|
|
tal:content="reply/author_name"
|
2010-09-29 10:13:54 +02:00
|
|
|
tal:attributes="href author_home_url">
|
|
|
|
Poster Name
|
|
|
|
</a>
|
|
|
|
<span tal:condition="not: has_author_link"
|
2012-01-30 13:30:46 +01:00
|
|
|
tal:replace="reply/author_name" />
|
2012-09-19 11:55:55 +02:00
|
|
|
<span tal:condition="not: reply/author_name"
|
|
|
|
i18n:translate="label_anonymous">Anonymous</span>
|
2010-09-29 10:13:54 +02:00
|
|
|
</tal:name>
|
|
|
|
<tal:posted i18n:translate="label_says">says:</tal:posted>
|
2010-12-16 00:52:56 +01:00
|
|
|
<div class="commentDate"
|
2010-09-29 10:13:54 +02:00
|
|
|
tal:content="python:view.format_time(reply.modification_date)">
|
|
|
|
8/23/2001 12:40:44 PM
|
|
|
|
</div>
|
2009-05-26 09:24:52 +02:00
|
|
|
</div>
|
2010-12-16 00:52:56 +01:00
|
|
|
|
2010-09-29 10:13:54 +02:00
|
|
|
<div class="commentBody">
|
2010-12-16 00:52:56 +01:00
|
|
|
|
2011-04-02 21:51:37 +02:00
|
|
|
<span tal:replace="structure reply/getText" />
|
2010-12-16 00:52:56 +01:00
|
|
|
|
2010-09-29 10:13:54 +02:00
|
|
|
<div class="commentActions">
|
2012-05-07 13:02:07 +02:00
|
|
|
<form name="delete"
|
|
|
|
action=""
|
|
|
|
method="post"
|
2014-08-17 04:48:44 +02:00
|
|
|
class="commentactionsform"
|
2014-09-20 16:02:48 +02:00
|
|
|
tal:condition="python:not canDelete and isDeleteOwnCommentAllowed and view.could_delete_own(reply)"
|
2012-05-07 13:02:07 +02:00
|
|
|
tal:attributes="action string:${reply/absolute_url}/@@delete-own-comment;
|
|
|
|
style python:view.can_delete_own(reply) and 'display: inline' or 'display: none'">
|
|
|
|
<input name="form.button.DeleteComment"
|
|
|
|
class="destructive"
|
|
|
|
type="submit"
|
|
|
|
value="Delete"
|
|
|
|
i18n:attributes="value label_delete;"
|
|
|
|
/>
|
|
|
|
</form>
|
2010-09-29 10:13:54 +02:00
|
|
|
<form name="delete"
|
|
|
|
action=""
|
|
|
|
method="post"
|
2012-10-22 09:53:09 +02:00
|
|
|
class="commentactionsform"
|
2013-09-19 10:39:52 +02:00
|
|
|
tal:condition="python:canDelete"
|
2010-09-29 10:13:54 +02:00
|
|
|
tal:attributes="action string:${reply/absolute_url}/@@moderate-delete-comment">
|
|
|
|
<input name="form.button.DeleteComment"
|
|
|
|
class="destructive"
|
|
|
|
type="submit"
|
|
|
|
value="Delete"
|
|
|
|
i18n:attributes="value label_delete;"
|
|
|
|
/>
|
|
|
|
</form>
|
2010-12-16 00:52:56 +01:00
|
|
|
|
2015-05-30 22:20:32 +02:00
|
|
|
<tal:edit tal:condition="python:isEditCommentAllowed and canEdit">
|
|
|
|
<!-- plone 5 will have auth_token available
|
|
|
|
so we'll use modal pattern -->
|
2015-09-15 22:38:23 +02:00
|
|
|
<a class="commentactionsform pat-plone-modal context"
|
2015-05-30 22:20:32 +02:00
|
|
|
tal:condition="auth_token"
|
2016-04-07 18:36:19 +02:00
|
|
|
tal:attributes="href string:${reply/absolute_url}/@@edit-comment?_authenticator=${auth_token}"
|
|
|
|
i18n:translate="Edit">Edit</a>
|
2015-05-30 22:20:32 +02:00
|
|
|
<form name="edit"
|
|
|
|
action=""
|
|
|
|
method="get"
|
|
|
|
class="commentactionsform"
|
|
|
|
tal:condition="not: auth_token"
|
|
|
|
tal:attributes="action string:${reply/absolute_url}/@@edit-comment">
|
|
|
|
<input name="form.button.EditComment"
|
|
|
|
class="context"
|
|
|
|
type="submit"
|
|
|
|
value="Edit"
|
|
|
|
i18n:attributes="value label_edit;"
|
|
|
|
/>
|
|
|
|
</form>
|
|
|
|
</tal:edit>
|
2013-09-17 14:03:46 +02:00
|
|
|
|
2014-08-17 04:48:44 +02:00
|
|
|
|
2010-09-29 10:13:54 +02:00
|
|
|
<!-- Workflow actions (e.g. 'publish') -->
|
|
|
|
<form name=""
|
|
|
|
action=""
|
|
|
|
method="get"
|
2012-10-22 09:53:09 +02:00
|
|
|
class="commentactionsform"
|
2010-10-06 15:55:57 +02:00
|
|
|
tal:condition="canReview"
|
2010-09-29 10:13:54 +02:00
|
|
|
tal:repeat="action reply_dict/actions|nothing"
|
|
|
|
tal:attributes="action string:${reply/absolute_url}/@@moderate-publish-comment;
|
|
|
|
name action/id">
|
|
|
|
<input type="hidden" name="workflow_action" tal:attributes="value action/id" />
|
|
|
|
<input name="form.button.PublishComment"
|
|
|
|
class="context"
|
|
|
|
type="submit"
|
|
|
|
tal:attributes="value action/title"
|
|
|
|
i18n:attributes="value"
|
|
|
|
/>
|
|
|
|
</form>
|
|
|
|
</div>
|
2010-12-16 00:52:56 +01:00
|
|
|
|
2009-08-28 23:21:54 +02:00
|
|
|
|
|
|
|
</div>
|
2010-09-29 10:13:54 +02:00
|
|
|
<button class="context reply-to-comment-button hide allowMultiSubmit"
|
|
|
|
tal:condition="python:isDiscussionAllowed and (isAnon and isAnonymousDiscussionAllowed or userHasReplyPermission)"
|
|
|
|
i18n:translate="label_reply">
|
|
|
|
Reply
|
|
|
|
</button>
|
2009-05-25 21:24:21 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</tal:getreplies>
|
2012-01-25 15:55:36 +01:00
|
|
|
|
2011-01-07 16:27:17 +01:00
|
|
|
<div tal:condition="python: has_replies and not isDiscussionAllowed"
|
|
|
|
class="discreet"
|
|
|
|
i18n:translate="label_commenting_disabled">
|
|
|
|
Commenting has been disabled.
|
|
|
|
</div>
|
2012-01-25 15:55:36 +01:00
|
|
|
|
2009-05-25 21:24:21 +02:00
|
|
|
</div>
|
|
|
|
|
2009-05-28 13:39:36 +02:00
|
|
|
<div class="reply"
|
2010-10-05 14:07:08 +02:00
|
|
|
tal:condition="python:has_replies and (isAnon and not isAnonymousDiscussionAllowed)">
|
2009-05-28 13:39:36 +02:00
|
|
|
<form tal:attributes="action view/login_action">
|
2012-10-22 09:53:09 +02:00
|
|
|
<input class="standalone loginbutton"
|
2009-05-28 13:39:36 +02:00
|
|
|
type="submit"
|
|
|
|
value="Log in to add comments"
|
|
|
|
i18n:attributes="value label_login_to_add_comments;"
|
|
|
|
/>
|
|
|
|
</form>
|
|
|
|
</div>
|
2012-01-25 15:55:36 +01:00
|
|
|
|
2010-08-24 13:25:17 +02:00
|
|
|
<div id="commenting" class="reply" tal:condition="python:isDiscussionAllowed and (isAnon and isAnonymousDiscussionAllowed or userHasReplyPermission)">
|
2009-05-28 13:39:36 +02:00
|
|
|
|
2009-05-25 20:59:25 +02:00
|
|
|
<fieldset>
|
|
|
|
|
2010-08-06 17:33:34 +02:00
|
|
|
<legend i18n:translate="label_add_comment">Add comment</legend>
|
2010-11-29 23:42:20 +01:00
|
|
|
<p tal:content="view/comment_transform_message">
|
2009-05-25 20:59:25 +02:00
|
|
|
You can add a comment by filling out the form below. Plain text
|
|
|
|
formatting.
|
|
|
|
</p>
|
|
|
|
|
2010-06-18 14:19:33 +02:00
|
|
|
<div tal:replace="structure view/form/render" />
|
2009-05-25 20:59:25 +02:00
|
|
|
|
|
|
|
</fieldset>
|
|
|
|
</div>
|
|
|
|
|
2010-01-27 18:00:58 +01:00
|
|
|
</tal:block>
|