source: products/qPloneComments/trunk/skins/qplonecomments/discussion_reply_form.cpt @ 841

Last change on this file since 841 was 841, checked in by mylan, 17 years ago

Clean-up code code.

  • Property svn:eol-style set to native
File size: 10.0 KB
RevLine 
[93]1<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
2      xmlns:tal="http://xml.zope.org/namespaces/tal"
[1]3      xmlns:metal="http://xml.zope.org/namespaces/metal"
[93]4      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
[1]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;
[93]20                 require_email python:props_sheet.getProperty('require_email')">
[1]21
22    <tal:discussable define="template python:getattr(here, discussable.getLayout(), None);
23                             macros template/macros | nothing;
24                             main_macro macros/main | nothing;
[93]25                             showDiscussable python:main_macro;">
[1]26
[93]27        <div class="comment"
[1]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>
[93]49                   <span i18n:translate="label_commented_at">at</span>
[1]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
[93]62    <a name="discussion"></a>
63
[1]64    <form name="edit_form"
[93]65          class="enableAutoFocus"
[1]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>
[93]74
[1]75            <p i18n:translate="description_add_comment">
[93]76                You can add a comment by filling out the form below. Plain text
77                formatting.
[1]78            </p>
79
80            <input type="hidden" name="Creator" value=""
[93]81                   tal:attributes="value member/getUserName"
[1]82                   tal:condition="not:isForAnonymous"/>
83
[93]84            <div tal:condition="isForAnonymous">
[1]85
[93]86                <input type="hidden"
87                       name="Creator"
88                       tal:condition="not:isAnon"
89                       tal:attributes="value member/getUserName" />
90
[1]91                 <div class="field"
[93]92                     tal:condition="isAnon"
[1]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"
[93]104                         i18n:domain="plonecomments">
105                        Tell us your name.
[1]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"
[93]116                               tal:attributes="value request/Creator | nothing" />
[1]117                    </div>
[93]118
[1]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
[93]126                    <label for="email" i18n:translate="label_email">E-Mail</label>
[1]127
128                    <span class="fieldRequired" title="Required"
129                          i18n:attributes="title title_required;"
130                          i18n:translate="label_required">(Required)
131                    </span>
[93]132
133                    <div class="formHelp" i18n:translate="help_email"
134                         i18n:domain="plonecomments">
135                        Enter your e-mail address.
136                    </div>
137
[1]138                    <div tal:content="error">Validation error output</div>
139
[93]140                    <input name="email" value="" size="40" />
141
[1]142                </div>
[93]143
[1]144            </div>
145
[93]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>
[1]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"
[93]166                           i18n:attributes="title label_name; alt label_username;" />
[1]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"
[93]179                           i18n:attributes="title label_password; alt label_password;" />
[1]180
181                </div>
[93]182        </div>
[1]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"
[93]200                       tal:attributes="value request/subject|request/title_override|nothing;" />
[1]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
[841]225             <p class="formHelp" tal:condition="python:require_email and isAnon">
226                Want to add a picture to your comments here on
227                <tal:site content="portal_title|default">the Site</tal:site>? <br />
228                Upload a picture at <a href="http://en.gravatar.com">Gravatar</a> to make it happen.
229             </p>
230
[1]231             <div tal:condition="nocall:here/captcha_widget|nothing"
232                  tal:omit-tag="">
233                <div metal:use-macro="here/captcha_widget/macros/captcha" />
234             </div>
235
236            <div class="formControls">
237
[93]238                <input type="hidden" name="form.submitted" value="1" />
239
240                <input type="hidden" name="require_email:boolean" value=""
241                       tal:attributes="value python:require_email and isAnon" />
242
[1]243                <input class="context"
244                       type="submit"
245                       value="Save"
246                       name="form.button.Save"
247                       i18n:attributes="value label_save;"
[93]248                       tal:attributes="name string:discussion_reply:method;" />
[1]249
250            </div>
251
252        </fieldset>
253
254    </form>
255
256</div>
257
258</body>
259</html>
Note: See TracBrowser for help on using the repository browser.