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:attributes="value label_reply;" |
---|
85 | /> |
---|
86 | </form> |
---|
87 | <form name="delete" |
---|
88 | action="" |
---|
89 | method="post" |
---|
90 | style="display: inline;" |
---|
91 | tal:condition="python:checkPermission('Moderate Discussion', here)" |
---|
92 | tal:attributes="action string:${reply/absolute_url}/deleteDiscussion"> |
---|
93 | <input class="destructive" |
---|
94 | type="submit" |
---|
95 | value="Remove" |
---|
96 | i18n:attributes="value label_remove;" |
---|
97 | /> |
---|
98 | </form> |
---|
99 | <form name="publish_discussion" |
---|
100 | action="" |
---|
101 | method="post" |
---|
102 | style="display: inline;" |
---|
103 | tal:condition="not:isPublished" |
---|
104 | tal:attributes="action string:${reply/absolute_url}/discussion_publish_comment"> |
---|
105 | |
---|
106 | <input class="standalone" |
---|
107 | type="submit" |
---|
108 | value="Publish" |
---|
109 | i18n:attributes="value" |
---|
110 | /> |
---|
111 | </form> |
---|
112 | <br/> |
---|
113 | <div class="documentByLine" |
---|
114 | i18n:translate="text_no_add_reply" |
---|
115 | i18n:domain="quintagroup.plonecomments" |
---|
116 | tal:condition="not:isPublished">Comment must be approved before replies to comment accepted.</div> |
---|
117 | |
---|
118 | </div> |
---|
119 | </tal:getreplies> |
---|
120 | </div> |
---|
121 | </tal:allowed> |
---|
122 | </div> |
---|
123 | </body> |
---|
124 | </html> |
---|