source: products/quintagroup.plonecomments/trunk/quintagroup/plonecomments/skins/quintagroup_plonecomments/report_abuse_form.cpt @ 1631

Last change on this file since 1631 was 1631, checked in by kroman0, 14 years ago

Fixed global variables in templates for Plone4, fixed some translation messages and preferences forms condition

File size: 14.5 KB
RevLine 
[1201]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                        portal context/@@plone_portal_state/portal;
18                        toLocalizedTime nocall:context/@@plone/toLocalizedTime;
19                        here_url context/@@plone_context_state/object_url;
20                        template_id template/getId;
21                        Iterator python:modules['Products.CMFPlone'].IndexIterator;
22                        tabindex python:Iterator(mainSlot=False);
23                        isAnon context/@@plone_portal_state/anonymous;
24                        member context/@@plone_portal_state/member;
[1201]25                        thread python:putils.getDiscussionThread(here);
26                        discussable python:thread[0];
27                        replies python:thread[1:];
28                        props_sheet here/portal_properties/qPloneComments;
29                        require_email python:props_sheet.getProperty('require_email')">
30
31            <tal:discussable define="template python:getattr(here, discussable.getLayout(), None);
32                                    macros template/macros | nothing;
33                                    main_macro macros/main | nothing;
34                                    showDiscussable python:main_macro;">
35
36                <div class="comment"
37                    tal:condition="showDiscussable"
38                    tal:define="here python:discussable">
39                    <div metal:use-macro="main_macro"/>
40                </div>
41            </tal:discussable>
42
43            <tal:thread tal:repeat="reply replies">
44                <tal:block tal:define="level repeat/reply/index">
45                    <div class="comment"
46                        tal:attributes="style python:'margin-left:'+str((int(level)+1)*2)+'em'">
47                    <h3>
48                        <tal:block replace="structure portal/discussionitem_icon.gif"/>
49                        <span tal:replace="reply/pretty_title_or_id">Comment title</span>
50                    </h3>
51                    <div class="documentByLine"
52                            tal:define="anonymous_creator python:reply.Creator()=='Anonymous User'">
53                        <span i18n:translate="label_comment_by">Posted by</span>
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>
58                        <span i18n:translate="label_commented_at">at</span>
59                        <span tal:replace="python:toLocalizedTime(reply.ModificationDate(),
60                                            long_format=1)">8/23/2001 12:40:44 PM</span>
61                    </div>
62                    <div class="commentBody"
63                            tal:content="structure reply/CookedBody">
64                            This is the body text of the comment.
65                    </div>
66                </div>
67
68                </tal:block>
69            </tal:thread>
70
71            <a name="discussion"></a>
72            <form name="edit_form"
73                class="enableAutoFocus"
74                method="post"
75                action="talkback"
76                tal:attributes="action string:$here_url/$template_id"
77                tal:define="isForAnonymous python:here.portal_properties.qPloneComments.getProperty('enable_anonymous_commenting', 0)">
78
79                <tal:set define="show_form python:True;
80                                comment_id context/id">
81                    <metal:macro define-macro="form"
82                            tal:define="isAjaxReportAbuseEnabled view/ajax_report_abuse_enabled|python:portal.portal_properties.qPloneComments.enable_ajax_report_abuse;
83                                        visible show_form|request/show_form|nothing;
84                                        portal_url portal_url|view/portal_url;
85                                        tabindex tabindex|request/tabindex|view/tabindex;
86                                        member member|request/member|view/member;">
87
88                        <span tal:define="email_from_address portal/email_from_address|view/email_from_address;
89                                            comment_id comment_id|request/comment_id"
90                            tal:attributes="style python:not visible and 'display: none' or '';
91                                            id string:span-reply-form-${comment_id}">
92
93                            <tal:if_not condition="not:email_from_address">
94                                <p class="documentDescription"
[1204]95                                i18n:domain="quintagroup.plonecomments"
[1201]96                                i18n:translate="text_no_email_setup">
97                                    This site doesn't have a valid email setup, so you cannot use
98                                    the report abuse form.
99                                </p>
100                            </tal:if_not>
101                            <tal:if condition="email_from_address">
102                                <form name="feedback_form"
103                                    method="post"
104                                    class="enableAutoFocus"
105                                    tal:attributes="action string:${here/absolute_url}/${template/id}"
106                                    tal:define="errors errors|request/errors|python:{}" >
107
108                                    <input type="hidden" name="comment_id" tal:attributes="value comment_id" />
109
110                                    <fieldset>
[1204]111                                        <h1 i18n:domain="quintagroup.plonecomments" i18n:translate="heading_report_abuse_form">Report Abuse</h1>
[1201]112
113                                        <tal:feedbackForm condition="isAnon">
114                                            <input type="hidden" name="Creator" tal:condition="not:isAnon" tal:attributes="value member/getUserName" />
115
116                                            <div class="field"
117                                                tal:define="error errors/creator|nothing"
118                                                tal:attributes="class python:error and 'field error' or 'field'">
[1631]119                                                <label for="creator" i18n:translate="label_name">
[1201]120                                                    Name
121                                                </label>
122                                                <span class="fieldRequired" title="Required"
123                                                        i18n:attributes="title title_required;"
124                                                        i18n:translate="label_required">(Required)</span>
[1631]125                                                <div class="formHelp" i18n:translate="help_name" i18n:domain="quintagroup.plonecomments">
126                                                    Please enter your name.
[1201]127                                                </div>
128                                                <div tal:content="error">Validation error output</div>
129                                                <input type="text"
130                                                        id="creator"
131                                                        name="creator"
132                                                        size="40"
133                                                        value=""
134                                                        tal:attributes="value request/creator|nothing"
135                                                        />
136                                            </div>
137                                            <div class="field"
138                                                tal:define="error errors/email|nothing"
139                                                tal:attributes="class python:error and 'field error' or 'field'">
140                                                <label for="email" i18n:translate="label_email">
141                                                    E-Mail
142                                                </label>
143                                                <span class="fieldRequired" title="Required"
144                                                        i18n:attributes="title title_required;"
145                                                        i18n:translate="label_required">(Required)</span>
[1631]146                                                <div class="formHelp" i18n:translate="help_email"
147                                                     i18n:domain="quintagroup.plonecomments">
148                                                    Please enter your e-mail address.
[1201]149                                                </div>
150                                                <div tal:content="error">Validation error output</div>
151                                                <input type="text"
152                                                        id="email"
153                                                        name="email"
154                                                        size="40"
155                                                        value=""
156                                                        tal:attributes="value request/email|nothing"
157                                                        />
158                                            </div>
159                                        </tal:feedbackForm>
160                                        <tal:feedbackForm condition="not:isAnon"
161                                                        define="fullname python:request.get('fullname', member.getProperty('fullname', ''));
162                                                                email python:request.get('email', member.getProperty('email',''));">
163                                            <input type="hidden" name="sender_fullname" value="fullname" tal:attributes="value fullname" />
164                                            <input type="hidden" name="email" value="email" tal:attributes="value email" />
165                                        </tal:feedbackForm>
166                                        <div class="field"
167                                            tal:define="error errors/message|nothing"
168                                            tal:attributes="class python:error and 'field error' or 'field'">
169                                            <label for="message" i18n:translate="label_message">
170                                                Description
171                                            </label>
172                                            <span class="fieldRequired" title="Required"
173                                                    i18n:attributes="title title_required;"
174                                                    i18n:translate="label_required">(Required)</span>
175
[1204]176                                            <div class="formHelp" i18n:domain="quintagroup.plonecomments" i18n:translate="help_message">
[1201]177                                                Please state your reasons why you would like to report this comment as abusive.
178                                                Our administrator will be notified with your message.
179                                            </div>
180                                            <div tal:content="error">Validation error output</div>
181                                            <textarea name="message" id="message" rows="5" cols="25" tal:content="request/message|nothing"> </textarea>
182                                        </div>
183                                        <metal:macro define-macro="captcha">
184                                            <div tal:define="comment_id comment_id|request/comment_id"
185                                                tal:attributes="id string:div-captcha-${comment_id}"
186                                                tal:condition="nocall:here/captcha_widget|nothing">
187                                                <div metal:use-macro="here/captcha_widget/macros/captcha" />
188                                            </div>
189                                        </metal:macro>
190
191                                        <div class="formControls">
192                                            <input type="hidden" name="form.submitted" value="1" />
193
194                                            <input type="hidden" name="require_email:boolean" value=""
195                                                tal:attributes="value python:isAnon" />
196
197                                            <input
198                                                value="Send"
199                                                type="submit"
200                                                tal:attributes="comment_id comment_id;
201                                                                class python:isAjaxReportAbuseEnabled  and 'context input-report-abuse-send' or 'context'"
202                                                i18n:attributes="value label_send;"
203                                                />
204
205                                            <input
206                                                id="input-report-abuse-cancel"
207                                                class="destructive"
208                                                value="Cancel"
209                                                type="button"
210                                                tal:condition="isAjaxReportAbuseEnabled"
211                                                tal:attributes="onclick string:javascript:remove_abuse_report_form(${comment_id})"
212                                                i18n:attributes="value label_cancel;"
213                                                />
214                                        </div>
215                                    </fieldset>
216                                </form>
217                            </tal:if>
218                        </span>
219                    </metal:macro>
220                </tal:set>
221
222            </form>
223        </div>
224    </body>
225</html>
Note: See TracBrowser for help on using the repository browser.