source: products/qPloneComments/branches/plone3_extend/browser/comments.pt @ 1591

Last change on this file since 1591 was 858, checked in by crchemist, 17 years ago

Place captchas before register button.

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