[1] | 1 | <tal:block define="userHasReplyPermission view/can_reply; |
---|
| 2 | isDiscussionAllowed view/is_discussion_allowed; |
---|
| 3 | replies view/get_replies; |
---|
| 4 | isAnon view/is_anonymous; |
---|
| 5 | ifModerate view/is_moderation_enabled; |
---|
[910] | 6 | isModerationAllowed view/can_moderate; |
---|
[933] | 7 | isAuthenticatedReportAbuseEnabled view/authenticated_report_abuse_enabled; |
---|
| 8 | isAjaxReportAbuseEnabled view/ajax_report_abuse_enabled; |
---|
| 9 | isAnonymousReportAbuseEnabled view/anonymous_report_abuse_enabled; |
---|
| 10 | isReportAbuseEnabled python:isAnonymousReportAbuseEnabled or not isAnon and isAuthenticatedReportAbuseEnabled" |
---|
[326] | 11 | i18n:domain="plone"> |
---|
[1] | 12 | <div class="discussion" |
---|
| 13 | tal:condition="python:replies or (userHasReplyPermission and isDiscussionAllowed) or (isAnon and not userHasReplyPermission and isDiscussionAllowed)"> |
---|
| 14 | <form name="reply" |
---|
| 15 | action="" |
---|
| 16 | method="post" |
---|
| 17 | tal:condition="python:userHasReplyPermission and isDiscussionAllowed" |
---|
| 18 | tal:attributes="action string:${context/absolute_url}/discussion_reply_form#discussion"> |
---|
| 19 | |
---|
| 20 | <input class="standalone" |
---|
| 21 | style="margin-bottom: 1.25em;" |
---|
| 22 | type="submit" |
---|
| 23 | value="Add Comment" |
---|
| 24 | i18n:attributes="value label_add_comment;" |
---|
| 25 | /> |
---|
| 26 | </form> |
---|
| 27 | <form tal:condition="python:isAnon and not userHasReplyPermission and isDiscussionAllowed" |
---|
| 28 | tal:attributes="action view/login_action"> |
---|
| 29 | <input class="standalone" |
---|
| 30 | style="margin-bottom: 1.25em;" |
---|
| 31 | type="submit" |
---|
| 32 | value="Log in to add comments" |
---|
| 33 | i18n:attributes="value label_login_to_add_comments;" |
---|
| 34 | /> |
---|
| 35 | </form> |
---|
| 36 | |
---|
| 37 | <tal:getreplies repeat="reply_dict replies"> |
---|
| 38 | <div class="comment" style="" |
---|
| 39 | tal:condition="python:isModerationAllowed or isPublished" |
---|
| 40 | tal:define="indent python:reply_dict['depth']*2; |
---|
| 41 | reply python:reply_dict['object']; |
---|
[910] | 42 | comment_id python:reply_dict['object'].id; |
---|
[1] | 43 | isPublished python:reply.review_state=='published';" |
---|
| 44 | tal:attributes="style string:margin-left:${indent}em;"> |
---|
[89] | 45 | |
---|
[1] | 46 | <h3> |
---|
| 47 | <a name="comments" tal:attributes="name reply/id"> |
---|
| 48 | <span tal:replace="reply/pretty_title_or_id">Comment title</span> |
---|
| 49 | </a> |
---|
| 50 | </h3> |
---|
| 51 | <div class="documentByLine" |
---|
| 52 | tal:define="creator reply/Creator; |
---|
| 53 | anonymous_creator python:creator=='Anonymous User'; |
---|
| 54 | mi python:not anonymous_creator and view.member_info(creator); |
---|
[552] | 55 | fullname python: mi and mi['fullname'] or creator; |
---|
[553] | 56 | gavatar_src python:view.getGravatar(reply)" > |
---|
[552] | 57 | <img alt="Avatar" class="avatar" height="40" width="40" |
---|
| 58 | src="http://default.gavatar.gif" |
---|
| 59 | tal:attributes="src gavatar_src"> |
---|
[1] | 60 | <span i18n:translate="label_comment_by">Posted by</span> |
---|
| 61 | <span tal:content="fullname" |
---|
| 62 | tal:condition="not:anonymous_creator">Poster Name</span> |
---|
| 63 | <span i18n:translate="label_anonymous_user" |
---|
| 64 | tal:condition="anonymous_creator">Anonymous User</span> |
---|
[89] | 65 | <span i18n:translate="label_commented_at">at</span> |
---|
[1] | 66 | <span tal:replace="python:view.format_time(reply.ModificationDate())">8/23/2001 12:40:44 PM</span> |
---|
| 67 | <span tal:condition="python:ifModerate and not isPublished">[pending]</span> |
---|
| 68 | </div> |
---|
| 69 | <div class="commentBody" |
---|
| 70 | tal:content="structure reply/CookedBody"> |
---|
| 71 | This is the body text of the comment. |
---|
| 72 | </div> |
---|
| 73 | <form name="reply" |
---|
| 74 | action="discussion_reply_form" |
---|
| 75 | method="post" |
---|
| 76 | style="display: inline;" |
---|
| 77 | tal:attributes="action string:${reply/absolute_url}/discussion_reply_form" |
---|
| 78 | tal:condition="python:userHasReplyPermission and isPublished"> |
---|
| 79 | <input class="standalone" |
---|
| 80 | type="submit" |
---|
| 81 | value="Reply" |
---|
| 82 | i18n:attributes="value label_reply;" |
---|
| 83 | /> |
---|
| 84 | </form> |
---|
| 85 | <form name="delete" |
---|
| 86 | action="" |
---|
| 87 | method="post" |
---|
| 88 | style="display: inline;" |
---|
| 89 | tal:condition="isModerationAllowed" |
---|
| 90 | tal:attributes="action string:${reply/absolute_url}/deleteDiscussion"> |
---|
| 91 | <input class="destructive" |
---|
| 92 | type="submit" |
---|
| 93 | value="Remove" |
---|
| 94 | i18n:attributes="value label_remove;" |
---|
| 95 | /> |
---|
| 96 | </form> |
---|
[910] | 97 | <tal:if tal:condition="python:isReportAbuseEnabled and isPublished"> |
---|
[919] | 98 | <form class="report_abuse" |
---|
| 99 | name="report_abuse" |
---|
| 100 | method="post" |
---|
[938] | 101 | style="display: inline;" |
---|
| 102 | tal:attributes="action string:${reply/absolute_url}/report_abuse_form#discussion"> |
---|
[919] | 103 | <input type="hidden" name="comment_id" tal:attributes="value comment_id" /> |
---|
| 104 | <input class="standalone" |
---|
| 105 | type="submit" |
---|
| 106 | value="Report Abuse" |
---|
[933] | 107 | tal:define="onclick string:javascript:render_abuse_report_form(${comment_id})" |
---|
| 108 | tal:attributes="onclick python:isAjaxReportAbuseEnabled and onclick or ''; |
---|
[919] | 109 | id string:input-render-abuse-cancel-${comment_id}" |
---|
| 110 | i18n:attributes="value label_report_abuse;" |
---|
| 111 | /> |
---|
| 112 | </form> |
---|
[938] | 113 | <span tal:attributes="id string:span-reply-form-holder-${comment_id}" |
---|
| 114 | tal:condition="isReportAbuseEnabled"> |
---|
| 115 | <metal:macro use-macro="here/report_abuse_form/macros/form"/> |
---|
| 116 | </span> |
---|
| 117 | <span tal:attributes="id string:span-abuse-count-holder-${comment_id}"></span> |
---|
[910] | 118 | </tal:if> |
---|
[1] | 119 | <form name="publish_discussion" |
---|
| 120 | action="" |
---|
| 121 | method="post" |
---|
| 122 | style="display: inline;" |
---|
| 123 | tal:condition="not:isPublished" |
---|
| 124 | tal:attributes="action string:${reply/absolute_url}/discussion_publish_comment"> |
---|
| 125 | |
---|
| 126 | <input class="standalone" |
---|
| 127 | type="submit" |
---|
| 128 | value="Publish" |
---|
| 129 | i18n:attributes="value" |
---|
| 130 | /> |
---|
| 131 | </form> |
---|
| 132 | <br/> |
---|
| 133 | <div class="documentByLine" |
---|
| 134 | i18n:translate="text_no_add_reply" |
---|
| 135 | i18n:domain="plonecomments" |
---|
| 136 | tal:condition="not:isPublished">Comment must be approved before replies to comment accepted.</div> |
---|
| 137 | </div> |
---|
| 138 | </tal:getreplies> |
---|
| 139 | </div> |
---|
[89] | 140 | </tal:block> |
---|