source: products/quintagroup.plonecomments/branches/jquery/quintagroup/plonecomments/skins/quintagroup_plonecomments/discussion_reply_form.cpt @ 2597

Last change on this file since 2597 was 2597, checked in by kroman0, 14 years ago

Fixed email input id on discussion_reply_form

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