source: products/qPloneComments/tags/1.6/skins/qplonecomments/viewThreadsAtBottom.pt @ 1591

Last change on this file since 1591 was 1, checked in by myroslav, 19 years ago

Building directory structure

File size: 7.8 KB
Line 
1<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
2      i18n:domain="plone">
3
4<body>
5
6<div metal:define-macro="discussionView"
7     class="discussion"
8     tal:define="userHasReplyPermission python:checkPermission('Reply to item', here);
9                 portal_discussion portal/portal_discussion;
10                 isDiscussionAllowed python:portal_discussion.isDiscussionAllowedFor(here);
11                 userIsAnonymous isAnon;
12                 hereTypeInfo python:request.get('this_typeinfo', here.getTypeInfo());
13                 view_action python:hereTypeInfo.getActionById('view');
14                 isViewTemplate python:template_id==view_action;
15                 ">
16
17    <tal:allowed condition="python:isDiscussionAllowed and isViewTemplate">
18
19        <form name="reply"
20              action=""
21              method="post"
22              tal:condition="userHasReplyPermission"
23              tal:attributes="action string:$here_url/discussion_reply_form">
24
25            <input class="standalone"
26                   type="submit"
27                   value="Add Comment"
28                   i18n:attributes="value"
29                   />
30        </form>
31
32        <form tal:condition="python:userIsAnonymous and not userHasReplyPermission"
33              tal:define="pss modules/Products/PythonScripts/standard"
34              tal:attributes="action python:'%s/login_form?came_from=%s' %
35                                            (here.portal_url(),
36                                            pss.url_quote(request['URL']))">
37
38            <input class="standalone"
39                   type="submit"
40                   value="Log in to add comments"
41                   i18n:attributes="value"
42                   />
43        </form>
44
45        <a name="comments"> </a>
46
47        <tal:getreplies repeat="reply python:portal.sort_modified_ascending(
48                                             portal_discussion.getDiscussionFor(here).getReplies())">
49
50                <div class="comment"
51                     tal:define="isPublished reply/isDIPublished;
52                                 ifModerate here/ifModerate">
53                    <h3>
54                        <tal:block replace="structure portal/discussionitem_icon.gif"/>
55                        <span tal:replace="reply/title_or_id">Comment title</span>
56                    </h3>
57
58                    <div class="documentByLine"
59                         tal:define="creator reply/Creator;
60                                     anonymous_creator python:creator=='Anonymous User';
61                                     isMember python:not reply.getProperty('isAnon',1)">
62                        <span tal:content="python:test(isPublished, 'Published', 'Not Published')"
63                              tal:condition="ifModerate"> Publish state </span>
64                        <span i18n:translate="label_comment_by">Posted by</span>
65                        <strong tal:content="creator"
66                                tal:condition="isMember">Name</strong>
67                        <tal:x tal:replace="creator"
68                                tal:condition="not: isMember">Name</tal:x>
69                        <span i18n:translate="label_anonymous_user"
70                              tal:condition="anonymous_creator">Anonymous User</span>
71                        <span i18n:translate="label_commented_at">at</span>
72                        <span tal:replace="python:portal.toPortalTime(reply.modified(),
73                                                  long_format=1)">8/23/2001 12:40:44 PM</span>
74                    </div>
75
76                    <div class="commentBody"
77                         tal:content="structure reply/CookedBody">
78                        This is the body text of the comment.
79                    </div>
80
81                    <form name="reply"
82                         action="discussion_reply_form"
83                         method="post"
84                         style="display: inline;"
85                         tal:attributes="action string:${reply/absolute_url}/discussion_reply_form"
86                         tal:condition="python:checkPermission('Reply to item', reply) and isPublished">
87
88                        <input class="standalone"
89                               type="submit"
90                               value="Reply to this"
91                               i18n:attributes="value"
92                               />
93                    </form>
94
95                    <form name="delete"
96                          action=""
97                          method="post"
98                          style="display: inline;"
99                          tal:condition="python:checkPermission('Manage portal', here)"
100                          tal:attributes="action string:${reply/absolute_url}/deleteDiscussion">
101
102                        <input class="destructive"
103                               type="submit"
104                               value="Remove This Discussion"
105                               i18n:attributes="value"
106                               />
107                    </form>
108
109                    <form name="publish_discussion"
110                          action=""
111                          method="post"
112                          style="display: inline;"
113                          tal:condition="python:not isPublished"
114                          tal:attributes="action string:${reply/absolute_url}/discussion_publish_comment">
115
116                        <input class="standalone"
117                               type="submit"
118                               value="Publish This Discussion"
119                               i18n:attributes="value"
120                               />
121                    </form>
122
123                    <div class="documentByLine"
124                         tal:condition="not:isPublished">Until publishing this comment adding reply impossible.</div>
125
126                    <div tal:define="replies python:here.getReplyReplies(reply)"
127                         tal:condition="replies">
128
129                        <h4 i18n:translate="legend_replies_to_this_comment">Replies to this comment</h4>
130
131                        <div tal:repeat="lst replies">
132                            <span tal:omit-tag=""
133                                  tal:content="structure python:'&nbsp;' * lst['depth']" />
134                            <a href=""
135                               tal:define="lst_object nocall:lst/object;
136                                           creator python:lst_object.Creator();
137                                           anonymous_creator python:creator=='Anonymous User';
138                                           isMember python:not lst_object.getProperty('isAnon',1)"
139                               tal:attributes="href string:${lst_object/absolute_url}/discussionitem_view">
140                                <tal:block replace="structure here/discussionitem_icon.gif"/>
141                                <span tal:replace="lst_object/Title">Comment title</span>
142                                (<span i18n:translate="label_comment_by">Posted by</span>
143                                <strong tal:content="creator"
144                                        tal:condition="isMember">Name</strong>
145                                <tal:x tal:replace="creator"
146                                        tal:condition="not: isMember">Name</tal:x>
147                                <span i18n:translate="label_anonymous_user"
148                                      tal:condition="anonymous_creator">Anonymous User</span>
149                                <span i18n:translate="label_commented_at">at</span>
150                                <span tal:replace="python:portal.toPortalTime(lst_object.modified(),
151                                                          long_format=1)">8/23/2001 12:49:08 PM</span>)
152                            </a>
153                        </div>
154
155                    </div>
156
157                </div>
158
159            </tal:getreplies>
160
161    </tal:allowed>
162
163</div>
164
165</body>
166
167</html>
Note: See TracBrowser for help on using the repository browser.