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