| 1 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" |
|---|
| 2 | i18n:domain="plone"> |
|---|
| 3 | |
|---|
| 4 | <body> |
|---|
| 5 | |
|---|
| 6 | <div metal:define-macro="discussionView" |
|---|
| 7 | tal:omit-tag="" |
|---|
| 8 | tal:define="userHasReplyPermission python:checkPermission('Reply to item', here); |
|---|
| 9 | portal_discussion portal/portal_discussion; |
|---|
| 10 | isDiscussionAllowed python:portal_discussion.isDiscussionAllowedFor(here); |
|---|
| 11 | "> |
|---|
| 12 | |
|---|
| 13 | <tal:allowed condition="isViewTemplate" tal:define="replies python:here.getReplyReplies(here)"> |
|---|
| 14 | <div class="discussion" |
|---|
| 15 | tal:condition="python:replies or (userHasReplyPermission and isDiscussionAllowed) or (isAnon and not userHasReplyPermission and isDiscussionAllowed)"> |
|---|
| 16 | <form name="reply" |
|---|
| 17 | action="" |
|---|
| 18 | method="post" |
|---|
| 19 | tal:condition="python:userHasReplyPermission and isDiscussionAllowed" |
|---|
| 20 | tal:attributes="action string:$here_url/discussion_reply_form#discussion"> |
|---|
| 21 | |
|---|
| 22 | <input class="standalone" |
|---|
| 23 | style="margin-bottom: 1.25em;" |
|---|
| 24 | type="submit" |
|---|
| 25 | value="Add Comment" |
|---|
| 26 | i18n:attributes="value label_add_comment;" |
|---|
| 27 | /> |
|---|
| 28 | </form> |
|---|
| 29 | <form tal:condition="python:isAnon and not userHasReplyPermission and isDiscussionAllowed" |
|---|
| 30 | tal:define="pss modules/Products/PythonScripts/standard" |
|---|
| 31 | tal:attributes="action python:'%s/login_form?came_from=%s' % |
|---|
| 32 | (here.portal_url(), |
|---|
| 33 | pss.url_quote(request['URL']))"> |
|---|
| 34 | <input class="standalone" |
|---|
| 35 | style="margin-bottom: 1.25em;" |
|---|
| 36 | type="submit" |
|---|
| 37 | value="Log in to add comments" |
|---|
| 38 | i18n:attributes="value label_login_to_add_comments;" |
|---|
| 39 | /> |
|---|
| 40 | </form> |
|---|
| 41 | |
|---|
| 42 | <tal:getreplies repeat="reply_dict replies" |
|---|
| 43 | define="ifModerate python:here.portal_properties.qPloneComments.getProperty('enable_moderation', None);"> |
|---|
| 44 | <div class="comment" style="" |
|---|
| 45 | tal:condition="python:checkPermission('Moderate Discussion', here) or isPublished" |
|---|
| 46 | tal:define="indent python:reply_dict['depth']*2; |
|---|
| 47 | reply python:reply_dict['object']; |
|---|
| 48 | isPublished python:reply.review_state=='published';" |
|---|
| 49 | tal:attributes="style string:margin-left:${indent}em;"> |
|---|
| 50 | |
|---|
| 51 | <h3> |
|---|
| 52 | <a name="comments" tal:attributes="name reply/id"> |
|---|
| 53 | <span tal:replace="reply/pretty_title_or_id">Comment title</span> |
|---|
| 54 | </a> |
|---|
| 55 | </h3> |
|---|
| 56 | <div class="documentByLine" |
|---|
| 57 | tal:define="creator reply/Creator; |
|---|
| 58 | anonymous_creator python:creator=='Anonymous User'; |
|---|
| 59 | mi python:not anonymous_creator and mtool.getMemberInfo(creator); |
|---|
| 60 | fullname python: mi and mi['fullname'] or creator;" > |
|---|
| 61 | <span i18n:translate="label_comment_by">Posted by</span> |
|---|
| 62 | <span tal:content="fullname" |
|---|
| 63 | tal:condition="not:anonymous_creator">Poster Name</span> |
|---|
| 64 | <span i18n:translate="label_anonymous_user" |
|---|
| 65 | tal:condition="anonymous_creator">Anonymous User</span> |
|---|
| 66 | <span i18n:translate="label_commented_at">at</span> |
|---|
| 67 | <span tal:replace="python:toLocalizedTime(reply.ModificationDate(), |
|---|
| 68 | long_format=1)">8/23/2001 12:40:44 PM</span> |
|---|
| 69 | <span tal:condition="python:ifModerate and not isPublished">[pending]</span> |
|---|
| 70 | </div> |
|---|
| 71 | <div class="commentBody" |
|---|
| 72 | tal:content="structure reply/CookedBody"> |
|---|
| 73 | This is the body text of the comment. |
|---|
| 74 | </div> |
|---|
| 75 | <form name="reply" |
|---|
| 76 | action="discussion_reply_form" |
|---|
| 77 | method="post" |
|---|
| 78 | style="display: inline;" |
|---|
| 79 | tal:attributes="action string:${reply/absolute_url}/discussion_reply_form" |
|---|
| 80 | tal:condition="python:userHasReplyPermission and isPublished"> |
|---|
| 81 | <input class="standalone" |
|---|
| 82 | type="submit" |
|---|
| 83 | value="Reply" |
|---|
| 84 | i18n:domain="plonecomments" |
|---|
| 85 | i18n:attributes="value label_reply;" |
|---|
| 86 | /> |
|---|
| 87 | </form> |
|---|
| 88 | <form name="delete" |
|---|
| 89 | action="" |
|---|
| 90 | method="post" |
|---|
| 91 | style="display: inline;" |
|---|
| 92 | tal:condition="python:checkPermission('Moderate Discussion', here)" |
|---|
| 93 | tal:attributes="action string:${reply/absolute_url}/deleteDiscussion"> |
|---|
| 94 | <input class="destructive" |
|---|
| 95 | type="submit" |
|---|
| 96 | value="Remove" |
|---|
| 97 | i18n:attributes="value label_remove;" |
|---|
| 98 | /> |
|---|
| 99 | </form> |
|---|
| 100 | <form name="publish_discussion" |
|---|
| 101 | action="" |
|---|
| 102 | method="post" |
|---|
| 103 | style="display: inline;" |
|---|
| 104 | tal:condition="not:isPublished" |
|---|
| 105 | tal:attributes="action string:${reply/absolute_url}/discussion_publish_comment"> |
|---|
| 106 | |
|---|
| 107 | <input class="standalone" |
|---|
| 108 | type="submit" |
|---|
| 109 | value="Publish" |
|---|
| 110 | i18n:attributes="value" |
|---|
| 111 | /> |
|---|
| 112 | </form> |
|---|
| 113 | <br/> |
|---|
| 114 | <div class="documentByLine" |
|---|
| 115 | i18n:translate="text_no_add_reply" |
|---|
| 116 | i18n:domain="plonecomments" |
|---|
| 117 | tal:condition="not:isPublished">Comment must be approved before replies to comment accepted.</div> |
|---|
| 118 | |
|---|
| 119 | </div> |
|---|
| 120 | </tal:getreplies> |
|---|
| 121 | </div> |
|---|
| 122 | </tal:allowed> |
|---|
| 123 | </div> |
|---|
| 124 | </body> |
|---|
| 125 | </html> |
|---|