source: products/qPloneCaptchas/tags/0.8/skins/captchas_qcomments/2.1.2/discussion_reply_form.cpt @ 1

Last change on this file since 1 was 1, checked in by myroslav, 19 years ago

Building directory structure

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