plone.app.discussion/plone/app/discussion/browser/comments.pt

159 lines
7.4 KiB
Plaintext
Raw Normal View History

<tal:block tal:define="isDiscussionAllowed view/is_discussion_allowed"
tal:condition="isDiscussionAllowed"
i18n:domain="plone">
<tal:block define="userHasReplyPermission view/can_reply;
isAnonymousDiscussionAllowed view/anonymous_discussion_allowed;
isAnon view/is_anonymous;
canManage view/can_manage;
replies python:view.get_replies(canManage);
has_replies python:view.has_replies(canManage);
showCommenterImage view/show_commenter_image;
errors options/state/getErrors|nothing;
wtool context/@@plone_tools/workflow;">
<div class="reply"
tal:condition="python:isAnon and not isAnonymousDiscussionAllowed">
<form tal:attributes="action view/login_action">
<input class="standalone"
style="margin-bottom: 1.25em;"
type="submit"
value="Log in to add comments"
i18n:attributes="value label_login_to_add_comments;"
/>
</form>
</div>
<div class="discussion"
tal:attributes="class python: showCommenterImage and 'discussion showCommenterImage' or 'discussion';"
tal:condition="python:replies or (userHasReplyPermission and isDiscussionAllowed) or (isAnon and not userHasReplyPermission and isDiscussionAllowed)">
<tal:getreplies repeat="reply_dict replies">
<div class="comment"
tal:define="reply reply_dict/comment;
depth reply_dict/depth|python:0;
author_home_url python:view.get_commenter_home_url(username=reply.author_username);
has_author_link python:author_home_url and not isAnon;
portrait_url python:view.get_commenter_portrait(reply.author_username);
review_state python:wtool.getInfoFor(reply, 'review_state');"
tal:attributes="class python:'comment replyTreeLevel'+str(depth)+' state-'+str(review_state);
style string:margin-left: ${depth}em;
id string:${reply/getId}"
tal:condition="python:canManage or review_state == 'published'">
<div class="commentImage" tal:condition="showCommenterImage">
<a href="" tal:condition="has_author_link"
tal:attributes="href author_home_url">
<img src="defaultUser.gif"
alt=""
border="0"
width="75"
tal:attributes="src portrait_url;
alt reply/Creator" />
</a>
<img src="defaultUser.gif"
alt=""
border="0"
width="75"
tal:condition="not: has_author_link"
tal:attributes="src portrait_url;
alt reply/Creator" />
</div>
<h3 class="commentTitle"
tal:content="reply/Title" />
<div class="documentByLine">
<tal:posted i18n:translate="label_comment_by">Posted by</tal:posted>
<tal:name>
<a href=""
tal:condition="has_author_link"
tal:content="reply/Creator"
tal:attributes="href author_home_url">
Poster Name
</a>
<span tal:condition="not: has_author_link"
tal:replace="reply/Creator" />
</tal:name>
<tal:name i18n:translate="label_anonymous_user"
condition="python:reply.Creator() in ('Anonymous User', '', None)">Anonymous User</tal:name>
<tal:at i18n:translate="label_commented_at">at</tal:at>
<span tal:replace="python:view.format_time(reply.modification_date)">8/23/2001 12:40:44 PM</span>
</div>
<div class="commentBody"
tal:content="reply/getText" />
<div class="commentActions">
<button class="context reply-to-comment-button hide allowMultiSubmit"
tal:condition="python:userHasReplyPermission and isDiscussionAllowed or isAnonymousDiscussionAllowed"
i18n:translate="label_reply">
Reply
</button>
<form name="delete"
action=""
method="post"
style="display: inline;"
tal:condition="view/can_manage"
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>
<!-- Workflow actions (e.g. 'publish') -->
<form name=""
action=""
method="get"
style="display: inline;"
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>
</div>
</tal:getreplies>
</div>
<div class="reply"
tal:condition="python: isAnon and not isAnonymousDiscussionAllowed and has_replies">
<form tal:attributes="action view/login_action">
<input class="standalone"
style="margin-bottom: 1.25em;"
type="submit"
value="Log in to add comments"
i18n:attributes="value label_login_to_add_comments;"
/>
</form>
</div>
<div id="commenting" class="reply" tal:condition="python: isAnon and isAnonymousDiscussionAllowed or not isAnon">
<fieldset>
<legend i18n:translate="legend_add_comment">Add comment</legend>
<p i18n:translate="description_add_comment">
You can add a comment by filling out the form below. Plain text
formatting.
</p>
<div tal:replace="structure view/form/render" />
</fieldset>
</div>
</tal:block>
</tal:block>