source: products/qPloneComments/tags/1.5/skins/qplonecomments/viewThreadsAtBottom.pt @ 458

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

Building directory structure

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