1 | <html xmlns:tal="http://xml.zope.org/namespaces/tal" |
---|
2 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
---|
3 | metal:use-macro="here/main_template/macros/master" |
---|
4 | i18n:domain="plone"> |
---|
5 | <body> |
---|
6 | |
---|
7 | <metal:block fill-slot="top_slot" |
---|
8 | tal:define="dummy python:request.set('disable_border',1)" /> |
---|
9 | |
---|
10 | <metal:block fill-slot="sub" /> |
---|
11 | |
---|
12 | <div metal:fill-slot="main" |
---|
13 | tal:define="errors options/state/getErrors; |
---|
14 | thread python:putils.getDiscussionThread(here); |
---|
15 | discussable python:thread[0]; |
---|
16 | replies python:thread[1:]; |
---|
17 | property_id string:require_email; |
---|
18 | props_sheet here/portal_properties/qPloneComments; |
---|
19 | require_email python:props_sheet.getProperty(property_id)"> |
---|
20 | |
---|
21 | <tal:discussable define="template python:getattr(here, discussable.getLayout(), None); |
---|
22 | macros template/macros | nothing; |
---|
23 | main_macro macros/main | nothing; |
---|
24 | showDiscussable python:main_macro; |
---|
25 | template template_id" |
---|
26 | > |
---|
27 | |
---|
28 | <div class="comment" |
---|
29 | tal:condition="showDiscussable" |
---|
30 | tal:define="here python:discussable"> |
---|
31 | <div metal:use-macro="main_macro"/> |
---|
32 | </div> |
---|
33 | </tal:discussable> |
---|
34 | |
---|
35 | <tal:thread tal:repeat="reply replies"> |
---|
36 | <tal:block tal:define="level repeat/reply/index"> |
---|
37 | <div class="comment" |
---|
38 | tal:attributes="style python:'margin-left:'+str((int(level)+1)*2)+'em'"> |
---|
39 | <h3> |
---|
40 | <tal:block replace="structure portal/discussionitem_icon.gif"/> |
---|
41 | <span tal:replace="reply/pretty_title_or_id">Comment title</span> |
---|
42 | </h3> |
---|
43 | <div class="documentByLine" |
---|
44 | tal:define="anonymous_creator python:reply.Creator()=='Anonymous User'"> |
---|
45 | <span i18n:translate="label_comment_by">Posted by</span> |
---|
46 | <span tal:content="reply/Creator" |
---|
47 | tal:condition="not:anonymous_creator">Poster Name</span> |
---|
48 | <span i18n:translate="label_anonymous_user" |
---|
49 | tal:condition="anonymous_creator">Anonymous User</span> |
---|
50 | <span i18n:translate="label_commented_at">at</span> |
---|
51 | <span tal:replace="python:toLocalizedTime(reply.ModificationDate(), |
---|
52 | long_format=1)">8/23/2001 12:40:44 PM</span> |
---|
53 | </div> |
---|
54 | <div class="commentBody" |
---|
55 | tal:content="structure reply/CookedBody"> |
---|
56 | This is the body text of the comment. |
---|
57 | </div> |
---|
58 | </div> |
---|
59 | |
---|
60 | </tal:block> |
---|
61 | </tal:thread> |
---|
62 | |
---|
63 | <form name="edit_form" |
---|
64 | method="post" |
---|
65 | action="talkback" |
---|
66 | tal:attributes="action string:$here_url/$template_id" |
---|
67 | tal:define="isForAnonymous python:here.portal_properties.qPloneComments.getProperty('enable_anonymous_commenting', 0)"> |
---|
68 | |
---|
69 | <fieldset> |
---|
70 | <input type="hidden" name="require_email" value="" |
---|
71 | tal:attributes="value python:bool(require_email and isAnon)"/> |
---|
72 | |
---|
73 | <legend i18n:translate="legend_add_comment">Add comment</legend> |
---|
74 | <p i18n:translate="description_add_comment"> |
---|
75 | You can add a comment by filling out the form below. Plain text formatting. |
---|
76 | </p> |
---|
77 | |
---|
78 | <input type="hidden" name="Creator" value="" |
---|
79 | tal:attributes="value member/getUserName" |
---|
80 | tal:condition="not:isForAnonymous"/> |
---|
81 | |
---|
82 | <div class="field" |
---|
83 | tal:condition="isForAnonymous" |
---|
84 | i18n:domain="plonecomments"> |
---|
85 | |
---|
86 | <div class="field" |
---|
87 | tal:define="error errors/Creator|nothing;" |
---|
88 | tal:attributes="class python:test(error, 'field error', 'field');"> |
---|
89 | |
---|
90 | <label for="username" i18n:translate="label_name">Name</label> |
---|
91 | |
---|
92 | <span class="fieldRequired" title="Required" |
---|
93 | tal:condition="isAnon" |
---|
94 | i18n:attributes="title" |
---|
95 | i18n:translate="label_required">(Required)</span> |
---|
96 | |
---|
97 | <div class="formHelp" i18n:translate="help_name" |
---|
98 | tal:condition="isAnon"> |
---|
99 | Please tell us your name. |
---|
100 | </div> |
---|
101 | |
---|
102 | <div tal:content="error">Validation error output</div> |
---|
103 | |
---|
104 | <div> |
---|
105 | <input name="Creator" |
---|
106 | id="username" |
---|
107 | value="" alt="Submitter" title="Name" |
---|
108 | size="40" |
---|
109 | tabindex="" |
---|
110 | i18n:attributes="alt; title" |
---|
111 | tal:attributes="tabindex tabindex/next; |
---|
112 | value python:test(isAnon, '', member.getUserName()); |
---|
113 | disabled python:test(isAnon, None, 'true')" /> |
---|
114 | </div> |
---|
115 | </div> |
---|
116 | |
---|
117 | <div class="field" |
---|
118 | tal:define="error errors/email|nothing;" |
---|
119 | tal:attributes="class python:test(error, 'field error', 'field')" |
---|
120 | tal:condition="python:require_email and isAnon"> |
---|
121 | |
---|
122 | |
---|
123 | <label for="email" i18n:translate="label_anonymous_email">Please enter your email:</label> |
---|
124 | <span class="fieldRequired" title="Required" |
---|
125 | i18n:attributes="title title_required;" |
---|
126 | i18n:translate="label_required">(Required) |
---|
127 | </span> |
---|
128 | <div tal:content="error">Validation error output</div> |
---|
129 | |
---|
130 | <input name="email" |
---|
131 | value="" |
---|
132 | size="40" |
---|
133 | tabindex="" |
---|
134 | tal:attributes="tabindex tabindex/next;" /> |
---|
135 | </div> |
---|
136 | </div> |
---|
137 | |
---|
138 | <div class="portalMessage" |
---|
139 | tal:condition="python:(not isForAnonymous) and isAnon"> |
---|
140 | |
---|
141 | <tal:block replace="structure here/info.gif"/> |
---|
142 | |
---|
143 | <p i18n:translate="legend_note_reply_anonymous"> |
---|
144 | Note: you are not logged in. You may optionally enter your username |
---|
145 | and password below. If you don't enter your username and |
---|
146 | password below, this comment will be posted as the 'Anonymous User'. |
---|
147 | </p> |
---|
148 | |
---|
149 | <div class="field"> |
---|
150 | |
---|
151 | <label for="username" i18n:translate="label_name">Name</label> |
---|
152 | |
---|
153 | <input name="username" |
---|
154 | id="username" |
---|
155 | value="" alt="Username" title="Name" |
---|
156 | size="40" |
---|
157 | tabindex="" |
---|
158 | i18n:attributes="title label_name; alt label_username;" |
---|
159 | tal:attributes="tabindex tabindex/next;" /> |
---|
160 | |
---|
161 | </div> |
---|
162 | |
---|
163 | <div class="field"> |
---|
164 | |
---|
165 | <label for="password" i18n:translate="label_password">Password</label> |
---|
166 | |
---|
167 | <input type="password" |
---|
168 | id="password" |
---|
169 | name="password" |
---|
170 | tabindex="" |
---|
171 | value="" alt="Password" title="Password" |
---|
172 | size="40" |
---|
173 | i18n:attributes="title label_password; alt label_password;" |
---|
174 | tal:attributes="tabindex tabindex/next;" /> |
---|
175 | |
---|
176 | </div> |
---|
177 | |
---|
178 | </div> |
---|
179 | |
---|
180 | |
---|
181 | <div class="field" |
---|
182 | tal:define="error errors/subject|nothing;" |
---|
183 | tal:attributes="class python:test(error, 'field error', 'field')"> |
---|
184 | |
---|
185 | <label for="subject" i18n:translate="label_subject">Subject</label> |
---|
186 | |
---|
187 | <span class="fieldRequired" title="Required" |
---|
188 | i18n:attributes="title title_required;" |
---|
189 | i18n:translate="label_required">(Required)</span> |
---|
190 | |
---|
191 | <div tal:content="error">Validation error output</div> |
---|
192 | |
---|
193 | <input name="subject" |
---|
194 | id="subject" |
---|
195 | value="" |
---|
196 | size="40" |
---|
197 | tabindex="" |
---|
198 | tal:attributes="value request/subject|request/title_override|nothing; |
---|
199 | tabindex tabindex/next" /> |
---|
200 | |
---|
201 | </div> |
---|
202 | |
---|
203 | <div class="field" |
---|
204 | tal:define="error errors/body_text|nothing;" |
---|
205 | tal:attributes="class python:test(error, 'field error', 'field')"> |
---|
206 | |
---|
207 | <label for="body_text" i18n:translate="label_comment">Comment</label> |
---|
208 | |
---|
209 | <span class="fieldRequired" title="Required" |
---|
210 | i18n:attributes="title title_required;" |
---|
211 | i18n:translate="label_required">(Required)</span> |
---|
212 | |
---|
213 | <div tal:content="error">Validation error output</div> |
---|
214 | |
---|
215 | <textarea name="body_text" |
---|
216 | id="body_text" |
---|
217 | cols="40" |
---|
218 | rows="8" |
---|
219 | tabindex="" |
---|
220 | tal:content="request/body_text|request/text_override | nothing" |
---|
221 | tal:attributes="tabindex tabindex/next" |
---|
222 | ></textarea> |
---|
223 | |
---|
224 | </div> |
---|
225 | |
---|
226 | <div tal:condition="nocall:here/captcha_widget|nothing" |
---|
227 | tal:omit-tag=""> |
---|
228 | <div metal:use-macro="here/captcha_widget/macros/captcha" /> |
---|
229 | </div> |
---|
230 | |
---|
231 | <div class="formControls"> |
---|
232 | |
---|
233 | <input class="context" |
---|
234 | tabindex="" |
---|
235 | type="submit" |
---|
236 | value="Save" |
---|
237 | name="form.button.Save" |
---|
238 | i18n:attributes="value label_save;" |
---|
239 | tal:attributes="tabindex tabindex/next; |
---|
240 | name string:discussion_reply:method;" /> |
---|
241 | |
---|
242 | </div> |
---|
243 | <input type="hidden" name="form.submitted" value="1" /> |
---|
244 | |
---|
245 | </fieldset> |
---|
246 | |
---|
247 | </form> |
---|
248 | |
---|
249 | </div> |
---|
250 | |
---|
251 | </body> |
---|
252 | </html> |
---|