1 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" |
---|
2 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
---|
3 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
---|
4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
---|
5 | metal:use-macro="here/main_template/macros/master" |
---|
6 | i18n:domain="plone"> |
---|
7 | <body> |
---|
8 | |
---|
9 | <metal:block fill-slot="top_slot" |
---|
10 | tal:define="dummy python:request.set('disable_border',1)" /> |
---|
11 | |
---|
12 | <metal:block fill-slot="sub" /> |
---|
13 | |
---|
14 | <div metal:fill-slot="main" |
---|
15 | tal:define="errors options/state/getErrors; |
---|
16 | putils context/plone_utils; |
---|
17 | portal context/@@plone_portal_state/portal; |
---|
18 | toLocalizedTime nocall:context/@@plone/toLocalizedTime; |
---|
19 | here_url context/@@plone_context_state/object_url; |
---|
20 | template_id template/getId; |
---|
21 | isAnon context/@@plone_portal_state/anonymous|string:False; |
---|
22 | member context/@@plone_portal_state/member; |
---|
23 | thread python:putils.getDiscussionThread(here); |
---|
24 | discussable python:thread[0]; |
---|
25 | replies python:thread[1:]; |
---|
26 | props_sheet here/portal_properties/qPloneComments; |
---|
27 | require_email python:props_sheet.getProperty('require_email')"> |
---|
28 | |
---|
29 | <tal:discussable define="template python:getattr(here, discussable.getLayout(), None); |
---|
30 | macros template/macros | nothing; |
---|
31 | main_macro macros/main | nothing; |
---|
32 | showDiscussable python:main_macro;"> |
---|
33 | |
---|
34 | <div class="comment" |
---|
35 | tal:condition="showDiscussable" |
---|
36 | tal:define="here python:discussable"> |
---|
37 | <div metal:use-macro="main_macro"/> |
---|
38 | </div> |
---|
39 | </tal:discussable> |
---|
40 | |
---|
41 | <tal:thread tal:repeat="reply replies"> |
---|
42 | <tal:block tal:define="level repeat/reply/index"> |
---|
43 | <div class="comment" |
---|
44 | tal:attributes="style python:'margin-left:'+str((int(level)+1)*2)+'em'"> |
---|
45 | <h3> |
---|
46 | <tal:block replace="structure portal/discussionitem_icon.gif"/> |
---|
47 | <span tal:replace="reply/pretty_title_or_id">Comment title</span> |
---|
48 | </h3> |
---|
49 | <div class="documentByLine" |
---|
50 | tal:define="anonymous_creator python:reply.Creator()=='Anonymous User'"> |
---|
51 | <span i18n:domain="quintagroup.plonecomments" |
---|
52 | i18n:translate="label_comment_by">Posted by</span> |
---|
53 | <span tal:content="reply/Creator" |
---|
54 | tal:condition="not:anonymous_creator">Poster Name</span> |
---|
55 | <span i18n:translate="label_anonymous_user" |
---|
56 | tal:condition="anonymous_creator">Anonymous User</span> |
---|
57 | <span i18n:domain="quintagroup.plonecomments" |
---|
58 | i18n:translate="label_commented_at">at</span> |
---|
59 | <span tal:replace="python:toLocalizedTime(reply.ModificationDate(), |
---|
60 | long_format=1)">8/23/2001 12:40:44 PM</span> |
---|
61 | </div> |
---|
62 | <div class="commentBody" |
---|
63 | tal:content="structure reply/CookedBody"> |
---|
64 | This is the body text of the comment. |
---|
65 | </div> |
---|
66 | </div> |
---|
67 | |
---|
68 | </tal:block> |
---|
69 | </tal:thread> |
---|
70 | |
---|
71 | <a name="discussion"></a> |
---|
72 | <form name="edit_form" |
---|
73 | class="enableAutoFocus" |
---|
74 | method="post" |
---|
75 | action="talkback" |
---|
76 | tal:attributes="action string:$here_url/$template_id" |
---|
77 | tal:define="isForAnonymous python:here.portal_properties.qPloneComments.getProperty('enable_anonymous_commenting', 0)"> |
---|
78 | |
---|
79 | <tal:set define="show_form python:True; |
---|
80 | comment_id context/id"> |
---|
81 | <metal:macro define-macro="form" |
---|
82 | tal:define="visible show_form|request/show_form|nothing; |
---|
83 | portal_url portal_url|view/portal_url; |
---|
84 | isAnon isAnon|context/@@plone_portal_state/anonymous; |
---|
85 | member member|context/@@plone_portal_state/member;"> |
---|
86 | |
---|
87 | <span tal:define="email_from_address portal/email_from_address|view/email_from_address; |
---|
88 | comment_id comment_id|request/comment_id" |
---|
89 | tal:attributes="style python:not visible and 'display: none' or ''; |
---|
90 | id string:span-reply-form-${comment_id}"> |
---|
91 | |
---|
92 | <tal:if_not condition="not:email_from_address"> |
---|
93 | <p class="documentDescription" |
---|
94 | i18n:domain="quintagroup.plonecomments" |
---|
95 | i18n:translate="text_no_email_setup"> |
---|
96 | This site doesn't have a valid email setup, so you cannot use |
---|
97 | the report abuse form. |
---|
98 | </p> |
---|
99 | </tal:if_not> |
---|
100 | <tal:if condition="email_from_address"> |
---|
101 | <form name="feedback_form" |
---|
102 | method="post" |
---|
103 | class="enableAutoFocus" |
---|
104 | tal:attributes="action string:${here/absolute_url}/${template/id}" |
---|
105 | tal:define="errors errors|request/errors|python:{}" > |
---|
106 | |
---|
107 | <input type="hidden" name="comment_id" tal:attributes="value comment_id" /> |
---|
108 | |
---|
109 | <fieldset> |
---|
110 | <h1 i18n:domain="quintagroup.plonecomments" i18n:translate="heading_report_abuse_form">Report Abuse</h1> |
---|
111 | |
---|
112 | <tal:feedbackForm condition="isAnon"> |
---|
113 | <input type="hidden" name="Creator" tal:condition="not:isAnon" tal:attributes="value member/getUserName" /> |
---|
114 | |
---|
115 | <div class="field" |
---|
116 | tal:define="error errors/creator|nothing" |
---|
117 | tal:attributes="class python:error and 'field error' or 'field'" |
---|
118 | i18n:domain="plone"> |
---|
119 | <label for="creator" i18n:translate="label_name"> |
---|
120 | Name |
---|
121 | </label> |
---|
122 | <span class="fieldRequired" title="Required" |
---|
123 | i18n:attributes="title title_required;" |
---|
124 | i18n:translate="label_required">(Required)</span> |
---|
125 | <div class="formHelp" i18n:translate="help_name" i18n:domain="quintagroup.plonecomments"> |
---|
126 | Please enter your name. |
---|
127 | </div> |
---|
128 | <div tal:content="error">Validation error output</div> |
---|
129 | <input type="text" |
---|
130 | id="creator" |
---|
131 | name="creator" |
---|
132 | size="40" |
---|
133 | value="" |
---|
134 | tal:attributes="value request/creator|nothing" |
---|
135 | /> |
---|
136 | </div> |
---|
137 | <div class="field" |
---|
138 | tal:define="error errors/email|nothing" |
---|
139 | tal:attributes="class python:error and 'field error' or 'field'"> |
---|
140 | <label for="email" i18n:translate="label_email"> |
---|
141 | E-Mail |
---|
142 | </label> |
---|
143 | <span class="fieldRequired" title="Required" |
---|
144 | i18n:attributes="title title_required;" |
---|
145 | i18n:translate="label_required">(Required)</span> |
---|
146 | <div class="formHelp" i18n:translate="help_email" |
---|
147 | i18n:domain="quintagroup.plonecomments"> |
---|
148 | Please enter your e-mail address. |
---|
149 | </div> |
---|
150 | <div tal:content="error">Validation error output</div> |
---|
151 | <input type="text" |
---|
152 | id="email" |
---|
153 | name="email" |
---|
154 | size="40" |
---|
155 | value="" |
---|
156 | tal:attributes="value request/email|nothing" |
---|
157 | /> |
---|
158 | </div> |
---|
159 | </tal:feedbackForm> |
---|
160 | <tal:feedbackForm condition="not:isAnon" |
---|
161 | define="fullname python:request.get('fullname', member.getProperty('fullname', '')); |
---|
162 | email python:request.get('email', member.getProperty('email',''));"> |
---|
163 | <input type="hidden" name="sender_fullname" value="fullname" tal:attributes="value fullname" /> |
---|
164 | <input type="hidden" name="email" value="email" tal:attributes="value email" /> |
---|
165 | </tal:feedbackForm> |
---|
166 | <div class="field" |
---|
167 | tal:define="error errors/message|nothing" |
---|
168 | tal:attributes="class python:error and 'field error' or 'field'"> |
---|
169 | <label for="message" i18n:translate="label_message"> |
---|
170 | Message |
---|
171 | </label> |
---|
172 | <span class="fieldRequired" title="Required" |
---|
173 | i18n:attributes="title title_required;" |
---|
174 | i18n:translate="label_required">(Required)</span> |
---|
175 | |
---|
176 | <div class="formHelp" i18n:domain="quintagroup.plonecomments" i18n:translate="help_message"> |
---|
177 | Please state your reasons why you would like to report this comment as abusive. |
---|
178 | Our administrator will be notified with your message. |
---|
179 | </div> |
---|
180 | <div tal:content="error">Validation error output</div> |
---|
181 | <textarea name="message" id="message" rows="5" cols="25" tal:content="request/message|nothing"> </textarea> |
---|
182 | </div> |
---|
183 | <metal:macro define-macro="captcha"> |
---|
184 | <div tal:define="comment_id comment_id|request/comment_id" |
---|
185 | tal:attributes="id string:div-captcha-${comment_id}" |
---|
186 | tal:condition="nocall:here/captcha_widget|nothing"> |
---|
187 | <div metal:use-macro="here/captcha_widget/macros/captcha" /> |
---|
188 | </div> |
---|
189 | </metal:macro> |
---|
190 | |
---|
191 | <div class="formControls"> |
---|
192 | <input type="hidden" name="form.submitted" value="1" /> |
---|
193 | |
---|
194 | <input type="hidden" name="require_email:boolean" value="" |
---|
195 | tal:attributes="value python:isAnon" /> |
---|
196 | |
---|
197 | <input |
---|
198 | value="Send" |
---|
199 | type="submit" |
---|
200 | class="context" |
---|
201 | name="form.button.Send" |
---|
202 | tal:attributes="comment_id comment_id" |
---|
203 | i18n:attributes="value label_send;" |
---|
204 | /> |
---|
205 | |
---|
206 | <input |
---|
207 | id="input-report-abuse-cancel" |
---|
208 | class="destructive" |
---|
209 | value="Cancel" |
---|
210 | type="submit" |
---|
211 | name="form.button.Cancel" |
---|
212 | i18n:attributes="value label_cancel;" |
---|
213 | /> |
---|
214 | </div> |
---|
215 | </fieldset> |
---|
216 | </form> |
---|
217 | </tal:if> |
---|
218 | </span> |
---|
219 | </metal:macro> |
---|
220 | </tal:set> |
---|
221 | |
---|
222 | </form> |
---|
223 | </div> |
---|
224 | </body> |
---|
225 | </html> |
---|