source: products/quintagroup.plonecomments/trunk/quintagroup/plonecomments/browser/comments.pt @ 822

Last change on this file since 822 was 822, checked in by koval, 17 years ago

little change in member properties extraction

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