source: products/quintagroup.plonecomments/branches/jquery/quintagroup/plonecomments/browser/comments.pt @ 2240

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

Fixed anchor for comments

File size: 8.4 KB
Line 
1<tal:block define="userHasReplyPermission view/can_reply;
2                   isDiscussionAllowed view/is_discussion_allowed;
3                   replies view/get_replies;
4                   here_url context/@@plone_context_state/object_url;
5                   current_page_url context/@@plone_context_state/current_page_url;
6                   member context/@@plone_portal_state/member;
7                   isAnon view/is_anonymous;
8                   ifModerate view/is_moderation_enabled;
9                   isModerationAllowed view/can_moderate;
10                   isAuthenticatedReportAbuseEnabled view/authenticated_report_abuse_enabled;
11                   VisualEffectsLevel view/visual_effects_level;
12                   isAjaxFormsEnabled python:VisualEffectsLevel==1;
13                   isAnonymousReportAbuseEnabled view/anonymous_report_abuse_enabled;
14                   isReportAbuseEnabled python:isAnonymousReportAbuseEnabled or not isAnon and isAuthenticatedReportAbuseEnabled;
15                   props_sheet here/portal_properties/qPloneComments;
16                   require_email python:props_sheet.getProperty('require_email');"
17                   i18n:domain="plone">
18    <div class="discussion"
19         tal:condition="python:replies or (userHasReplyPermission and isDiscussionAllowed) or (isAnon and not userHasReplyPermission and isDiscussionAllowed)">
20
21        <tal:getreplies repeat="reply_dict replies">
22            <div class="comment" style=""
23                tal:condition="python:isModerationAllowed or isPublished"
24                tal:define="indent python:reply_dict['depth']*2;
25                            reply python:reply_dict['object'];
26                            comment_id python:reply_dict['object'].id;
27                            isPublished python:reply.review_state=='published';"
28                tal:attributes="style string:margin-left:${indent}em;">
29
30                <h3 tal:attributes="id reply/id">
31                    <a class="anchor"
32                       tal:content="reply/pretty_title_or_id"
33                       tal:attributes="href string:#${reply/id};
34                                       title reply/pretty_title_or_id">Comment title</a>
35                </h3>
36                <div class="documentByLine"
37                     tal:define="creator reply/Creator;
38                                 anonymous_creator python:creator=='Anonymous User';
39                                 mi python:not anonymous_creator and view.member_info(creator);
40                                 fullname python: mi and mi['fullname'] or creator;
41                                 gavatar_src python:view.getGravatar(reply)" >
42                    <img alt="Avatar" class="avatar" height="40" width="40"
43                         src="http://default.gavatar.gif"
44                         tal:attributes="src gavatar_src">
45                    <span i18n:translate="label_comment_by">Posted by</span>
46                    <span tal:content="fullname"
47                          tal:condition="not:anonymous_creator">Poster Name</span>
48                    <span i18n:translate="label_anonymous_user"
49                          tal:condition="anonymous_creator">Anonymous User</span>
50                    <span i18n:translate="label_commented_at">at</span>
51                    <span tal:replace="python:view.format_time(reply.ModificationDate())">8/23/2001 12:40:44 PM</span>
52                    <span class="state-pending"
53                          i18n:domain="quintagroup.plonecomments"
54                          i18n:translate="label_pending_state"
55                          tal:condition="python:ifModerate and not isPublished">[pending]</span>
56                </div>
57                <div class="commentBody"
58                     tal:content="structure reply/CookedBody">
59                     This is the body text of the comment.
60                </div>
61                <form name="reply"
62                      action="discussion_reply_form"
63                      method="post"
64                      style="display: inline;"
65                      tal:attributes="action string:${reply/absolute_url}/discussion_reply_form"
66                      tal:condition="python:userHasReplyPermission and isPublished">
67                    <input class="standalone"
68                           type="submit"
69                           value="Reply"
70                           tal:define="onclick string:javascript:render_edit_form(${comment_id},'reply')"
71                           tal:attributes="onclick python:isAjaxFormsEnabled and onclick or ''"
72                           i18n:attributes="value label_reply;"
73                           />
74                </form>
75                <form name="edit"
76                      action="discussion_edit_form"
77                      method="post"
78                      style="display: inline;"
79                      tal:attributes="action string:${reply/absolute_url}/discussion_edit_form"
80                      tal:condition="isModerationAllowed">
81                    <input class="standalone"
82                           type="submit"
83                           value="Edit"
84                           tal:define="onclick string:javascript:render_edit_form(${comment_id},'edit')"
85                           tal:attributes="onclick python:isAjaxFormsEnabled and onclick or ''"
86                           i18n:attributes="value label_edit;"
87                           />
88                </form>
89                <form name="delete"
90                      action=""
91                      method="post"
92                      style="display: inline;"
93                      tal:condition="isModerationAllowed"
94                      tal:attributes="action string:${reply/absolute_url}/deleteDiscussion">
95                    <input class="destructive"
96                           type="submit"
97                           value="Remove"
98                           i18n:attributes="value label_remove;"
99                           />
100                </form>
101                <form name="report_abuse"
102                      action=""
103                      method="post"
104                      style="display: inline;"
105                      i18n:domain="quintagroup.plonecomments"
106                      tal:condition="python:isReportAbuseEnabled and isPublished"
107                      tal:attributes="action string:${reply/absolute_url}/report_abuse_form#discussion">
108                    <input class="standalone"
109                        type="submit"
110                        value="Report Abuse"
111                        tal:define="onclick string:javascript:render_edit_form(${comment_id},'report_abuse')"
112                        tal:attributes="onclick python:isAjaxFormsEnabled and onclick or ''"
113                        i18n:attributes="value label_report_abuse;"
114                        />
115                </form>
116                <form name="publish_discussion"
117                      action=""
118                      method="post"
119                      style="display: inline;"
120                      tal:condition="not:isPublished"
121                      tal:attributes="action string:${reply/absolute_url}/discussion_publish_comment">
122
123                    <input class="standalone"
124                           type="submit"
125                           value="Publish"
126                           i18n:attributes="value"
127                           />
128                </form>
129                <br/>
130                <div class="documentByLine"
131                     i18n:translate="text_no_add_reply"
132                     i18n:domain="quintagroup.plonecomments"
133                     tal:condition="not:isPublished">Comment must be approved before replies to comment accepted.</div>
134                <span tal:attributes="id string:span-forms-holder-${comment_id}"></span>
135            </div>
136        </tal:getreplies>
137
138        <!-- Start of Adding comment form-->
139        <tal:addcomment define="template_id string:discussion_reply_form;">
140            <metal:block metal:use-macro="here/discussion_reply_form/macros/add-comment-form" />
141        </tal:addcomment>
142        <!-- End of Adding comment form -->
143
144        <form tal:condition="python:isAnon and not userHasReplyPermission and isDiscussionAllowed"
145              tal:attributes="action view/login_action">
146            <input class="standalone"
147                   style="margin-bottom: 1.25em;"
148                   type="submit"
149                   value="Log in to add comments"
150                   i18n:attributes="value label_login_to_add_comments;"
151                   />
152        </form>
153
154    </div>
155</tal:block>
Note: See TracBrowser for help on using the repository browser.