[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 | |
---|
[1221] | 64 | <metal:block metal:define-macro="add-comment-form"> |
---|
| 65 | |
---|
[1] | 66 | <form name="edit_form" |
---|
[93] | 67 | class="enableAutoFocus" |
---|
[1] | 68 | method="post" |
---|
| 69 | action="talkback" |
---|
| 70 | tal:attributes="action string:$here_url/$template_id" |
---|
| 71 | tal:define="isForAnonymous python:here.portal_properties.qPloneComments.getProperty('enable_anonymous_commenting', 0)"> |
---|
| 72 | |
---|
| 73 | <fieldset> |
---|
| 74 | |
---|
| 75 | <legend i18n:translate="legend_add_comment">Add comment</legend> |
---|
[93] | 76 | |
---|
[1] | 77 | <p i18n:translate="description_add_comment"> |
---|
[93] | 78 | You can add a comment by filling out the form below. Plain text |
---|
| 79 | formatting. |
---|
[1] | 80 | </p> |
---|
| 81 | |
---|
| 82 | <input type="hidden" name="Creator" value="" |
---|
[93] | 83 | tal:attributes="value member/getUserName" |
---|
[1] | 84 | tal:condition="not:isForAnonymous"/> |
---|
| 85 | |
---|
[93] | 86 | <div tal:condition="isForAnonymous"> |
---|
[1] | 87 | |
---|
[93] | 88 | <input type="hidden" |
---|
| 89 | name="Creator" |
---|
| 90 | tal:condition="not:isAnon" |
---|
| 91 | tal:attributes="value member/getUserName" /> |
---|
| 92 | |
---|
[1] | 93 | <div class="field" |
---|
[93] | 94 | tal:condition="isAnon" |
---|
[1] | 95 | tal:define="error errors/Creator|nothing;" |
---|
| 96 | tal:attributes="class python:test(error, 'field error', 'field');"> |
---|
| 97 | |
---|
| 98 | <label for="username" i18n:translate="label_name">Name</label> |
---|
| 99 | |
---|
| 100 | <span class="fieldRequired" title="Required" |
---|
| 101 | tal:condition="isAnon" |
---|
| 102 | i18n:attributes="title" |
---|
| 103 | i18n:translate="label_required">(Required)</span> |
---|
| 104 | |
---|
| 105 | <div class="formHelp" i18n:translate="help_name" |
---|
[93] | 106 | i18n:domain="plonecomments"> |
---|
| 107 | Tell us your name. |
---|
[1] | 108 | </div> |
---|
| 109 | |
---|
| 110 | <div tal:content="error">Validation error output</div> |
---|
| 111 | |
---|
| 112 | <div> |
---|
| 113 | <input name="Creator" |
---|
| 114 | id="username" |
---|
| 115 | value="" alt="Submitter" title="Name" |
---|
| 116 | size="40" |
---|
| 117 | i18n:attributes="alt; title" |
---|
[93] | 118 | tal:attributes="value request/Creator | nothing" /> |
---|
[1] | 119 | </div> |
---|
[93] | 120 | |
---|
[1] | 121 | </div> |
---|
| 122 | |
---|
| 123 | <div class="field" |
---|
| 124 | tal:define="error errors/email|nothing;" |
---|
| 125 | tal:attributes="class python:test(error, 'field error', 'field')" |
---|
| 126 | tal:condition="python:require_email and isAnon"> |
---|
| 127 | |
---|
[93] | 128 | <label for="email" i18n:translate="label_email">E-Mail</label> |
---|
[1] | 129 | |
---|
| 130 | <span class="fieldRequired" title="Required" |
---|
| 131 | i18n:attributes="title title_required;" |
---|
| 132 | i18n:translate="label_required">(Required) |
---|
| 133 | </span> |
---|
[93] | 134 | |
---|
| 135 | <div class="formHelp" i18n:translate="help_email" |
---|
| 136 | i18n:domain="plonecomments"> |
---|
| 137 | Enter your e-mail address. |
---|
| 138 | </div> |
---|
| 139 | |
---|
[1] | 140 | <div tal:content="error">Validation error output</div> |
---|
| 141 | |
---|
[93] | 142 | <input name="email" value="" size="40" /> |
---|
| 143 | |
---|
[1] | 144 | </div> |
---|
[93] | 145 | |
---|
[1] | 146 | </div> |
---|
| 147 | |
---|
[93] | 148 | <div tal:condition="python:(not isForAnonymous) and isAnon"> |
---|
| 149 | <dl class="portalMessage warning"> |
---|
| 150 | <dt i18n:translate=""> |
---|
| 151 | Info |
---|
| 152 | </dt> |
---|
| 153 | <dd i18n:translate="legend_note_reply_anonymous"> |
---|
| 154 | You are not logged in. You may optionally enter your |
---|
| 155 | username and password below. If you don't enter anything, |
---|
| 156 | this comment will be posted as 'Anonymous User'. |
---|
| 157 | </dd> |
---|
| 158 | </dl> |
---|
[1] | 159 | |
---|
| 160 | <div class="field"> |
---|
| 161 | |
---|
| 162 | <label for="username" i18n:translate="label_name">Name</label> |
---|
| 163 | |
---|
| 164 | <input name="username" |
---|
| 165 | id="username" |
---|
| 166 | value="" alt="Username" title="Name" |
---|
| 167 | size="40" |
---|
[93] | 168 | i18n:attributes="title label_name; alt label_username;" /> |
---|
[1] | 169 | |
---|
| 170 | </div> |
---|
| 171 | |
---|
| 172 | <div class="field"> |
---|
| 173 | |
---|
| 174 | <label for="password" i18n:translate="label_password">Password</label> |
---|
| 175 | |
---|
| 176 | <input type="password" |
---|
| 177 | id="password" |
---|
| 178 | name="password" |
---|
| 179 | value="" alt="Password" title="Password" |
---|
| 180 | size="40" |
---|
[93] | 181 | i18n:attributes="title label_password; alt label_password;" /> |
---|
[1] | 182 | |
---|
| 183 | </div> |
---|
[93] | 184 | </div> |
---|
[1] | 185 | |
---|
| 186 | <div class="field" |
---|
| 187 | tal:define="error errors/subject|nothing;" |
---|
| 188 | tal:attributes="class python:test(error, 'field error', 'field')"> |
---|
| 189 | |
---|
| 190 | <label for="subject" i18n:translate="label_subject">Subject</label> |
---|
| 191 | |
---|
| 192 | <span class="fieldRequired" title="Required" |
---|
| 193 | i18n:attributes="title title_required;" |
---|
| 194 | i18n:translate="label_required">(Required)</span> |
---|
| 195 | |
---|
| 196 | <div tal:content="error">Validation error output</div> |
---|
| 197 | |
---|
| 198 | <input name="subject" |
---|
| 199 | id="subject" |
---|
| 200 | value="" |
---|
| 201 | size="40" |
---|
[93] | 202 | tal:attributes="value request/subject|request/title_override|nothing;" /> |
---|
[1] | 203 | |
---|
| 204 | </div> |
---|
| 205 | |
---|
| 206 | <div class="field" |
---|
| 207 | tal:define="error errors/body_text|nothing;" |
---|
| 208 | tal:attributes="class python:test(error, 'field error', 'field')"> |
---|
| 209 | |
---|
| 210 | <label for="body_text" i18n:translate="label_comment">Comment</label> |
---|
| 211 | |
---|
| 212 | <span class="fieldRequired" title="Required" |
---|
| 213 | i18n:attributes="title title_required;" |
---|
| 214 | i18n:translate="label_required">(Required)</span> |
---|
| 215 | |
---|
| 216 | <div tal:content="error">Validation error output</div> |
---|
| 217 | |
---|
| 218 | <textarea name="body_text" |
---|
| 219 | id="body_text" |
---|
| 220 | cols="40" |
---|
| 221 | rows="8" |
---|
| 222 | tal:content="request/body_text|request/text_override | nothing" |
---|
| 223 | ></textarea> |
---|
| 224 | |
---|
| 225 | </div> |
---|
| 226 | |
---|
[841] | 227 | <p class="formHelp" tal:condition="python:require_email and isAnon"> |
---|
| 228 | Want to add a picture to your comments here on |
---|
| 229 | <tal:site content="portal_title|default">the Site</tal:site>? <br /> |
---|
| 230 | Upload a picture at <a href="http://en.gravatar.com">Gravatar</a> to make it happen. |
---|
| 231 | </p> |
---|
| 232 | |
---|
[1] | 233 | <div tal:condition="nocall:here/captcha_widget|nothing" |
---|
| 234 | tal:omit-tag=""> |
---|
| 235 | <div metal:use-macro="here/captcha_widget/macros/captcha" /> |
---|
| 236 | </div> |
---|
| 237 | |
---|
| 238 | <div class="formControls"> |
---|
| 239 | |
---|
[93] | 240 | <input type="hidden" name="form.submitted" value="1" /> |
---|
| 241 | |
---|
| 242 | <input type="hidden" name="require_email:boolean" value="" |
---|
| 243 | tal:attributes="value python:require_email and isAnon" /> |
---|
| 244 | |
---|
[1] | 245 | <input class="context" |
---|
| 246 | type="submit" |
---|
| 247 | value="Save" |
---|
| 248 | name="form.button.Save" |
---|
| 249 | i18n:attributes="value label_save;" |
---|
[93] | 250 | tal:attributes="name string:discussion_reply:method;" /> |
---|
[1] | 251 | |
---|
| 252 | </div> |
---|
| 253 | |
---|
| 254 | </fieldset> |
---|
| 255 | |
---|
| 256 | </form> |
---|
| 257 | |
---|
[1221] | 258 | </metal:block> |
---|
| 259 | |
---|
[1] | 260 | </div> |
---|
| 261 | |
---|
| 262 | </body> |
---|
| 263 | </html> |
---|