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