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; |
---|
6 | isModerationAllowed view/can_moderate" |
---|
7 | i18n:domain="plone"> |
---|
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;"> |
---|
40 | |
---|
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 | gavatar_src python:view.getGravatar(reply)" > |
---|
52 | <img alt="Avatar" class="avatar" height="40" width="40" |
---|
53 | src="http://default.gavatar.gif" |
---|
54 | tal:attributes="src gavatar_src"> |
---|
55 | <span i18n:translate="label_comment_by">Posted by</span> |
---|
56 | <span tal:content="fullname" |
---|
57 | tal:condition="not:anonymous_creator">Poster Name</span> |
---|
58 | <span i18n:translate="label_anonymous_user" |
---|
59 | tal:condition="anonymous_creator">Anonymous User</span> |
---|
60 | <span i18n:translate="label_commented_at">at</span> |
---|
61 | <span tal:replace="python:view.format_time(reply.ModificationDate())">8/23/2001 12:40:44 PM</span> |
---|
62 | <span tal:condition="python:ifModerate and not isPublished">[pending]</span> |
---|
63 | </div> |
---|
64 | <div class="commentBody" |
---|
65 | tal:content="structure reply/CookedBody"> |
---|
66 | This is the body text of the comment. |
---|
67 | </div> |
---|
68 | <form name="reply" |
---|
69 | action="discussion_reply_form" |
---|
70 | method="post" |
---|
71 | style="display: inline;" |
---|
72 | tal:attributes="action string:${reply/absolute_url}/discussion_reply_form" |
---|
73 | tal:condition="python:userHasReplyPermission and isPublished"> |
---|
74 | <input class="standalone" |
---|
75 | type="submit" |
---|
76 | value="Reply" |
---|
77 | i18n:domain="plonecomments" |
---|
78 | i18n:attributes="value label_reply;" |
---|
79 | /> |
---|
80 | </form> |
---|
81 | <form name="delete" |
---|
82 | action="" |
---|
83 | method="post" |
---|
84 | style="display: inline;" |
---|
85 | tal:condition="isModerationAllowed" |
---|
86 | tal:attributes="action string:${reply/absolute_url}/deleteDiscussion"> |
---|
87 | <input class="destructive" |
---|
88 | type="submit" |
---|
89 | value="Remove" |
---|
90 | i18n:attributes="value label_remove;" |
---|
91 | /> |
---|
92 | </form> |
---|
93 | <form name="publish_discussion" |
---|
94 | action="" |
---|
95 | method="post" |
---|
96 | style="display: inline;" |
---|
97 | tal:condition="not:isPublished" |
---|
98 | tal:attributes="action string:${reply/absolute_url}/discussion_publish_comment"> |
---|
99 | |
---|
100 | <input class="standalone" |
---|
101 | type="submit" |
---|
102 | value="Publish" |
---|
103 | i18n:attributes="value" |
---|
104 | /> |
---|
105 | </form> |
---|
106 | <br/> |
---|
107 | <div class="documentByLine" |
---|
108 | i18n:translate="text_no_add_reply" |
---|
109 | i18n:domain="plonecomments" |
---|
110 | tal:condition="not:isPublished">Comment must be approved before replies to comment accepted.</div> |
---|
111 | |
---|
112 | </div> |
---|
113 | </tal:getreplies> |
---|
114 | </div> |
---|
115 | </tal:block> |
---|