[822] | 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="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; |
---|
[1631] | 16 | putils context/plone_utils; |
---|
| 17 | toLocalizedTime nocall:context/@@plone/toLocalizedTime; |
---|
| 18 | portal context/@@plone_portal_state/portal; |
---|
| 19 | here_url context/@@plone_context_state/object_url; |
---|
| 20 | current_page_url context/@@plone_context_state/current_page_url; |
---|
| 21 | isAnon context/@@plone_portal_state/anonymous; |
---|
| 22 | member context/@@plone_portal_state/member; |
---|
| 23 | template_id template/getId; |
---|
[822] | 24 | thread python:putils.getDiscussionThread(here); |
---|
| 25 | discussable python:thread[0]; |
---|
| 26 | replies python:thread[1:]; |
---|
| 27 | props_sheet here/portal_properties/qPloneComments; |
---|
| 28 | require_email python:props_sheet.getProperty('require_email')"> |
---|
| 29 | |
---|
| 30 | <tal:discussable define="template python:getattr(here, discussable.getLayout(), None); |
---|
| 31 | macros template/macros | nothing; |
---|
| 32 | main_macro macros/main | nothing; |
---|
| 33 | showDiscussable python:main_macro;"> |
---|
| 34 | |
---|
| 35 | <div class="comment" |
---|
| 36 | tal:condition="showDiscussable" |
---|
| 37 | tal:define="here python:discussable"> |
---|
| 38 | <div metal:use-macro="main_macro"/> |
---|
| 39 | </div> |
---|
| 40 | </tal:discussable> |
---|
| 41 | |
---|
| 42 | <tal:thread tal:repeat="reply replies"> |
---|
| 43 | <tal:block tal:define="level repeat/reply/index"> |
---|
| 44 | <div class="comment" |
---|
| 45 | tal:attributes="style python:'margin-left:'+str((int(level)+1)*2)+'em'"> |
---|
| 46 | <h3> |
---|
| 47 | <tal:block replace="structure portal/discussionitem_icon.gif"/> |
---|
| 48 | <span tal:replace="reply/pretty_title_or_id">Comment title</span> |
---|
| 49 | </h3> |
---|
| 50 | <div class="documentByLine" |
---|
| 51 | tal:define="anonymous_creator python:reply.Creator()=='Anonymous User'"> |
---|
[3106] | 52 | <span i18n:domain="quintagroup.plonecomments" |
---|
| 53 | i18n:translate="label_comment_by">Posted by</span> |
---|
[822] | 54 | <span tal:content="reply/Creator" |
---|
| 55 | tal:condition="not:anonymous_creator">Poster Name</span> |
---|
| 56 | <span i18n:translate="label_anonymous_user" |
---|
| 57 | tal:condition="anonymous_creator">Anonymous User</span> |
---|
[3106] | 58 | <span i18n:domain="quintagroup.plonecomments" |
---|
| 59 | i18n:translate="label_commented_at">at</span> |
---|
[822] | 60 | <span tal:replace="python:toLocalizedTime(reply.ModificationDate(), |
---|
| 61 | long_format=1)">8/23/2001 12:40:44 PM</span> |
---|
| 62 | </div> |
---|
| 63 | <div class="commentBody" |
---|
| 64 | tal:content="structure reply/CookedBody"> |
---|
| 65 | This is the body text of the comment. |
---|
| 66 | </div> |
---|
| 67 | </div> |
---|
| 68 | |
---|
| 69 | </tal:block> |
---|
| 70 | </tal:thread> |
---|
| 71 | |
---|
| 72 | <a name="discussion"></a> |
---|
| 73 | |
---|
[1222] | 74 | <metal:block metal:define-macro="add-comment-form"> |
---|
| 75 | |
---|
[822] | 76 | <form name="edit_form" |
---|
| 77 | method="post" |
---|
| 78 | action="talkback" |
---|
[1505] | 79 | tal:attributes="action string:$here_url/$template_id; |
---|
| 80 | class python:'discussion_reply_form' in current_page_url and 'enableAutoFocus' or ''" |
---|
[822] | 81 | tal:define="isForAnonymous python:here.portal_properties.qPloneComments.getProperty('enable_anonymous_commenting', 0)"> |
---|
| 82 | |
---|
| 83 | <fieldset> |
---|
| 84 | |
---|
[3106] | 85 | <legend i18n:domain="quintagroup.plonecomments" |
---|
| 86 | i18n:translate="legend_add_comment">Add comment</legend> |
---|
[822] | 87 | |
---|
[3106] | 88 | <p i18n:domain="quintagroup.plonecomments" |
---|
| 89 | i18n:translate="description_add_comment"> |
---|
[822] | 90 | You can add a comment by filling out the form below. Plain text |
---|
| 91 | formatting. |
---|
| 92 | </p> |
---|
| 93 | |
---|
| 94 | <input type="hidden" name="Creator" value="" |
---|
| 95 | tal:attributes="value member/getUserName" |
---|
| 96 | tal:condition="not:isForAnonymous"/> |
---|
| 97 | |
---|
| 98 | <div tal:condition="isForAnonymous"> |
---|
| 99 | |
---|
| 100 | <input type="hidden" |
---|
| 101 | name="Creator" |
---|
| 102 | tal:condition="not:isAnon" |
---|
| 103 | tal:attributes="value member/getUserName" /> |
---|
| 104 | |
---|
| 105 | <div class="field" |
---|
| 106 | tal:condition="isAnon" |
---|
| 107 | tal:define="error errors/Creator|nothing;" |
---|
[3106] | 108 | tal:attributes="class python:test(error, 'field error', 'field');" |
---|
| 109 | i18n:domain="plone"> |
---|
[822] | 110 | |
---|
| 111 | <label for="username" i18n:translate="label_name">Name</label> |
---|
| 112 | |
---|
| 113 | <span class="fieldRequired" title="Required" |
---|
| 114 | tal:condition="isAnon" |
---|
| 115 | i18n:attributes="title" |
---|
| 116 | i18n:translate="label_required">(Required)</span> |
---|
| 117 | |
---|
| 118 | <div class="formHelp" i18n:translate="help_name" |
---|
| 119 | i18n:domain="quintagroup.plonecomments"> |
---|
[1631] | 120 | Please enter your name. |
---|
[822] | 121 | </div> |
---|
| 122 | |
---|
| 123 | <div tal:content="error">Validation error output</div> |
---|
| 124 | |
---|
| 125 | <div> |
---|
| 126 | <input name="Creator" |
---|
| 127 | id="username" |
---|
| 128 | value="" alt="Submitter" title="Name" |
---|
| 129 | size="40" |
---|
[3106] | 130 | i18n:attributes="alt; title label_name" |
---|
[822] | 131 | tal:attributes="value request/Creator | nothing" /> |
---|
| 132 | </div> |
---|
| 133 | |
---|
| 134 | </div> |
---|
| 135 | |
---|
| 136 | <div class="field" |
---|
| 137 | tal:define="error errors/email|nothing;" |
---|
| 138 | tal:attributes="class python:test(error, 'field error', 'field')" |
---|
| 139 | tal:condition="python:require_email and isAnon"> |
---|
| 140 | |
---|
| 141 | <label for="email" i18n:translate="label_email">E-Mail</label> |
---|
| 142 | |
---|
| 143 | <span class="fieldRequired" title="Required" |
---|
| 144 | i18n:attributes="title title_required;" |
---|
| 145 | i18n:translate="label_required">(Required) |
---|
| 146 | </span> |
---|
| 147 | |
---|
| 148 | <div class="formHelp" i18n:translate="help_email" |
---|
| 149 | i18n:domain="quintagroup.plonecomments"> |
---|
[1631] | 150 | Please enter your e-mail address. |
---|
[822] | 151 | </div> |
---|
| 152 | |
---|
| 153 | <div tal:content="error">Validation error output</div> |
---|
| 154 | |
---|
[2597] | 155 | <input id="email" name="email" value="" size="40" /> |
---|
[822] | 156 | |
---|
| 157 | </div> |
---|
| 158 | |
---|
| 159 | </div> |
---|
| 160 | |
---|
[3106] | 161 | <div tal:condition="python:(not isForAnonymous) and isAnon" |
---|
| 162 | i18n:domain="plone"> |
---|
[822] | 163 | <dl class="portalMessage warning"> |
---|
| 164 | <dt i18n:translate=""> |
---|
| 165 | Info |
---|
| 166 | </dt> |
---|
| 167 | <dd i18n:translate="legend_note_reply_anonymous"> |
---|
[1631] | 168 | Note: you are not logged in. You may optionally enter your |
---|
| 169 | username and password below. If you don't enter your |
---|
| 170 | username and password below, this comment will be posted as |
---|
| 171 | the 'Anonymous User'. |
---|
[822] | 172 | </dd> |
---|
| 173 | </dl> |
---|
| 174 | |
---|
| 175 | <div class="field"> |
---|
| 176 | |
---|
| 177 | <label for="username" i18n:translate="label_name">Name</label> |
---|
| 178 | |
---|
| 179 | <input name="username" |
---|
| 180 | id="username" |
---|
| 181 | value="" alt="Username" title="Name" |
---|
| 182 | size="40" |
---|
| 183 | i18n:attributes="title label_name; alt label_username;" /> |
---|
| 184 | |
---|
| 185 | </div> |
---|
| 186 | |
---|
| 187 | <div class="field"> |
---|
| 188 | |
---|
| 189 | <label for="password" i18n:translate="label_password">Password</label> |
---|
| 190 | |
---|
| 191 | <input type="password" |
---|
| 192 | id="password" |
---|
| 193 | name="password" |
---|
| 194 | value="" alt="Password" title="Password" |
---|
| 195 | size="40" |
---|
| 196 | i18n:attributes="title label_password; alt label_password;" /> |
---|
| 197 | |
---|
| 198 | </div> |
---|
| 199 | </div> |
---|
| 200 | |
---|
| 201 | <div class="field" |
---|
| 202 | tal:define="error errors/subject|nothing;" |
---|
| 203 | tal:attributes="class python:test(error, 'field error', 'field')"> |
---|
| 204 | |
---|
| 205 | <label for="subject" i18n:translate="label_subject">Subject</label> |
---|
| 206 | |
---|
| 207 | <span class="fieldRequired" title="Required" |
---|
| 208 | i18n:attributes="title title_required;" |
---|
| 209 | i18n:translate="label_required">(Required)</span> |
---|
| 210 | |
---|
| 211 | <div tal:content="error">Validation error output</div> |
---|
| 212 | |
---|
| 213 | <input name="subject" |
---|
| 214 | id="subject" |
---|
| 215 | value="" |
---|
| 216 | size="40" |
---|
| 217 | tal:attributes="value request/subject|request/title_override|nothing;" /> |
---|
| 218 | |
---|
| 219 | </div> |
---|
| 220 | |
---|
| 221 | <div class="field" |
---|
| 222 | tal:define="error errors/body_text|nothing;" |
---|
| 223 | tal:attributes="class python:test(error, 'field error', 'field')"> |
---|
| 224 | |
---|
| 225 | <label for="body_text" i18n:translate="label_comment">Comment</label> |
---|
| 226 | |
---|
| 227 | <span class="fieldRequired" title="Required" |
---|
| 228 | i18n:attributes="title title_required;" |
---|
| 229 | i18n:translate="label_required">(Required)</span> |
---|
| 230 | |
---|
| 231 | <div tal:content="error">Validation error output</div> |
---|
| 232 | |
---|
| 233 | <textarea name="body_text" |
---|
| 234 | id="body_text" |
---|
| 235 | cols="40" |
---|
| 236 | rows="8" |
---|
| 237 | tal:content="request/body_text|request/text_override | nothing" |
---|
| 238 | ></textarea> |
---|
| 239 | |
---|
| 240 | </div> |
---|
| 241 | |
---|
| 242 | <div tal:condition="nocall:here/captcha_widget|nothing" |
---|
| 243 | tal:omit-tag=""> |
---|
| 244 | <div metal:use-macro="here/captcha_widget/macros/captcha" /> |
---|
| 245 | </div> |
---|
| 246 | |
---|
| 247 | <div class="formControls"> |
---|
| 248 | |
---|
| 249 | <input type="hidden" name="form.submitted" value="1" /> |
---|
| 250 | |
---|
| 251 | <input type="hidden" name="require_email:boolean" value="" |
---|
| 252 | tal:attributes="value python:require_email and isAnon" /> |
---|
| 253 | |
---|
| 254 | <input class="context" |
---|
| 255 | type="submit" |
---|
| 256 | value="Save" |
---|
| 257 | name="form.button.Save" |
---|
[2236] | 258 | i18n:attributes="value label_save;" /> |
---|
[2087] | 259 | <input class="standalone" |
---|
| 260 | type="submit" |
---|
| 261 | value="Cancel" |
---|
| 262 | name="form.button.Cancel" |
---|
| 263 | i18n:attributes="value label_cancel;" /> |
---|
[822] | 264 | |
---|
| 265 | </div> |
---|
| 266 | |
---|
| 267 | </fieldset> |
---|
| 268 | |
---|
| 269 | </form> |
---|
| 270 | |
---|
[1222] | 271 | </metal:block> |
---|
| 272 | |
---|
[822] | 273 | </div> |
---|
| 274 | |
---|
| 275 | </body> |
---|
| 276 | </html> |
---|