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