source: products/qPloneComments/tags/2.2.0/skins/qplonecomments/2.1/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: 10.0 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                 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        <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:portal.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    <form name="edit_form"
63          method="post"
64          action="talkback"
65          tal:attributes="action string:$here_url/$template_id"
66          tal:define="isForAnonymous python:here.portal_properties.qPloneComments.getProperty('enable_anonymous_commenting', 0)">
67
68        <fieldset>
69             <input type="hidden" name="require_email" value=""
70                    tal:attributes="value python:bool(require_email and isAnon)"/>
71
72            <legend i18n:translate="legend_add_comment">Add comment</legend>
73            <p i18n:translate="description_add_comment">
74                You can add a comment by filling out the form below. Plain text formatting.
75            </p>
76
77            <input type="hidden" name="Creator" value=""
78                   tal:attributes="value member/getUserName"
79                   tal:condition="not:isForAnonymous"/>
80
81            <div class="field"
82                 tal:condition="isForAnonymous"
83                 i18n:domain="plonecomments">
84
85                <div class="field"
86                     tal:define="error errors/Creator|nothing;"
87                     tal:attributes="class python:test(error, 'field error', 'field');">
88
89                    <label for="username" i18n:translate="label_name">Name</label>
90
91                    <span class="fieldRequired" title="Required"
92                          tal:condition="isAnon"
93                          i18n:attributes="title"
94                          i18n:translate="label_required">(Required)</span>
95
96                    <div class="formHelp" i18n:translate="help_name"
97                         tal:condition="isAnon">
98                    Please tell us your name.
99                    </div>
100
101                    <div tal:content="error">Validation error output</div>
102
103                    <div>
104                        <input name="Creator"
105                               id="username"
106                               value="" alt="Submitter" title="Name"
107                               size="40"
108                               tabindex=""
109                               i18n:attributes="alt title"
110                               tal:attributes="tabindex tabindex/next;
111                                               value python:test(isAnon, '', member.getUserName());
112                                               disabled python:test(isAnon, None, 'true')" />
113
114                    </div>
115                </div>
116                <div class="field"
117                     tal:define="error errors/email|nothing;"
118                     tal:attributes="class python:test(error, 'field error', 'field')"
119                     tal:condition="python:require_email and isAnon">
120
121
122                    <label for="email" i18n:translate="label_discussion-manager_email">Please enter your email:</label>
123                    <span class="fieldRequired" title="Required"
124                          i18n:attributes="title title_required;"
125                          i18n:translate="label_required">(Required)
126                    </span>
127                    <div tal:content="error">Validation error output</div>
128
129                    <input name="email"
130                           value=""
131                           size="40"
132                           tabindex=""
133                           tal:attributes="tabindex tabindex/next;" />
134                </div>
135
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="title" 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="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>
Note: See TracBrowser for help on using the repository browser.