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 | |
---|
64 | <form name="edit_form" |
---|
65 | class="enableAutoFocus" |
---|
66 | method="post" |
---|
67 | action="talkback" |
---|
68 | tal:attributes="action string:$here_url/$template_id" |
---|
69 | tal:define="isForAnonymous python:here.portal_properties.qPloneComments.getProperty('enable_anonymous_commenting', 0)"> |
---|
70 | |
---|
71 | <fieldset> |
---|
72 | |
---|
73 | <legend i18n:translate="legend_add_comment">Add comment</legend> |
---|
74 | |
---|
75 | <p i18n:translate="description_add_comment"> |
---|
76 | You can add a comment by filling out the form below. Plain text |
---|
77 | formatting. |
---|
78 | </p> |
---|
79 | |
---|
80 | <input type="hidden" name="Creator" value="" |
---|
81 | tal:attributes="value member/getUserName" |
---|
82 | tal:condition="not:isForAnonymous"/> |
---|
83 | |
---|
84 | <div tal:condition="isForAnonymous"> |
---|
85 | |
---|
86 | <input type="hidden" |
---|
87 | name="Creator" |
---|
88 | tal:condition="not:isAnon" |
---|
89 | tal:attributes="value member/getUserName" /> |
---|
90 | |
---|
91 | <div class="field" |
---|
92 | tal:condition="isAnon" |
---|
93 | tal:define="error errors/Creator|nothing;" |
---|
94 | tal:attributes="class python:test(error, 'field error', 'field');"> |
---|
95 | |
---|
96 | <label for="username" i18n:translate="label_name">Name</label> |
---|
97 | |
---|
98 | <span class="fieldRequired" title="Required" |
---|
99 | tal:condition="isAnon" |
---|
100 | i18n:attributes="title" |
---|
101 | i18n:translate="label_required">(Required)</span> |
---|
102 | |
---|
103 | <div class="formHelp" i18n:translate="help_name" |
---|
104 | i18n:domain="quintagroup.plonecomments"> |
---|
105 | Tell us your name. |
---|
106 | </div> |
---|
107 | |
---|
108 | <div tal:content="error">Validation error output</div> |
---|
109 | |
---|
110 | <div> |
---|
111 | <input name="Creator" |
---|
112 | id="username" |
---|
113 | value="" alt="Submitter" title="Name" |
---|
114 | size="40" |
---|
115 | i18n:attributes="alt; title" |
---|
116 | tal:attributes="value request/Creator | nothing" /> |
---|
117 | </div> |
---|
118 | |
---|
119 | </div> |
---|
120 | |
---|
121 | <div class="field" |
---|
122 | tal:define="error errors/email|nothing;" |
---|
123 | tal:attributes="class python:test(error, 'field error', 'field')" |
---|
124 | tal:condition="python:require_email and isAnon"> |
---|
125 | |
---|
126 | <label for="email" i18n:translate="label_email">E-Mail</label> |
---|
127 | |
---|
128 | <span class="fieldRequired" title="Required" |
---|
129 | i18n:attributes="title title_required;" |
---|
130 | i18n:translate="label_required">(Required) |
---|
131 | </span> |
---|
132 | |
---|
133 | <div class="formHelp" i18n:translate="help_email" |
---|
134 | i18n:domain="quintagroup.plonecomments"> |
---|
135 | Enter your e-mail address. |
---|
136 | </div> |
---|
137 | |
---|
138 | <div tal:content="error">Validation error output</div> |
---|
139 | |
---|
140 | <input name="email" value="" size="40" /> |
---|
141 | |
---|
142 | </div> |
---|
143 | |
---|
144 | </div> |
---|
145 | |
---|
146 | <div tal:condition="python:(not isForAnonymous) and isAnon"> |
---|
147 | <dl class="portalMessage warning"> |
---|
148 | <dt i18n:translate=""> |
---|
149 | Info |
---|
150 | </dt> |
---|
151 | <dd i18n:translate="legend_note_reply_anonymous"> |
---|
152 | You are not logged in. You may optionally enter your |
---|
153 | username and password below. If you don't enter anything, |
---|
154 | this comment will be posted as 'Anonymous User'. |
---|
155 | </dd> |
---|
156 | </dl> |
---|
157 | |
---|
158 | <div class="field"> |
---|
159 | |
---|
160 | <label for="username" i18n:translate="label_name">Name</label> |
---|
161 | |
---|
162 | <input name="username" |
---|
163 | id="username" |
---|
164 | value="" alt="Username" title="Name" |
---|
165 | size="40" |
---|
166 | i18n:attributes="title label_name; alt label_username;" /> |
---|
167 | |
---|
168 | </div> |
---|
169 | |
---|
170 | <div class="field"> |
---|
171 | |
---|
172 | <label for="password" i18n:translate="label_password">Password</label> |
---|
173 | |
---|
174 | <input type="password" |
---|
175 | id="password" |
---|
176 | name="password" |
---|
177 | value="" alt="Password" title="Password" |
---|
178 | size="40" |
---|
179 | i18n:attributes="title label_password; alt label_password;" /> |
---|
180 | |
---|
181 | </div> |
---|
182 | </div> |
---|
183 | |
---|
184 | <div class="field" |
---|
185 | tal:define="error errors/subject|nothing;" |
---|
186 | tal:attributes="class python:test(error, 'field error', 'field')"> |
---|
187 | |
---|
188 | <label for="subject" i18n:translate="label_subject">Subject</label> |
---|
189 | |
---|
190 | <span class="fieldRequired" title="Required" |
---|
191 | i18n:attributes="title title_required;" |
---|
192 | i18n:translate="label_required">(Required)</span> |
---|
193 | |
---|
194 | <div tal:content="error">Validation error output</div> |
---|
195 | |
---|
196 | <input name="subject" |
---|
197 | id="subject" |
---|
198 | value="" |
---|
199 | size="40" |
---|
200 | tal:attributes="value request/subject|request/title_override|nothing;" /> |
---|
201 | |
---|
202 | </div> |
---|
203 | |
---|
204 | <div class="field" |
---|
205 | tal:define="error errors/body_text|nothing;" |
---|
206 | tal:attributes="class python:test(error, 'field error', 'field')"> |
---|
207 | |
---|
208 | <label for="body_text" i18n:translate="label_comment">Comment</label> |
---|
209 | |
---|
210 | <span class="fieldRequired" title="Required" |
---|
211 | i18n:attributes="title title_required;" |
---|
212 | i18n:translate="label_required">(Required)</span> |
---|
213 | |
---|
214 | <div tal:content="error">Validation error output</div> |
---|
215 | |
---|
216 | <textarea name="body_text" |
---|
217 | id="body_text" |
---|
218 | cols="40" |
---|
219 | rows="8" |
---|
220 | tal:content="request/body_text|request/text_override | nothing" |
---|
221 | ></textarea> |
---|
222 | |
---|
223 | </div> |
---|
224 | |
---|
225 | <div tal:condition="nocall:here/captcha_widget|nothing" |
---|
226 | tal:omit-tag=""> |
---|
227 | <div metal:use-macro="here/captcha_widget/macros/captcha" /> |
---|
228 | </div> |
---|
229 | |
---|
230 | <div class="formControls"> |
---|
231 | |
---|
232 | <input type="hidden" name="form.submitted" value="1" /> |
---|
233 | |
---|
234 | <input type="hidden" name="require_email:boolean" value="" |
---|
235 | tal:attributes="value python:require_email and isAnon" /> |
---|
236 | |
---|
237 | <input class="context" |
---|
238 | type="submit" |
---|
239 | value="Save" |
---|
240 | name="form.button.Save" |
---|
241 | i18n:attributes="value label_save;" |
---|
242 | tal:attributes="name string:discussion_reply:method;" /> |
---|
243 | |
---|
244 | </div> |
---|
245 | |
---|
246 | </fieldset> |
---|
247 | |
---|
248 | </form> |
---|
249 | |
---|
250 | </div> |
---|
251 | |
---|
252 | </body> |
---|
253 | </html> |
---|