source: products/quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/skins/captchas_discussion/discussion_reply_form.cpt

Last change on this file was 2453, checked in by mylan, 14 years ago

#194: Fixed discussion form for plone-4

File size: 8.0 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="context/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:main fill-slot="main"
13     tal:define="portal context/@@plone_portal_state/portal;
14                 errors options/state/getErrors;
15                 thread python:context.plone_utils.getDiscussionThread(here);
16                 discussable python:thread[0];
17                 replies python:thread[1:];
18                 toLocalizedTime nocall: context/@@plone/toLocalizedTime;">
19
20    <div id="content-core">
21        <tal:discussable define="object_title context/Title;
22                                 object_description context/Description;
23                                 view_template python:getattr(here, discussable.getLayout(), None);
24                                 view_macros view_template/macros | nothing;
25                                 view_macro view_macros/content-core | nothing;
26                                 showDiscussable python:object_title or object_description or view_macro;">
27             <div class="comment"
28                  tal:condition="showDiscussable"
29                  tal:define="here python:discussable;
30                              context python:discussable">
31                 <h1 class="documentDescription" tal:content="object_title">Title</h1>
32                 <div class="documentDescription" tal:content="object_description">
33                     Description
34                 </div>
35                 <tal:block tal:condition="view_macro">
36                     <div metal:use-macro="view_macro"/>
37                 </tal:block>
38             </div>
39        </tal:discussable>
40
41        <tal:thread tal:repeat="reply replies">
42            <tal:block tal:define="level repeat/reply/index">
43                <div class="comment"
44                     tal:attributes="style python:'margin-left:'+str((int(level)+1)*2)+'em'">
45                   <h3>
46                       <tal:block replace="structure portal/discussionitem_icon.png"/>
47                       <span tal:replace="reply/pretty_title_or_id">Comment title</span>
48                   </h3>
49                   <div class="documentByLine"
50                        tal:define="anonymous_creator python:reply.Creator()=='Anonymous User'">
51                       <span i18n:translate="label_comment_by">Posted by</span>
52                       <span tal:content="reply/Creator"
53                             tal:condition="not:anonymous_creator">Poster Name</span>
54                       <span i18n:translate="label_anonymous_user"
55                             tal:condition="anonymous_creator">Anonymous User</span>
56                       <span i18n:translate="label_commented_at">at</span>
57                       <span tal:replace="python:toLocalizedTime(reply.ModificationDate(),
58                                          long_format=1)">8/23/2001 12:40:44 PM</span>
59                   </div>
60                   <div class="commentBody"
61                        tal:content="structure reply/CookedBody">
62                        This is the body text of the comment.
63                   </div>
64               </div>   
65                 
66            </tal:block>
67        </tal:thread>
68
69        <form name="edit_form"
70              class="enableAutoFocus"
71              method="post"
72              action="talkback"
73              tal:attributes="action string:${context/@@plone_context_state/object_url}/${template/getId}"
74              tal:define="isAnon context/@@plone_portal_state/anonymous;">
75
76            <fieldset>
77
78                <legend i18n:translate="legend_add_comment">Add comment</legend>
79                <p i18n:translate="description_add_comment">
80                    You can add a comment by filling out the form below. Plain text
81                    formatting.
82                </p>
83
84                <input type="hidden" name="Creator" value=""
85                       tal:define="member context/@@plone_portal_state/member;"
86                       tal:attributes="value member/getUserName" />
87
88                <div tal:condition="isAnon">
89                    <dl class="portalMessage warning">
90                        <dt i18n:translate="">
91                            Info
92                        </dt>
93                        <dd i18n:translate="legend_note_reply_anonymous">
94                            You are not logged in. You may optionally enter your
95                            username and password below. If you don't enter anything,
96                            this comment will be posted as 'Anonymous User'.
97                        </dd>
98                    </dl>
99
100                    <div class="field">
101
102                        <label for="username" i18n:translate="label_name">Name</label>
103
104                        <input name="username"
105                               id="username"
106                               value="" alt="Username" title="Name"
107                               size="40"
108                               i18n:attributes="title label_name; alt label_username;" />
109
110                    </div>
111
112                    <div class="field">
113
114                        <label for="password" i18n:translate="label_password">Password</label>
115
116                        <input type="password"
117                               id="password"
118                               name="password"
119                               value="" alt="Password" title="Password"
120                               size="40"
121                               i18n:attributes="title label_password; alt label_password;" />
122
123                    </div>
124
125                </div>
126
127
128            <div class="field"
129            tal:define="error errors/subject|nothing;"
130            tal:attributes="class python:test(error, 'field error', 'field')">
131
132                    <label for="subject" i18n:translate="label_subject">Subject</label>
133
134            <span class="fieldRequired" title="Required"
135                  i18n:attributes="title title_required;"
136                  i18n:translate="label_required">(Required)</span>
137
138                <div tal:content="error">Validation error output</div>
139
140                    <input name="subject"
141                           id="subject"
142                           value=""
143                           size="40"
144                           tal:attributes="value request/subject|request/title_override|nothing;" />
145
146                </div>
147
148            <div class="field"
149            tal:define="error errors/body_text|nothing;"
150            tal:attributes="class python:test(error, 'field error', 'field')">
151
152              <label for="body_text" i18n:translate="label_comment">Comment</label>
153
154            <span class="fieldRequired" title="Required"
155                  i18n:attributes="title title_required;"
156                  i18n:translate="label_required">(Required)</span>
157
158                <div tal:content="error">Validation error output</div>
159
160                    <textarea name="body_text"
161                              id="body_text"
162                              cols="40"
163                              rows="8"
164                              tal:content="request/body_text|request/text_override | nothing"
165                            ></textarea>
166
167                </div>
168
169                <div metal:use-macro="here/captcha_widget/macros/captcha"></div>
170
171                <div class="formControls">
172
173                    <input class="context"
174                           type="submit"
175                           value="Save"
176                           name="form.button.Save"
177                           i18n:attributes="value label_save;"
178                           tal:attributes="name string:discussion_reply:method;" />
179
180                </div>
181              <input type="hidden" name="form.submitted" value="1" />
182
183            </fieldset>
184
185        </form>
186    </div>
187
188</metal:main>
189
190</body>
191</html>
Note: See TracBrowser for help on using the repository browser.