[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; |
---|
[326] | 6 | isModerationAllowed view/can_moderate" |
---|
| 7 | i18n:domain="plone"> |
---|
[1] | 8 | <div class="discussion" |
---|
| 9 | tal:condition="python:replies or (userHasReplyPermission and isDiscussionAllowed) or (isAnon and not userHasReplyPermission and isDiscussionAllowed)"> |
---|
| 10 | <form name="reply" |
---|
| 11 | action="" |
---|
| 12 | method="post" |
---|
| 13 | tal:condition="python:userHasReplyPermission and isDiscussionAllowed" |
---|
| 14 | tal:attributes="action string:${context/absolute_url}/discussion_reply_form#discussion"> |
---|
| 15 | |
---|
| 16 | <input class="standalone" |
---|
| 17 | style="margin-bottom: 1.25em;" |
---|
| 18 | type="submit" |
---|
| 19 | value="Add Comment" |
---|
| 20 | i18n:attributes="value label_add_comment;" |
---|
| 21 | /> |
---|
| 22 | </form> |
---|
| 23 | <form tal:condition="python:isAnon and not userHasReplyPermission and isDiscussionAllowed" |
---|
| 24 | tal:attributes="action view/login_action"> |
---|
| 25 | <input class="standalone" |
---|
| 26 | style="margin-bottom: 1.25em;" |
---|
| 27 | type="submit" |
---|
| 28 | value="Log in to add comments" |
---|
| 29 | i18n:attributes="value label_login_to_add_comments;" |
---|
| 30 | /> |
---|
| 31 | </form> |
---|
| 32 | |
---|
| 33 | <tal:getreplies repeat="reply_dict replies"> |
---|
| 34 | <div class="comment" style="" |
---|
| 35 | tal:condition="python:isModerationAllowed or isPublished" |
---|
| 36 | tal:define="indent python:reply_dict['depth']*2; |
---|
| 37 | reply python:reply_dict['object']; |
---|
| 38 | isPublished python:reply.review_state=='published';" |
---|
| 39 | tal:attributes="style string:margin-left:${indent}em;"> |
---|
[89] | 40 | |
---|
[1] | 41 | <h3> |
---|
| 42 | <a name="comments" tal:attributes="name reply/id"> |
---|
| 43 | <span tal:replace="reply/pretty_title_or_id">Comment title</span> |
---|
| 44 | </a> |
---|
| 45 | </h3> |
---|
| 46 | <div class="documentByLine" |
---|
| 47 | tal:define="creator reply/Creator; |
---|
| 48 | anonymous_creator python:creator=='Anonymous User'; |
---|
| 49 | mi python:not anonymous_creator and view.member_info(creator); |
---|
| 50 | fullname python: mi and mi['fullname'] or creator;" > |
---|
| 51 | <span i18n:translate="label_comment_by">Posted by</span> |
---|
| 52 | <span tal:content="fullname" |
---|
| 53 | tal:condition="not:anonymous_creator">Poster Name</span> |
---|
| 54 | <span i18n:translate="label_anonymous_user" |
---|
| 55 | tal:condition="anonymous_creator">Anonymous User</span> |
---|
[89] | 56 | <span i18n:translate="label_commented_at">at</span> |
---|
[1] | 57 | <span tal:replace="python:view.format_time(reply.ModificationDate())">8/23/2001 12:40:44 PM</span> |
---|
| 58 | <span tal:condition="python:ifModerate and not isPublished">[pending]</span> |
---|
| 59 | </div> |
---|
| 60 | <div class="commentBody" |
---|
| 61 | tal:content="structure reply/CookedBody"> |
---|
| 62 | This is the body text of the comment. |
---|
| 63 | </div> |
---|
| 64 | <form name="reply" |
---|
| 65 | action="discussion_reply_form" |
---|
| 66 | method="post" |
---|
| 67 | style="display: inline;" |
---|
| 68 | tal:attributes="action string:${reply/absolute_url}/discussion_reply_form" |
---|
| 69 | tal:condition="python:userHasReplyPermission and isPublished"> |
---|
| 70 | <input class="standalone" |
---|
| 71 | type="submit" |
---|
| 72 | value="Reply" |
---|
| 73 | i18n:domain="plonecomments" |
---|
| 74 | i18n:attributes="value label_reply;" |
---|
| 75 | /> |
---|
| 76 | </form> |
---|
| 77 | <form name="delete" |
---|
| 78 | action="" |
---|
| 79 | method="post" |
---|
| 80 | style="display: inline;" |
---|
| 81 | tal:condition="isModerationAllowed" |
---|
| 82 | tal:attributes="action string:${reply/absolute_url}/deleteDiscussion"> |
---|
| 83 | <input class="destructive" |
---|
| 84 | type="submit" |
---|
| 85 | value="Remove" |
---|
| 86 | i18n:attributes="value label_remove;" |
---|
| 87 | /> |
---|
| 88 | </form> |
---|
| 89 | <form name="publish_discussion" |
---|
| 90 | action="" |
---|
| 91 | method="post" |
---|
| 92 | style="display: inline;" |
---|
| 93 | tal:condition="not:isPublished" |
---|
| 94 | tal:attributes="action string:${reply/absolute_url}/discussion_publish_comment"> |
---|
| 95 | |
---|
| 96 | <input class="standalone" |
---|
| 97 | type="submit" |
---|
| 98 | value="Publish" |
---|
| 99 | i18n:attributes="value" |
---|
| 100 | /> |
---|
| 101 | </form> |
---|
| 102 | <br/> |
---|
| 103 | <div class="documentByLine" |
---|
| 104 | i18n:translate="text_no_add_reply" |
---|
| 105 | i18n:domain="plonecomments" |
---|
| 106 | tal:condition="not:isPublished">Comment must be approved before replies to comment accepted.</div> |
---|
| 107 | |
---|
| 108 | </div> |
---|
| 109 | </tal:getreplies> |
---|
| 110 | </div> |
---|
[89] | 111 | </tal:block> |
---|